Merge tag 'mvebu-dt-5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement...
authorArnd Bergmann <arnd@arndb.de>
Tue, 1 Mar 2022 14:56:35 +0000 (15:56 +0100)
committerArnd Bergmann <arnd@arndb.de>
Tue, 1 Mar 2022 14:56:35 +0000 (15:56 +0100)
mvebu dt for 5.18 (part 1)

Add new 2 bays NAS:
 - Ctera C200 V1 (kirkwood based)
 - Ctera C200 V2 (armada-370 based)

Add support for PCIe legacy INTx interrupts on Armada 385

Add PCIe proprty to limit the power on miniPCIe slots in Turris Omnia

* tag 'mvebu-dt-5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu:
  ARM: dts: turris-omnia: Set PCIe slot-power-limit-milliwatt properties
  ARM: dts: mvebu: Add Ctera C-200 V2 board
  ARM: dts: kirkwood: Add Ctera C-200 V1 board
  dt-bindings: vendor-prefixes: Add Ctera Networks
  ARM: dts: armada-385.dtsi: Add definitions for PCIe legacy INTx interrupts

Link: https://lore.kernel.org/r/87pmn5zrd0.fsf@BL-laptop
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1327 files changed:
.mailmap
Documentation/accounting/psi.rst
Documentation/admin-guide/gpio/index.rst
Documentation/arm/marvell.rst
Documentation/arm64/silicon-errata.rst
Documentation/dev-tools/kselftest.rst
Documentation/devicetree/bindings/arm/airoha.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/arm/altera.yaml
Documentation/devicetree/bindings/arm/amlogic.yaml
Documentation/devicetree/bindings/arm/atmel-at91.yaml
Documentation/devicetree/bindings/arm/cpus.yaml
Documentation/devicetree/bindings/arm/fsl.yaml
Documentation/devicetree/bindings/arm/intel,socfpga.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/arm/mediatek.yaml
Documentation/devicetree/bindings/arm/mstar/mstar.yaml
Documentation/devicetree/bindings/arm/npcm/nuvoton,gcr.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/arm/qcom.yaml
Documentation/devicetree/bindings/arm/renesas.yaml
Documentation/devicetree/bindings/arm/rockchip.yaml
Documentation/devicetree/bindings/arm/samsung/samsung-boards.yaml
Documentation/devicetree/bindings/arm/stm32/stm32.yaml
Documentation/devicetree/bindings/arm/sunxi.yaml
Documentation/devicetree/bindings/arm/tesla.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/arm/ti/k3.yaml
Documentation/devicetree/bindings/clock/intc_stratix10.txt [deleted file]
Documentation/devicetree/bindings/clock/intel,stratix10.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/clock/mstar,msc313-cpupll.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/clock/tesla,fsd-clock.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/interrupt-controller/renesas,irqc.yaml
Documentation/devicetree/bindings/interrupt-controller/sifive,plic-1.0.0.yaml
Documentation/devicetree/bindings/net/can/tcan4x5x.txt
Documentation/devicetree/bindings/net/qcom,ipa.yaml
Documentation/devicetree/bindings/phy/qcom,usb-hs-phy.txt
Documentation/devicetree/bindings/pinctrl/samsung,pinctrl-gpio-bank.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/pinctrl/samsung,pinctrl-pins-cfg.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/pinctrl/samsung,pinctrl-wakeup-interrupt.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/pinctrl/samsung,pinctrl.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt [deleted file]
Documentation/devicetree/bindings/power/fsl,imx-gpcv2.yaml
Documentation/devicetree/bindings/power/renesas,rzg2l-sysc.yaml
Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-hsio-blk-ctrl.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/soc/imx/fsl,imx8mq-vpu-blk-ctrl.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/soc/rockchip/grf.yaml
Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.yaml
Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml
Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt
Documentation/devicetree/bindings/vendor-prefixes.yaml
Documentation/devicetree/bindings/watchdog/mtk-wdt.txt
Documentation/filesystems/netfs_library.rst
Documentation/gpu/todo.rst
Documentation/index.rst
Documentation/kernel-hacking/locking.rst
Documentation/tools/index.rst [new file with mode: 0644]
Documentation/tools/rtla/index.rst [new file with mode: 0644]
Documentation/userspace-api/ioctl/ioctl-number.rst
Documentation/virt/kvm/api.rst
Documentation/vm/page_table_check.rst
MAINTAINERS
Makefile
arch/arm/Kconfig
arch/arm/Makefile
arch/arm/boot/dts/Makefile
arch/arm/boot/dts/am335x-pdu001.dts
arch/arm/boot/dts/am335x-sancloud-bbe-extended-wifi.dts [new file with mode: 0644]
arch/arm/boot/dts/aspeed-bmc-ampere-mtjade.dts
arch/arm/boot/dts/aspeed-bmc-asrock-romed8hm3.dts [new file with mode: 0644]
arch/arm/boot/dts/aspeed-bmc-facebook-bletchley.dts
arch/arm/boot/dts/aspeed-bmc-ibm-everest.dts
arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts
arch/arm/boot/dts/aspeed-bmc-opp-tacoma.dts
arch/arm/boot/dts/aspeed-bmc-quanta-s6q.dts [new file with mode: 0644]
arch/arm/boot/dts/at91-sama7g5ek.dts
arch/arm/boot/dts/en7523-evb.dts [new file with mode: 0644]
arch/arm/boot/dts/en7523.dtsi [new file with mode: 0644]
arch/arm/boot/dts/exynos3250-artik5.dtsi
arch/arm/boot/dts/exynos3250-monk.dts
arch/arm/boot/dts/exynos3250-pinctrl.dtsi
arch/arm/boot/dts/exynos3250-rinato.dts
arch/arm/boot/dts/exynos3250.dtsi
arch/arm/boot/dts/exynos4.dtsi
arch/arm/boot/dts/exynos4210-i9100.dts
arch/arm/boot/dts/exynos4210-origen.dts
arch/arm/boot/dts/exynos4210-pinctrl.dtsi
arch/arm/boot/dts/exynos4210-smdkv310.dts
arch/arm/boot/dts/exynos4210-trats.dts
arch/arm/boot/dts/exynos4210-universal_c210.dts
arch/arm/boot/dts/exynos4210.dtsi
arch/arm/boot/dts/exynos4412-galaxy-s3.dtsi
arch/arm/boot/dts/exynos4412-itop-elite.dts
arch/arm/boot/dts/exynos4412-itop-scp-core.dtsi
arch/arm/boot/dts/exynos4412-midas.dtsi
arch/arm/boot/dts/exynos4412-odroid-common.dtsi
arch/arm/boot/dts/exynos4412-odroidx.dts
arch/arm/boot/dts/exynos4412-origen.dts
arch/arm/boot/dts/exynos4412-p4note.dtsi
arch/arm/boot/dts/exynos4412-pinctrl.dtsi
arch/arm/boot/dts/exynos4412-smdk4412.dts
arch/arm/boot/dts/exynos4412.dtsi
arch/arm/boot/dts/exynos5250-arndale.dts
arch/arm/boot/dts/exynos5250-pinctrl.dtsi
arch/arm/boot/dts/exynos5250-smdk5250.dts
arch/arm/boot/dts/exynos5250-snow-common.dtsi
arch/arm/boot/dts/exynos5250-snow-rev5.dts
arch/arm/boot/dts/exynos5250-snow.dts
arch/arm/boot/dts/exynos5250-spring.dts
arch/arm/boot/dts/exynos5250.dtsi
arch/arm/boot/dts/exynos5260-pinctrl.dtsi
arch/arm/boot/dts/exynos5260-xyref5260.dts
arch/arm/boot/dts/exynos5260.dtsi
arch/arm/boot/dts/exynos5410-odroidxu.dts
arch/arm/boot/dts/exynos5410-pinctrl.dtsi
arch/arm/boot/dts/exynos5410-smdk5410.dts
arch/arm/boot/dts/exynos5410.dtsi
arch/arm/boot/dts/exynos5420-arndale-octa.dts
arch/arm/boot/dts/exynos5420-chagall-wifi.dts [new file with mode: 0644]
arch/arm/boot/dts/exynos5420-galaxy-tab-common.dtsi [new file with mode: 0644]
arch/arm/boot/dts/exynos5420-klimt-wifi.dts [new file with mode: 0644]
arch/arm/boot/dts/exynos5420-peach-pit.dts
arch/arm/boot/dts/exynos5420-pinctrl.dtsi
arch/arm/boot/dts/exynos5420-smdk5420.dts
arch/arm/boot/dts/exynos5420.dtsi
arch/arm/boot/dts/exynos5422-odroid-core.dtsi
arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
arch/arm/boot/dts/exynos5800-peach-pi.dts
arch/arm/boot/dts/imx28-tx28.dts
arch/arm/boot/dts/imx28.dtsi
arch/arm/boot/dts/imx51-ts4800.dts
arch/arm/boot/dts/imx53-m53menlo.dts
arch/arm/boot/dts/imx53-tx53.dtsi
arch/arm/boot/dts/imx6dl-plym2m.dts
arch/arm/boot/dts/imx6dl-prtvt7.dts
arch/arm/boot/dts/imx6dl-victgo.dts
arch/arm/boot/dts/imx6q-tbs2910.dts
arch/arm/boot/dts/imx6qdl-dhcom-pdk2.dtsi
arch/arm/boot/dts/imx6qdl-mba6.dtsi
arch/arm/boot/dts/imx6qdl-mba6a.dtsi
arch/arm/boot/dts/imx6qdl-mba6b.dtsi
arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
arch/arm/boot/dts/imx6qdl-phytec-phycore-som.dtsi
arch/arm/boot/dts/imx6qdl-tqma6.dtsi
arch/arm/boot/dts/imx6qdl-tqma6a.dtsi
arch/arm/boot/dts/imx6qdl-tqma6b.dtsi
arch/arm/boot/dts/imx6qdl-tx6-mb7.dtsi
arch/arm/boot/dts/imx6qdl-vicut1.dtsi
arch/arm/boot/dts/imx6qp-sabresd.dts
arch/arm/boot/dts/imx6sx-udoo-neo.dtsi
arch/arm/boot/dts/imx6ul-tx6ul-mainboard.dts
arch/arm/boot/dts/imx7-colibri-aster.dtsi
arch/arm/boot/dts/imx7-colibri-eval-v3.dtsi
arch/arm/boot/dts/imx7-colibri.dtsi
arch/arm/boot/dts/imx7-mba7.dtsi
arch/arm/boot/dts/imx7d-nitrogen7.dts
arch/arm/boot/dts/imx7d-pico-hobbit.dts
arch/arm/boot/dts/imx7d-pico-pi.dts
arch/arm/boot/dts/imx7d-sdb.dts
arch/arm/boot/dts/imx7d.dtsi
arch/arm/boot/dts/imx7s-warp.dts
arch/arm/boot/dts/imxrt1050-pinfunc.h [new file with mode: 0644]
arch/arm/boot/dts/intel-ixp42x-gateway-7001.dts
arch/arm/boot/dts/intel-ixp42x-netgear-wg302v1.dts [moved from arch/arm/boot/dts/intel-ixp42x-netgear-wg302v2.dts with 77% similarity]
arch/arm/boot/dts/intel-ixp42x.dtsi
arch/arm/boot/dts/iwg20d-q7-common.dtsi
arch/arm/boot/dts/lan966x-pcb8291.dts [new file with mode: 0644]
arch/arm/boot/dts/lan966x.dtsi [new file with mode: 0644]
arch/arm/boot/dts/logicpd-torpedo-35xx-devkit.dts
arch/arm/boot/dts/logicpd-torpedo-37xx-devkit.dts
arch/arm/boot/dts/logicpd-torpedo-baseboard.dtsi
arch/arm/boot/dts/mstar-infinity.dtsi
arch/arm/boot/dts/mstar-infinity2m-ssd201-som2d01.dtsi [new file with mode: 0644]
arch/arm/boot/dts/mstar-infinity2m-ssd202d-100ask-dongshanpione.dts [new file with mode: 0644]
arch/arm/boot/dts/mstar-infinity2m-ssd202d-miyoo-mini.dts [new file with mode: 0644]
arch/arm/boot/dts/mstar-infinity2m-ssd202d-wirelesstag-ido-sbc2d06-v1b-22w.dts [new file with mode: 0644]
arch/arm/boot/dts/mstar-infinity2m-ssd202d-wirelesstag-ido-som2d01.dtsi [new file with mode: 0644]
arch/arm/boot/dts/mstar-infinity2m-ssd20xd.dtsi
arch/arm/boot/dts/mstar-infinity2m.dtsi
arch/arm/boot/dts/mstar-infinity3.dtsi
arch/arm/boot/dts/mstar-v7.dtsi
arch/arm/boot/dts/mt6582-prestigio-pmt5008-3g.dts [new file with mode: 0644]
arch/arm/boot/dts/mt6582.dtsi [new file with mode: 0644]
arch/arm/boot/dts/nuvoton-wpcm450-supermicro-x9sci-ln4f.dts
arch/arm/boot/dts/nuvoton-wpcm450.dtsi
arch/arm/boot/dts/openbmc-flash-layout-64.dtsi
arch/arm/boot/dts/openbmc-flash-layout.dtsi
arch/arm/boot/dts/ox810se-wd-mbwe.dts
arch/arm/boot/dts/ox810se.dtsi
arch/arm/boot/dts/qcom-apq8026-lg-lenok.dts
arch/arm/boot/dts/qcom-apq8060-dragonboard.dts
arch/arm/boot/dts/qcom-apq8064-asus-nexus7-flo.dts
arch/arm/boot/dts/qcom-apq8064.dtsi
arch/arm/boot/dts/qcom-ipq4019.dtsi
arch/arm/boot/dts/qcom-mdm9615.dtsi
arch/arm/boot/dts/qcom-msm8226.dtsi
arch/arm/boot/dts/qcom-msm8660.dtsi
arch/arm/boot/dts/qcom-msm8960-cdp.dts
arch/arm/boot/dts/qcom-msm8960.dtsi
arch/arm/boot/dts/qcom-pm8226.dtsi
arch/arm/boot/dts/qcom-sdx55.dtsi
arch/arm/boot/dts/r8a7740-armadillo800eva.dts
arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
arch/arm/boot/dts/r8a7742-iwg21d-q7.dts
arch/arm/boot/dts/r8a7742-iwg21m.dtsi
arch/arm/boot/dts/r8a77470-iwg23s-sbc.dts
arch/arm/boot/dts/r9a06g032-rzn1d400-db.dts
arch/arm/boot/dts/r9a06g032.dtsi
arch/arm/boot/dts/rk3288.dtsi
arch/arm/boot/dts/s3c2416-pinctrl.dtsi
arch/arm/boot/dts/s3c6410-mini6410.dts
arch/arm/boot/dts/s3c64xx-pinctrl.dtsi
arch/arm/boot/dts/s3c64xx.dtsi
arch/arm/boot/dts/s5pv210-aquila.dts
arch/arm/boot/dts/s5pv210-aries.dtsi
arch/arm/boot/dts/s5pv210-fascinate4g.dts
arch/arm/boot/dts/s5pv210-galaxys.dts
arch/arm/boot/dts/s5pv210-pinctrl.dtsi
arch/arm/boot/dts/sam9x60.dtsi
arch/arm/boot/dts/sama5d2.dtsi
arch/arm/boot/dts/sama5d3.dtsi
arch/arm/boot/dts/sama5d4.dtsi
arch/arm/boot/dts/sama7g5.dtsi
arch/arm/boot/dts/socfpga_arria10_mercury_aa1.dts
arch/arm/boot/dts/socfpga_arria10_socdk.dtsi
arch/arm/boot/dts/socfpga_arria5_socdk.dts
arch/arm/boot/dts/socfpga_cyclone5_chameleon96.dts
arch/arm/boot/dts/socfpga_cyclone5_de0_nano_soc.dts
arch/arm/boot/dts/socfpga_cyclone5_socdk.dts
arch/arm/boot/dts/socfpga_cyclone5_sockit.dts
arch/arm/boot/dts/socfpga_cyclone5_sodia.dts
arch/arm/boot/dts/ste-ab8500.dtsi
arch/arm/boot/dts/ste-ab8505.dtsi
arch/arm/boot/dts/ste-href-ab8500.dtsi
arch/arm/boot/dts/ste-href.dtsi
arch/arm/boot/dts/ste-snowball.dts
arch/arm/boot/dts/ste-ux500-samsung-codina.dts
arch/arm/boot/dts/ste-ux500-samsung-gavini.dts
arch/arm/boot/dts/ste-ux500-samsung-golden.dts
arch/arm/boot/dts/ste-ux500-samsung-janice.dts
arch/arm/boot/dts/ste-ux500-samsung-kyle.dts
arch/arm/boot/dts/ste-ux500-samsung-skomer.dts
arch/arm/boot/dts/stih407-clock.dtsi
arch/arm/boot/dts/stih407-family.dtsi
arch/arm/boot/dts/stih410-b2120.dts
arch/arm/boot/dts/stih410-b2260.dts
arch/arm/boot/dts/stih410-clock.dtsi
arch/arm/boot/dts/stih410.dtsi
arch/arm/boot/dts/stih418-b2199.dts
arch/arm/boot/dts/stih418-clock.dtsi
arch/arm/boot/dts/stih418.dtsi
arch/arm/boot/dts/stihxxx-b2120.dtsi
arch/arm/boot/dts/stm32429i-eval.dts
arch/arm/boot/dts/stm32746g-eval.dts
arch/arm/boot/dts/stm32f429-disco.dts
arch/arm/boot/dts/stm32f429.dtsi
arch/arm/boot/dts/stm32f469-disco.dts
arch/arm/boot/dts/stm32f746-disco.dts
arch/arm/boot/dts/stm32f746.dtsi
arch/arm/boot/dts/stm32f769-disco.dts
arch/arm/boot/dts/stm32mp13-pinctrl.dtsi
arch/arm/boot/dts/stm32mp131.dtsi
arch/arm/boot/dts/stm32mp135f-dk.dts
arch/arm/boot/dts/stm32mp15-pinctrl.dtsi
arch/arm/boot/dts/stm32mp151.dtsi
arch/arm/boot/dts/stm32mp153.dtsi
arch/arm/boot/dts/stm32mp157a-icore-stm32mp1-ctouch2.dts
arch/arm/boot/dts/stm32mp157a-icore-stm32mp1-edimm2.2.dts
arch/arm/boot/dts/stm32mp157a-iot-box.dts
arch/arm/boot/dts/stm32mp157a-microgea-stm32mp1-microdev2.0-of7.dts
arch/arm/boot/dts/stm32mp157a-microgea-stm32mp1-microdev2.0.dts
arch/arm/boot/dts/stm32mp157a-stinger96.dtsi
arch/arm/boot/dts/stm32mp157c-ed1.dts
arch/arm/boot/dts/stm32mp157c-emsbc-argon.dts [new file with mode: 0644]
arch/arm/boot/dts/stm32mp157c-emstamp-argon.dtsi [new file with mode: 0644]
arch/arm/boot/dts/stm32mp157c-lxa-mc1.dts
arch/arm/boot/dts/stm32mp157c-odyssey.dts
arch/arm/boot/dts/stm32mp15xx-dhcom-drc02.dtsi
arch/arm/boot/dts/stm32mp15xx-dhcom-pdk2.dtsi
arch/arm/boot/dts/stm32mp15xx-dhcom-picoitx.dtsi
arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi
arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi
arch/arm/boot/dts/stm32mp15xx-dhcor-som.dtsi
arch/arm/boot/dts/stm32mp15xx-dkx.dtsi
arch/arm/boot/dts/sun7i-a20-haoyu-marsboard.dts [new file with mode: 0644]
arch/arm/boot/dts/sun8i-h3-nanopi-neo-air.dts
arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts
arch/arm/boot/dts/sun8i-h3.dtsi
arch/arm/boot/dts/sun8i-v3s.dtsi
arch/arm/boot/dts/sunxi-h3-h5.dtsi
arch/arm/boot/dts/tegra20-asus-tf101.dts
arch/arm/boot/dts/tegra20-colibri.dtsi
arch/arm/boot/dts/tegra20-paz00.dts
arch/arm/boot/dts/tegra20-tamonten.dtsi
arch/arm/boot/dts/tegra30-asus-tf700t.dts
arch/arm/boot/dts/tegra30-asus-transformer-common.dtsi
arch/arm/boot/dts/tegra30-colibri.dtsi
arch/arm/boot/dts/tegra30-ouya.dts
arch/arm/boot/dts/tegra30-pegatron-chagall.dts
arch/arm/boot/dts/vf-colibri-eval-v3.dtsi
arch/arm/crypto/blake2s-shash.c
arch/arm/include/asm/assembler.h
arch/arm/include/asm/processor.h
arch/arm/include/asm/uaccess.h
arch/arm/mach-airoha/Makefile [new file with mode: 0644]
arch/arm/mach-airoha/airoha.c [new file with mode: 0644]
arch/arm/probes/kprobes/Makefile
arch/arm64/Kconfig
arch/arm64/Kconfig.platforms
arch/arm64/boot/dts/Makefile
arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi
arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts
arch/arm64/boot/dts/altera/socfpga_stratix10_socdk_nand.dts
arch/arm64/boot/dts/amlogic/Makefile
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
arch/arm64/boot/dts/amlogic/meson-gxl-s905d-vero4k-plus.dts [new file with mode: 0644]
arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts [new file with mode: 0644]
arch/arm64/boot/dts/amlogic/meson-s4.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/amlogic/meson-sm1-a95xf3-air-gbit.dts [new file with mode: 0644]
arch/arm64/boot/dts/amlogic/meson-sm1-a95xf3-air.dts [new file with mode: 0644]
arch/arm64/boot/dts/amlogic/meson-sm1-ac2xx.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/amlogic/meson-sm1-h96-max.dts [new file with mode: 0644]
arch/arm64/boot/dts/amlogic/meson-sm1-x96-air-gbit.dts [new file with mode: 0644]
arch/arm64/boot/dts/amlogic/meson-sm1-x96-air.dts [new file with mode: 0644]
arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
arch/arm64/boot/dts/arm/Makefile
arch/arm64/boot/dts/arm/juno-base.dtsi
arch/arm64/boot/dts/arm/juno-r1-scmi.dts [new file with mode: 0644]
arch/arm64/boot/dts/arm/juno-r2-scmi.dts [new file with mode: 0644]
arch/arm64/boot/dts/arm/juno-scmi.dts [new file with mode: 0644]
arch/arm64/boot/dts/arm/juno-scmi.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/exynos/Makefile
arch/arm64/boot/dts/exynos/exynos5433-pinctrl.dtsi
arch/arm64/boot/dts/exynos/exynos5433-tm2-common.dtsi
arch/arm64/boot/dts/exynos/exynos5433.dtsi
arch/arm64/boot/dts/exynos/exynos7-espresso.dts
arch/arm64/boot/dts/exynos/exynos7-pinctrl.dtsi
arch/arm64/boot/dts/exynos/exynos7.dtsi
arch/arm64/boot/dts/exynos/exynos7885-jackpotlte.dts [new file with mode: 0644]
arch/arm64/boot/dts/exynos/exynos7885-pinctrl.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/exynos/exynos7885.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/exynos/exynos850-e850-96.dts [new file with mode: 0644]
arch/arm64/boot/dts/exynos/exynos850-pinctrl.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/exynos/exynos850.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/exynos/exynosautov9-pinctrl.dtsi
arch/arm64/boot/dts/exynos/exynosautov9.dtsi
arch/arm64/boot/dts/freescale/Makefile
arch/arm64/boot/dts/freescale/fsl-ls1028a-qds-13bb.dts
arch/arm64/boot/dts/freescale/fsl-ls1028a-qds-65bb.dts
arch/arm64/boot/dts/freescale/fsl-ls1028a-qds-7777.dts
arch/arm64/boot/dts/freescale/fsl-ls1028a-qds-85bb.dts
arch/arm64/boot/dts/freescale/fsl-ls1028a-qds-899b.dts
arch/arm64/boot/dts/freescale/fsl-ls1028a-qds-9999.dts
arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
arch/arm64/boot/dts/freescale/imx8-ss-lsio.dtsi
arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi
arch/arm64/boot/dts/freescale/imx8mm-emcon-avari.dts [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mm-emcon-avari.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mm-emcon.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
arch/arm64/boot/dts/freescale/imx8mm-pinfunc.h
arch/arm64/boot/dts/freescale/imx8mm-prt8mm.dts [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mm-tqma8mqml-mba8mx.dts
arch/arm64/boot/dts/freescale/imx8mm-tqma8mqml.dtsi
arch/arm64/boot/dts/freescale/imx8mm-venice-gw71xx.dtsi
arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx-0x-imx219.dts [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx-0x-rs232-rts.dts [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx-0x-rs422.dts [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx-0x-rs485.dts [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx.dtsi
arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-imx219.dts [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-rs232-rts.dts [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-rs422.dts [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-rs485.dts [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx.dtsi
arch/arm64/boot/dts/freescale/imx8mm-venice-gw7901.dts
arch/arm64/boot/dts/freescale/imx8mm-venice-gw7902.dts
arch/arm64/boot/dts/freescale/imx8mm-venice-gw7903.dts [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mm-verdin-dev.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mm-verdin-nonwifi-dahlia.dts [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mm-verdin-nonwifi-dev.dts [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mm-verdin-nonwifi.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mm-verdin-wifi-dahlia.dts [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mm-verdin-wifi-dev.dts [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mm-verdin-wifi.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mm.dtsi
arch/arm64/boot/dts/freescale/imx8mn-venice-gw7902.dts
arch/arm64/boot/dts/freescale/imx8mn.dtsi
arch/arm64/boot/dts/freescale/imx8mp-evk.dts
arch/arm64/boot/dts/freescale/imx8mp-phycore-som.dtsi
arch/arm64/boot/dts/freescale/imx8mp.dtsi
arch/arm64/boot/dts/freescale/imx8mq-evk.dts
arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi
arch/arm64/boot/dts/freescale/imx8mq-mnt-reform2.dts
arch/arm64/boot/dts/freescale/imx8mq-tqma8mq.dtsi
arch/arm64/boot/dts/freescale/imx8mq.dtsi
arch/arm64/boot/dts/freescale/imx8qm-ss-conn.dtsi
arch/arm64/boot/dts/freescale/imx8qm-ss-lsio.dtsi
arch/arm64/boot/dts/freescale/imx8qm.dtsi
arch/arm64/boot/dts/freescale/imx8qxp-ss-adma.dtsi
arch/arm64/boot/dts/freescale/imx8qxp-ss-lsio.dtsi
arch/arm64/boot/dts/freescale/mba8mx.dtsi
arch/arm64/boot/dts/intel/socfpga_agilex.dtsi
arch/arm64/boot/dts/intel/socfpga_agilex_socdk.dts
arch/arm64/boot/dts/intel/socfpga_agilex_socdk_nand.dts
arch/arm64/boot/dts/intel/socfpga_n5x_socdk.dts
arch/arm64/boot/dts/marvell/armada-37xx.dtsi
arch/arm64/boot/dts/mediatek/mt6358.dtsi
arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts
arch/arm64/boot/dts/mediatek/mt7986a.dtsi
arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts
arch/arm64/boot/dts/mediatek/mt8183.dtsi
arch/arm64/boot/dts/mediatek/mt8192.dtsi
arch/arm64/boot/dts/nvidia/Makefile
arch/arm64/boot/dts/nvidia/tegra186.dtsi
arch/arm64/boot/dts/nvidia/tegra194-p3509-0000.dtsi
arch/arm64/boot/dts/nvidia/tegra194.dtsi
arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts
arch/arm64/boot/dts/nvidia/tegra234.dtsi
arch/arm64/boot/dts/qcom/Makefile
arch/arm64/boot/dts/qcom/apq8016-sbc.dts
arch/arm64/boot/dts/qcom/ipq6018.dtsi
arch/arm64/boot/dts/qcom/ipq8074.dtsi
arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts
arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts
arch/arm64/boot/dts/qcom/msm8916.dtsi
arch/arm64/boot/dts/qcom/msm8953.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/qcom/msm8992-lg-bullhead-rev-10.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/msm8992-lg-bullhead-rev-101.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/msm8992-lg-bullhead.dtsi [moved from arch/arm64/boot/dts/qcom/msm8992-bullhead-rev-101.dts with 98% similarity]
arch/arm64/boot/dts/qcom/msm8994-huawei-angler-rev-101.dts [moved from arch/arm64/boot/dts/qcom/msm8994-angler-rev-101.dts with 100% similarity]
arch/arm64/boot/dts/qcom/msm8994.dtsi
arch/arm64/boot/dts/qcom/msm8996-mtp.dts
arch/arm64/boot/dts/qcom/msm8996.dtsi
arch/arm64/boot/dts/qcom/msm8998.dtsi
arch/arm64/boot/dts/qcom/pm6150l.dtsi
arch/arm64/boot/dts/qcom/pm8953.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/qcom/pms405.dtsi
arch/arm64/boot/dts/qcom/qcs404.dtsi
arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi
arch/arm64/boot/dts/qcom/sc7180-trogdor-homestar.dtsi
arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
arch/arm64/boot/dts/qcom/sc7180.dtsi
arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7280-crd.dts
arch/arm64/boot/dts/qcom/sc7280-herobrine-herobrine-r0.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7280-herobrine-herobrine-r1.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7280-herobrine.dts [deleted file]
arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi
arch/arm64/boot/dts/qcom/sc7280-idp-ec-h1.dtsi
arch/arm64/boot/dts/qcom/sc7280-idp.dts
arch/arm64/boot/dts/qcom/sc7280-idp.dtsi
arch/arm64/boot/dts/qcom/sc7280-idp2.dts
arch/arm64/boot/dts/qcom/sc7280-qcard.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7280.dtsi
arch/arm64/boot/dts/qcom/sdm630.dtsi
arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sdm632.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
arch/arm64/boot/dts/qcom/sdm845-db845c.dts
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts
arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sdm845.dtsi
arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sm6125.dtsi
arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts
arch/arm64/boot/dts/qcom/sm8150.dtsi
arch/arm64/boot/dts/qcom/sm8250.dtsi
arch/arm64/boot/dts/qcom/sm8350.dtsi
arch/arm64/boot/dts/qcom/sm8450-hdk.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sm8450-qrd.dts
arch/arm64/boot/dts/qcom/sm8450.dtsi
arch/arm64/boot/dts/renesas/Makefile
arch/arm64/boot/dts/renesas/beacon-renesom-baseboard.dtsi
arch/arm64/boot/dts/renesas/beacon-renesom-som.dtsi
arch/arm64/boot/dts/renesas/gmsl-cameras.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/renesas/hihope-common.dtsi
arch/arm64/boot/dts/renesas/hihope-rzg2-ex-lvds.dtsi
arch/arm64/boot/dts/renesas/r8a774a1.dtsi
arch/arm64/boot/dts/renesas/r8a774b1-beacon-rzg2n-kit.dts
arch/arm64/boot/dts/renesas/r8a774b1.dtsi
arch/arm64/boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts
arch/arm64/boot/dts/renesas/r8a774c0.dtsi
arch/arm64/boot/dts/renesas/r8a774e1-beacon-rzg2h-kit.dts
arch/arm64/boot/dts/renesas/r8a774e1.dtsi
arch/arm64/boot/dts/renesas/r8a77951.dtsi
arch/arm64/boot/dts/renesas/r8a77960.dtsi
arch/arm64/boot/dts/renesas/r8a77961.dtsi
arch/arm64/boot/dts/renesas/r8a77965.dtsi
arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
arch/arm64/boot/dts/renesas/r8a77980-condor.dts
arch/arm64/boot/dts/renesas/r8a77990.dtsi
arch/arm64/boot/dts/renesas/r8a77995.dtsi
arch/arm64/boot/dts/renesas/r8a779a0-falcon-csi-dsi.dtsi
arch/arm64/boot/dts/renesas/r8a779a0.dtsi
arch/arm64/boot/dts/renesas/r8a779f0-spider-cpu.dtsi
arch/arm64/boot/dts/renesas/r8a779f0.dtsi
arch/arm64/boot/dts/renesas/r9a07g044c1.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/renesas/r9a07g044c2-smarc.dts [new file with mode: 0644]
arch/arm64/boot/dts/renesas/r9a07g044c2.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/renesas/r9a07g044l2-smarc.dts
arch/arm64/boot/dts/renesas/r9a07g054.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/renesas/r9a07g054l1.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/renesas/r9a07g054l2-smarc.dts [new file with mode: 0644]
arch/arm64/boot/dts/renesas/r9a07g054l2.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/renesas/rz-smarc-common.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/renesas/rzg2l-smarc-pinfunction.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/renesas/rzg2l-smarc-som.dtsi
arch/arm64/boot/dts/renesas/rzg2l-smarc.dtsi
arch/arm64/boot/dts/renesas/rzg2lc-smarc-pinfunction.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/renesas/rzg2lc-smarc-som.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/renesas/rzg2lc-smarc.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
arch/arm64/boot/dts/renesas/ulcb.dtsi
arch/arm64/boot/dts/rockchip/Makefile
arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
arch/arm64/boot/dts/rockchip/rk3399-gru-chromebook.dtsi
arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts
arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts
arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts
arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi
arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
arch/arm64/boot/dts/rockchip/rk3566-pinenote-v1.1.dts [new file with mode: 0644]
arch/arm64/boot/dts/rockchip/rk3566-pinenote-v1.2.dts [new file with mode: 0644]
arch/arm64/boot/dts/rockchip/rk3566-pinenote.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts
arch/arm64/boot/dts/rockchip/rk3568-bpi-r2-pro.dts [new file with mode: 0644]
arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dts
arch/arm64/boot/dts/rockchip/rk356x.dtsi
arch/arm64/boot/dts/tesla/Makefile [new file with mode: 0644]
arch/arm64/boot/dts/tesla/fsd-evb.dts [new file with mode: 0644]
arch/arm64/boot/dts/tesla/fsd-pinctrl.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/tesla/fsd.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/ti/Makefile
arch/arm64/boot/dts/ti/k3-am62-main.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/ti/k3-am62.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/ti/k3-am625-sk.dts [new file with mode: 0644]
arch/arm64/boot/dts/ti/k3-am625.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/ti/k3-am64-main.dtsi
arch/arm64/boot/dts/ti/k3-am64.dtsi
arch/arm64/boot/dts/ti/k3-am642-evm.dts
arch/arm64/boot/dts/ti/k3-am642-sk.dts
arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi
arch/arm64/boot/dts/ti/k3-am65-main.dtsi
arch/arm64/boot/dts/ti/k3-am65.dtsi
arch/arm64/boot/dts/ti/k3-am654-base-board.dts
arch/arm64/boot/dts/ti/k3-j7200-main.dtsi
arch/arm64/boot/dts/ti/k3-j7200-som-p0.dtsi
arch/arm64/boot/dts/ti/k3-j7200.dtsi
arch/arm64/boot/dts/ti/k3-j721e-common-proc-board.dts
arch/arm64/boot/dts/ti/k3-j721e-main.dtsi
arch/arm64/boot/dts/ti/k3-j721e-sk.dts
arch/arm64/boot/dts/ti/k3-j721e-som-p0.dtsi
arch/arm64/boot/dts/ti/k3-j721e.dtsi
arch/arm64/boot/dts/ti/k3-j721s2-common-proc-board.dts
arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi
arch/arm64/boot/dts/ti/k3-j721s2-mcu-wakeup.dtsi
arch/arm64/boot/dts/ti/k3-j721s2.dtsi
arch/arm64/configs/defconfig
arch/arm64/include/asm/cputype.h
arch/arm64/kernel/cpu_errata.c
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/stacktrace.c
arch/arm64/kernel/vdso/Makefile
arch/arm64/kvm/arm.c
arch/arm64/kvm/handle_exit.c
arch/arm64/kvm/hyp/exception.c
arch/arm64/kvm/hyp/include/hyp/switch.h
arch/arm64/kvm/hyp/pgtable.c
arch/arm64/kvm/hyp/vgic-v3-sr.c
arch/arm64/kvm/vgic/vgic-v3.c
arch/arm64/mm/extable.c
arch/arm64/tools/cpucaps
arch/ia64/Kconfig
arch/ia64/pci/fixup.c
arch/mips/cavium-octeon/octeon-memcpy.S
arch/mips/include/asm/asm.h
arch/mips/include/asm/ftrace.h
arch/mips/include/asm/r4kcache.h
arch/mips/include/asm/unaligned-emul.h
arch/mips/kernel/mips-r2-to-r6-emul.c
arch/mips/kernel/r2300_fpu.S
arch/mips/kernel/r4k_fpu.S
arch/mips/kernel/relocate_kernel.S
arch/mips/kernel/scall32-o32.S
arch/mips/kernel/scall64-n32.S
arch/mips/kernel/scall64-n64.S
arch/mips/kernel/scall64-o32.S
arch/mips/kernel/syscall.c
arch/mips/kvm/mips.c
arch/mips/kvm/vz.c
arch/mips/lib/csum_partial.S
arch/mips/lib/memcpy.S
arch/mips/lib/memset.S
arch/mips/lib/strncpy_user.S
arch/mips/lib/strnlen_user.S
arch/mips/loongson64/vbios_quirk.c
arch/powerpc/include/asm/book3s/32/mmu-hash.h
arch/powerpc/include/asm/book3s/32/pgtable.h
arch/powerpc/include/asm/book3s/64/pgtable.h
arch/powerpc/include/asm/fixmap.h
arch/powerpc/include/asm/hw_irq.h
arch/powerpc/include/asm/kvm_book3s_64.h
arch/powerpc/include/asm/kvm_host.h
arch/powerpc/include/asm/nohash/32/pgtable.h
arch/powerpc/include/asm/nohash/64/pgtable.h
arch/powerpc/include/asm/ppc-opcode.h
arch/powerpc/include/asm/syscall.h
arch/powerpc/include/asm/thread_info.h
arch/powerpc/kernel/interrupt_64.S
arch/powerpc/kernel/time.c
arch/powerpc/kvm/book3s_hv.c
arch/powerpc/kvm/book3s_hv_nested.c
arch/powerpc/mm/book3s32/mmu.c
arch/powerpc/mm/kasan/book3s_32.c
arch/powerpc/mm/pgtable.c
arch/powerpc/net/bpf_jit_comp.c
arch/powerpc/net/bpf_jit_comp32.c
arch/powerpc/net/bpf_jit_comp64.c
arch/powerpc/perf/core-book3s.c
arch/riscv/kvm/vcpu.c
arch/riscv/kvm/vcpu_sbi_base.c
arch/s390/Kconfig
arch/s390/configs/debug_defconfig
arch/s390/configs/defconfig
arch/s390/configs/zfcpdump_defconfig
arch/s390/hypfs/hypfs_vm.c
arch/s390/include/asm/uaccess.h
arch/s390/kernel/module.c
arch/s390/kernel/nmi.c
arch/s390/lib/Makefile
arch/s390/lib/test_modules.c [new file with mode: 0644]
arch/s390/lib/test_modules.h [new file with mode: 0644]
arch/s390/lib/test_modules_helpers.c [new file with mode: 0644]
arch/x86/Kconfig
arch/x86/crypto/blake2s-shash.c
arch/x86/events/intel/core.c
arch/x86/events/intel/lbr.c
arch/x86/events/intel/pt.c
arch/x86/events/intel/uncore.c
arch/x86/events/intel/uncore.h
arch/x86/events/intel/uncore_discovery.c
arch/x86/events/intel/uncore_discovery.h
arch/x86/events/intel/uncore_snb.c
arch/x86/events/intel/uncore_snbep.c
arch/x86/events/perf_event.h
arch/x86/events/rapl.c
arch/x86/include/asm/kvm-x86-ops.h
arch/x86/include/asm/kvm_host.h
arch/x86/include/asm/xen/hypervisor.h
arch/x86/include/uapi/asm/kvm.h
arch/x86/kernel/cpu/mce/amd.c
arch/x86/kernel/cpu/mce/intel.c
arch/x86/kvm/cpuid.c
arch/x86/kvm/lapic.c
arch/x86/kvm/svm/nested.c
arch/x86/kvm/svm/sev.c
arch/x86/kvm/svm/svm.c
arch/x86/kvm/svm/svm.h
arch/x86/kvm/svm/svm_onhyperv.h
arch/x86/kvm/vmx/capabilities.h
arch/x86/kvm/vmx/evmcs.c
arch/x86/kvm/vmx/evmcs.h
arch/x86/kvm/vmx/nested.c
arch/x86/kvm/vmx/vmcs12.c
arch/x86/kvm/vmx/vmcs12.h
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/x86.c
arch/x86/kvm/x86.h
arch/x86/kvm/xen.c
arch/x86/pci/fixup.c
arch/x86/xen/enlighten_hvm.c
arch/x86/xen/enlighten_pv.c
arch/x86/xen/smp_pv.c
block/bio-integrity.c
block/blk-core.c
block/blk-ia-ranges.c
block/blk-mq.c
block/fops.c
crypto/blake2s_generic.c
drivers/acpi/Kconfig
drivers/ata/libata-core.c
drivers/ata/pata_platform.c
drivers/char/random.c
drivers/connector/cn_proc.c
drivers/counter/counter-core.c
drivers/dma-buf/dma-heap.c
drivers/edac/altera_edac.c
drivers/edac/xgene_edac.c
drivers/firmware/efi/efi.c
drivers/firmware/efi/libstub/arm64-stub.c
drivers/gpio/gpio-sim.c
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn301/vg_clk_mgr.c
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c
drivers/gpu/drm/amd/display/dc/core/dc.c
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
drivers/gpu/drm/amd/display/dc/core/dc_resource.c
drivers/gpu/drm/amd/display/dc/dc.h
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.h
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_stream_encoder.c
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_stream_encoder.c
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c
drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c
drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20.c
drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20v2.c
drivers/gpu/drm/amd/display/dc/dml/dcn21/display_rq_dlg_calc_21.c
drivers/gpu/drm/amd/display/dc/dml/dcn30/display_rq_dlg_calc_30.c
drivers/gpu/drm/amd/display/dc/dml/dcn301/dcn301_fpu.c
drivers/gpu/drm/amd/display/dc/dml/dcn301/dcn301_fpu.h
drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h
drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_helpers.c
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c
drivers/gpu/drm/amd/display/dc/inc/core_types.h
drivers/gpu/drm/amd/display/dc/inc/hw/stream_encoder.h
drivers/gpu/drm/amd/display/dc/inc/resource.h
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
drivers/gpu/drm/ast/ast_tables.h
drivers/gpu/drm/drm_atomic.c
drivers/gpu/drm/drm_panel_orientation_quirks.c
drivers/gpu/drm/drm_privacy_screen_x86.c
drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
drivers/gpu/drm/i915/display/intel_overlay.c
drivers/gpu/drm/i915/display/intel_tc.c
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
drivers/gpu/drm/i915/gem/i915_gem_object_types.h
drivers/gpu/drm/i915/gem/i915_gem_pages.c
drivers/gpu/drm/i915/gt/intel_gt.c
drivers/gpu/drm/i915/gt/intel_gt.h
drivers/gpu/drm/i915/gt/intel_gt_types.h
drivers/gpu/drm/i915/gt/uc/intel_guc.h
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
drivers/gpu/drm/i915/i915_gpu_error.c
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/i915_vma.c
drivers/gpu/drm/i915/intel_uncore.c
drivers/gpu/drm/i915/intel_uncore.h
drivers/gpu/drm/kmb/kmb_plane.c
drivers/gpu/drm/msm/adreno/a6xx_gpu.c
drivers/gpu/drm/msm/adreno/adreno_device.c
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c
drivers/gpu/drm/msm/dsi/dsi.c
drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
drivers/gpu/drm/msm/hdmi/hdmi.c
drivers/gpu/drm/msm/msm_drv.c
drivers/gpu/drm/msm/msm_gpu.c
drivers/gpu/drm/msm/msm_gpu.h
drivers/gpu/drm/msm/msm_gpu_devfreq.c
drivers/gpu/drm/mxsfb/mxsfb_kms.c
drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c
drivers/gpu/drm/vc4/vc4_dsi.c
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
drivers/hv/hv_balloon.c
drivers/hwmon/adt7470.c
drivers/hwmon/lm90.c
drivers/hwmon/nct6775.c
drivers/hwmon/pmbus/ir38064.c
drivers/infiniband/core/cm.c
drivers/infiniband/core/cma.c
drivers/infiniband/core/ucma.c
drivers/infiniband/hw/hfi1/ipoib.h
drivers/infiniband/hw/hfi1/ipoib_main.c
drivers/infiniband/hw/hfi1/ipoib_tx.c
drivers/infiniband/hw/mlx4/main.c
drivers/infiniband/sw/rdmavt/qp.c
drivers/infiniband/sw/siw/siw.h
drivers/infiniband/sw/siw/siw_qp_rx.c
drivers/infiniband/sw/siw/siw_verbs.c
drivers/input/touchscreen/wm97xx-core.c
drivers/iommu/amd/init.c
drivers/iommu/intel/irq_remapping.c
drivers/iommu/ioasid.c
drivers/iommu/iommu.c
drivers/iommu/omap-iommu.c
drivers/irqchip/irq-apple-aic.c
drivers/irqchip/irq-gic-v3-its.c
drivers/irqchip/irq-loongson-pch-msi.c
drivers/irqchip/irq-realtek-rtl.c
drivers/md/dm.c
drivers/md/md.c
drivers/misc/eeprom/at25.c
drivers/net/bonding/bond_main.c
drivers/net/can/flexcan/flexcan-core.c
drivers/net/can/flexcan/flexcan.h
drivers/net/can/m_can/m_can.c
drivers/net/can/m_can/tcan4x5x-regmap.c
drivers/net/dsa/Kconfig
drivers/net/ethernet/3com/typhoon.c
drivers/net/ethernet/8390/etherh.c
drivers/net/ethernet/amd/declance.c
drivers/net/ethernet/amd/xgbe/xgbe-drv.c
drivers/net/ethernet/aquantia/atlantic/aq_filters.c
drivers/net/ethernet/broadcom/sb1250-mac.c
drivers/net/ethernet/freescale/fec_mpc52xx.c
drivers/net/ethernet/google/gve/gve.h
drivers/net/ethernet/google/gve/gve_adminq.c
drivers/net/ethernet/google/gve/gve_main.c
drivers/net/ethernet/google/gve/gve_rx.c
drivers/net/ethernet/google/gve/gve_rx_dqo.c
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
drivers/net/ethernet/i825xx/ether1.c
drivers/net/ethernet/ibm/ibmvnic.c
drivers/net/ethernet/ibm/ibmvnic.h
drivers/net/ethernet/intel/e1000e/e1000.h
drivers/net/ethernet/intel/e1000e/ich8lan.c
drivers/net/ethernet/intel/e1000e/netdev.c
drivers/net/ethernet/intel/i40e/i40e.h
drivers/net/ethernet/intel/i40e/i40e_debugfs.c
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/ethernet/intel/i40e/i40e_register.h
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
drivers/net/ethernet/marvell/octeontx2/af/cgx.c
drivers/net/ethernet/marvell/octeontx2/af/lmac_common.h
drivers/net/ethernet/marvell/octeontx2/af/mbox.h
drivers/net/ethernet/marvell/octeontx2/af/npc_profile.h
drivers/net/ethernet/marvell/octeontx2/af/rpm.c
drivers/net/ethernet/marvell/octeontx2/af/rpm.h
drivers/net/ethernet/marvell/octeontx2/af/rvu.c
drivers/net/ethernet/marvell/octeontx2/af/rvu.h
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en/qos.c
drivers/net/ethernet/mellanox/mlx5/core/en/rep/bond.c
drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c
drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.h
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c
drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h
drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c
drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c
drivers/net/ethernet/mellanox/mlx5/core/port.c
drivers/net/ethernet/microchip/lan966x/lan966x_mac.c
drivers/net/ethernet/microchip/lan966x/lan966x_main.c
drivers/net/ethernet/microchip/sparx5/sparx5_packet.c
drivers/net/ethernet/seeq/ether3.c
drivers/net/ethernet/smsc/smc911x.c
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c
drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h
drivers/net/ethernet/stmicro/stmmac/stmmac.h
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
drivers/net/ethernet/ti/cpsw_priv.c
drivers/net/ethernet/tundra/tsi108_eth.c
drivers/net/hamradio/yam.c
drivers/net/ieee802154/at86rf230.c
drivers/net/ieee802154/ca8210.c
drivers/net/ieee802154/mac802154_hwsim.c
drivers/net/ieee802154/mcr20a.c
drivers/net/ipa/ipa_power.c
drivers/net/ipa/ipa_power.h
drivers/net/ipa/ipa_uc.c
drivers/net/macsec.c
drivers/net/phy/at803x.c
drivers/net/phy/broadcom.c
drivers/net/phy/phy_device.c
drivers/net/phy/sfp-bus.c
drivers/net/usb/ipheth.c
drivers/nvme/host/core.c
drivers/nvme/host/fabrics.c
drivers/nvme/host/fabrics.h
drivers/nvme/host/pci.c
drivers/nvme/host/rdma.c
drivers/nvme/host/tcp.c
drivers/pci/controller/cadence/pci-j721e.c
drivers/pci/controller/dwc/pcie-kirin.c
drivers/pci/controller/pcie-mt7621.c
drivers/pci/msi/irqdomain.c
drivers/pci/msi/legacy.c
drivers/pci/msi/msi.c
drivers/pinctrl/Makefile
drivers/pinctrl/bcm/Kconfig
drivers/pinctrl/bcm/pinctrl-bcm2835.c
drivers/pinctrl/intel/pinctrl-cherryview.c
drivers/pinctrl/intel/pinctrl-intel.c
drivers/pinctrl/pinctrl-microchip-sgpio.c
drivers/pinctrl/pinctrl-thunderbay.c
drivers/pinctrl/pinctrl-zynqmp.c
drivers/pinctrl/samsung/pinctrl-exynos-arm64.c
drivers/pinctrl/samsung/pinctrl-exynos.c
drivers/pinctrl/samsung/pinctrl-samsung.c
drivers/pinctrl/sunxi/pinctrl-sun50i-h616.c
drivers/platform/surface/Kconfig
drivers/platform/x86/amd-pmc.c
drivers/platform/x86/asus-tf103c-dock.c
drivers/platform/x86/intel/crystal_cove_charger.c
drivers/platform/x86/intel/speed_select_if/isst_if_common.c
drivers/platform/x86/thinkpad_acpi.c
drivers/platform/x86/touchscreen_dmi.c
drivers/platform/x86/x86-android-tablets.c
drivers/regulator/max20086-regulator.c
drivers/remoteproc/Kconfig
drivers/remoteproc/qcom_q6v5.c
drivers/rpmsg/rpmsg_char.c
drivers/s390/scsi/zfcp_fc.c
drivers/scsi/3w-sas.c
drivers/scsi/53c700.c
drivers/scsi/bfa/bfad.c
drivers/scsi/bnx2fc/bnx2fc_fcoe.c
drivers/scsi/elx/libefc/efc_els.c
drivers/scsi/hisi_sas/hisi_sas_main.c
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
drivers/scsi/myrs.c
drivers/scsi/pm8001/pm8001_hwi.c
drivers/scsi/pm8001/pm8001_sas.c
drivers/scsi/pm8001/pm80xx_hwi.c
drivers/scsi/pm8001/pm80xx_hwi.h
drivers/scsi/qedf/qedf_io.c
drivers/scsi/qedf/qedf_main.c
drivers/scsi/scsi_scan.c
drivers/scsi/ufs/ufshcd-pltfrm.c
drivers/scsi/ufs/ufshcd.c
drivers/scsi/ufs/ufshci.h
drivers/spi/spi-bcm-qspi.c
drivers/spi/spi-meson-spicc.c
drivers/spi/spi-mt65xx.c
drivers/spi/spi-stm32-qspi.c
drivers/spi/spi-stm32.c
drivers/spi/spi-uniphier.c
drivers/target/iscsi/iscsi_target_tpg.c
drivers/tty/n_gsm.c
drivers/tty/rpmsg_tty.c
drivers/tty/serial/8250/8250_of.c
drivers/tty/serial/8250/8250_pci.c
drivers/tty/serial/8250/8250_port.c
drivers/tty/serial/amba-pl011.c
drivers/tty/serial/serial_core.c
drivers/tty/serial/stm32-usart.c
drivers/usb/cdns3/drd.c
drivers/usb/common/ulpi.c
drivers/usb/core/hcd.c
drivers/usb/core/urb.c
drivers/usb/dwc2/gadget.c
drivers/usb/dwc3/dwc3-xilinx.c
drivers/usb/gadget/function/f_sourcesink.c
drivers/usb/gadget/udc/at91_udc.c
drivers/usb/host/xhci-plat.c
drivers/usb/storage/unusual_devs.h
drivers/usb/typec/port-mapper.c
drivers/usb/typec/tcpm/tcpci.c
drivers/usb/typec/tcpm/tcpci.h
drivers/usb/typec/tcpm/tcpm.c
drivers/usb/typec/ucsi/ucsi_ccg.c
drivers/video/console/Kconfig
drivers/video/fbdev/core/bitblit.c
drivers/video/fbdev/core/fbcon.c
drivers/video/fbdev/core/fbcon.h
drivers/video/fbdev/core/fbcon_ccw.c
drivers/video/fbdev/core/fbcon_cw.c
drivers/video/fbdev/core/fbcon_rotate.h
drivers/video/fbdev/core/fbcon_ud.c
drivers/video/fbdev/core/tileblit.c
drivers/video/fbdev/hyperv_fb.c
drivers/video/fbdev/skeletonfb.c
fs/9p/fid.c
fs/Makefile
fs/binfmt_misc.c
fs/btrfs/block-group.c
fs/btrfs/ctree.h
fs/btrfs/ioctl.c
fs/btrfs/qgroup.c
fs/btrfs/transaction.c
fs/btrfs/transaction.h
fs/btrfs/tree-checker.c
fs/btrfs/tree-log.c
fs/cachefiles/io.c
fs/ceph/caps.c
fs/ceph/file.c
fs/cifs/connect.c
fs/cifs/file.c
fs/cifs/fscache.c
fs/cifs/fscache.h
fs/cifs/inode.c
fs/cifs/sess.c
fs/configfs/dir.c
fs/devpts/inode.c
fs/erofs/data.c
fs/erofs/zdata.c
fs/erofs/zmap.c
fs/ext4/acl.c
fs/ext4/ext4.h
fs/ext4/ext4_jbd2.h
fs/ext4/extents.c
fs/ext4/fast_commit.c
fs/ext4/hash.c
fs/ext4/indirect.c
fs/ext4/inline.c
fs/ext4/inode.c
fs/ext4/ioctl.c
fs/ext4/mballoc.c
fs/ext4/migrate.c
fs/ext4/namei.c
fs/ext4/orphan.c
fs/ext4/super.c
fs/ext4/sysfs.c
fs/ext4/xattr.c
fs/f2fs/dir.c
fs/f2fs/f2fs.h
fs/f2fs/hash.c
fs/f2fs/namei.c
fs/f2fs/recovery.c
fs/f2fs/super.c
fs/f2fs/sysfs.c
fs/io_uring.c
fs/iomap/buffered-io.c
fs/jbd2/commit.c
fs/jbd2/journal.c
fs/jbd2/transaction.c
fs/libfs.c
fs/lockd/svcsubs.c
fs/namei.c
fs/nfs/callback.h
fs/nfs/callback_proc.c
fs/nfs/callback_xdr.c
fs/nfs/client.c
fs/nfs/dir.c
fs/nfs/filelayout/filelayout.h
fs/nfs/filelayout/filelayoutdev.c
fs/nfs/internal.h
fs/nfs/nfs3proc.c
fs/nfs/nfs42proc.c
fs/nfs/nfs4_fs.h
fs/nfs/nfs4client.c
fs/nfs/nfs4namespace.c
fs/nfs/nfs4proc.c
fs/nfs/nfs4state.c
fs/nfs/nfs4xdr.c
fs/nfs/sysfs.c
fs/nfsd/nfs4state.c
fs/nfsd/nfsctl.c
fs/notify/fanotify/fanotify_user.c
fs/ocfs2/stackglue.c
fs/ocfs2/suballoc.c
fs/overlayfs/copy_up.c
fs/quota/dquot.c
fs/super.c
fs/sync.c
fs/udf/inode.c
fs/unicode/Kconfig
fs/unicode/Makefile
fs/xfs/xfs_aops.c
fs/xfs/xfs_bmap_util.c
fs/xfs/xfs_file.c
fs/xfs/xfs_inode.h
fs/xfs/xfs_ioctl.c
fs/xfs/xfs_pnfs.c
fs/xfs/xfs_super.c
include/crypto/internal/blake2s.h
include/dt-bindings/clock/fsd-clk.h [new file with mode: 0644]
include/dt-bindings/clock/r9a06g032-sysctrl.h
include/dt-bindings/clock/r9a07g054-cpg.h [new file with mode: 0644]
include/dt-bindings/clock/tegra234-clock.h
include/dt-bindings/memory/tegra234-mc.h
include/dt-bindings/pinctrl/k3.h
include/dt-bindings/power/imx8mp-power.h [new file with mode: 0644]
include/dt-bindings/power/imx8mq-power.h
include/dt-bindings/power/tegra234-powergate.h [new file with mode: 0644]
include/dt-bindings/reset/tegra234-reset.h
include/linux/blkdev.h
include/linux/ceph/libceph.h
include/linux/ceph/messenger.h
include/linux/ethtool.h
include/linux/fb.h
include/linux/fs.h
include/linux/fsnotify.h
include/linux/if_vlan.h
include/linux/iomap.h
include/linux/jbd2.h
include/linux/kvm_host.h
include/linux/libata.h
include/linux/lsm_hook_defs.h
include/linux/mm.h
include/linux/mm_types.h
include/linux/netdevice.h
include/linux/netfs.h
include/linux/nfs_fs.h
include/linux/nfs_fs_sb.h
include/linux/nfs_xdr.h
include/linux/page_table_check.h
include/linux/perf_event.h
include/linux/pgtable.h
include/linux/pid_namespace.h
include/linux/psi.h
include/linux/psi_types.h
include/linux/quota.h
include/linux/sched.h
include/linux/skbuff.h
include/linux/suspend.h
include/linux/sysctl.h
include/linux/usb/role.h
include/net/addrconf.h
include/net/ax25.h
include/net/bonding.h
include/net/ip.h
include/net/ip6_fib.h
include/net/neighbour.h
include/net/route.h
include/net/tcp.h
include/sound/pcm.h
include/trace/events/skb.h
include/trace/events/sunrpc.h
include/trace/perf.h
include/trace/trace_events.h
include/uapi/linux/cyclades.h [new file with mode: 0644]
include/uapi/linux/kvm.h
include/uapi/linux/perf_event.h
include/uapi/linux/smc_diag.h
include/uapi/sound/asound.h
include/uapi/xen/gntdev.h
include/xen/xenbus_dev.h
ipc/sem.c
kernel/async.c
kernel/audit.c
kernel/bpf/bpf_lsm.c
kernel/bpf/ringbuf.c
kernel/bpf/stackmap.c
kernel/bpf/trampoline.c
kernel/cgroup/cgroup-v1.c
kernel/cgroup/cgroup.c
kernel/cgroup/cpuset.c
kernel/events/core.c
kernel/module.c
kernel/power/snapshot.c
kernel/power/wakelock.c
kernel/printk/sysctl.c
kernel/rcu/tasks.h
kernel/sched/core.c
kernel/sched/core_sched.c
kernel/sched/fair.c
kernel/sched/membarrier.c
kernel/sched/pelt.h
kernel/sched/psi.c
kernel/stackleak.c
kernel/trace/Kconfig
kernel/trace/trace.c
kernel/trace/trace_events_hist.c
kernel/ucount.c
lib/crypto/blake2s.c
lib/sbitmap.c
lib/test_kasan.c
mm/debug_vm_pgtable.c
mm/gup.c
mm/khugepaged.c
mm/kmemleak.c
mm/memory-failure.c
mm/page_isolation.c
mm/page_table_check.c
net/ax25/af_ax25.c
net/ax25/ax25_dev.c
net/ax25/ax25_route.c
net/bridge/br_vlan.c
net/bridge/netfilter/nft_reject_bridge.c
net/ceph/ceph_common.c
net/ceph/messenger.c
net/ceph/messenger_v1.c
net/ceph/messenger_v2.c
net/core/neighbour.c
net/core/net-procfs.c
net/core/rtnetlink.c
net/ieee802154/nl802154.c
net/ipv4/ip_output.c
net/ipv4/netfilter/Kconfig
net/ipv4/ping.c
net/ipv4/raw.c
net/ipv4/tcp.c
net/ipv4/tcp_input.c
net/ipv4/tcp_ipv4.c
net/ipv6/addrconf.c
net/ipv6/ip6_fib.c
net/ipv6/ip6_tunnel.c
net/ipv6/netfilter/Kconfig
net/ipv6/netfilter/Makefile
net/ipv6/netfilter/nf_flow_table_ipv6.c [deleted file]
net/ipv6/route.c
net/mptcp/pm_netlink.c
net/mptcp/protocol.h
net/netfilter/nf_conntrack_core.c
net/netfilter/nf_conntrack_netbios_ns.c
net/netfilter/nf_tables_api.c
net/netfilter/nft_byteorder.c
net/netfilter/nft_connlimit.c
net/netfilter/nft_ct.c
net/packet/af_packet.c
net/rxrpc/call_event.c
net/rxrpc/output.c
net/sched/cls_api.c
net/sched/sch_api.c
net/sched/sch_htb.c
net/smc/af_smc.c
net/smc/smc.h
net/smc/smc_diag.c
net/sunrpc/auth_gss/gss_generic_token.c
net/sunrpc/clnt.c
net/sunrpc/rpc_pipe.c
net/sunrpc/sysfs.c
net/sunrpc/xprtrdma/backchannel.c
net/sunrpc/xprtrdma/frwr_ops.c
net/sunrpc/xprtrdma/rpc_rdma.c
net/sunrpc/xprtrdma/transport.c
net/sunrpc/xprtrdma/verbs.c
net/sunrpc/xprtsock.c
scripts/Makefile
security/security.c
security/selinux/ss/conditional.c
sound/core/pcm_native.c
sound/hda/intel-sdw-acpi.c
sound/pci/hda/hda_auto_parser.c
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_generic.c
sound/pci/hda/hda_generic.h
sound/pci/hda/patch_realtek.c
sound/soc/amd/acp/acp-mach-common.c
sound/soc/codecs/cpcap.c
sound/soc/codecs/hdmi-codec.c
sound/soc/codecs/lpass-rx-macro.c
sound/soc/codecs/max9759.c
sound/soc/codecs/rt5682-i2c.c
sound/soc/codecs/rt5682.c
sound/soc/codecs/rt5682.h
sound/soc/codecs/wcd938x.c
sound/soc/fsl/pcm030-audio-fabric.c
sound/soc/generic/simple-card.c
sound/soc/mediatek/Kconfig
sound/soc/qcom/qdsp6/q6apm-dai.c
sound/soc/soc-acpi.c
sound/soc/soc-ops.c
sound/soc/soc-pcm.c
sound/soc/xilinx/xlnx_formatter_pcm.c
sound/usb/mixer.c
sound/usb/quirks-table.h
tools/arch/x86/include/asm/cpufeatures.h
tools/arch/x86/include/uapi/asm/kvm.h
tools/bpf/resolve_btfids/Makefile
tools/bpf/runqslower/runqslower.bpf.c
tools/bpf/runqslower/runqslower.c
tools/bpf/runqslower/runqslower.h
tools/include/uapi/linux/kvm.h
tools/include/uapi/linux/lirc.h [deleted file]
tools/include/uapi/linux/perf_event.h
tools/include/uapi/linux/prctl.h
tools/include/uapi/sound/asound.h
tools/lib/perf/mmap.c
tools/lib/perf/tests/test-evsel.c
tools/objtool/check.c
tools/perf/builtin-ftrace.c
tools/perf/trace/beauty/prctl_option.sh
tools/perf/util/annotate.c
tools/perf/util/bpf_counter_cgroup.c
tools/perf/util/machine.c
tools/perf/util/map_symbol.h
tools/perf/util/perf_event_attr_fprintf.c
tools/perf/util/session.c
tools/perf/util/sort.c
tools/perf/util/stat-display.c
tools/perf/util/synthetic-events.c
tools/scripts/Makefile.include
tools/testing/kunit/kunit_kernel.py
tools/testing/scatterlist/linux/mm.h
tools/testing/selftests/arm64/fp/sve-ptrace.c
tools/testing/selftests/bpf/test_lirc_mode2_user.c
tools/testing/selftests/cpufreq/main.sh
tools/testing/selftests/exec/Makefile
tools/testing/selftests/futex/Makefile
tools/testing/selftests/kselftest_harness.h
tools/testing/selftests/kvm/Makefile
tools/testing/selftests/kvm/include/kvm_util_base.h
tools/testing/selftests/kvm/include/x86_64/processor.h
tools/testing/selftests/kvm/lib/kvm_util.c
tools/testing/selftests/kvm/lib/x86_64/processor.c
tools/testing/selftests/kvm/x86_64/amx_test.c
tools/testing/selftests/kvm/x86_64/smm_test.c
tools/testing/selftests/mincore/mincore_selftest.c
tools/testing/selftests/net/ioam6_parser.c
tools/testing/selftests/net/mptcp/mptcp_join.sh
tools/testing/selftests/netfilter/nft_concat_range.sh
tools/testing/selftests/netfilter/nft_nat.sh
tools/testing/selftests/netfilter/nft_zones_many.sh
tools/testing/selftests/openat2/Makefile
tools/testing/selftests/openat2/helpers.h
tools/testing/selftests/openat2/openat2_test.c
tools/testing/selftests/perf_events/sigtrap_threads.c
tools/testing/selftests/rtc/settings
tools/testing/selftests/vDSO/vdso_test_abi.c
tools/testing/selftests/vm/userfaultfd.c
tools/testing/selftests/zram/zram.sh
tools/testing/selftests/zram/zram01.sh
tools/testing/selftests/zram/zram02.sh
tools/testing/selftests/zram/zram_lib.sh
tools/tracing/Makefile
tools/tracing/rtla/Makefile
usr/include/Makefile
virt/kvm/eventfd.c
virt/kvm/kvm_main.c

index b157f88..8cd44b0 100644 (file)
--- a/.mailmap
+++ b/.mailmap
@@ -70,6 +70,7 @@ Boris Brezillon <bbrezillon@kernel.org> <boris.brezillon@bootlin.com>
 Boris Brezillon <bbrezillon@kernel.org> <boris.brezillon@free-electrons.com>
 Brian Avery <b.avery@hp.com>
 Brian King <brking@us.ibm.com>
+Brian Silverman <bsilver16384@gmail.com> <brian.silverman@bluerivertech.com>
 Changbin Du <changbin.du@intel.com> <changbin.du@gmail.com>
 Changbin Du <changbin.du@intel.com> <changbin.du@intel.com>
 Chao Yu <chao@kernel.org> <chao2.yu@samsung.com>
@@ -79,6 +80,9 @@ Chris Chiu <chris.chiu@canonical.com> <chiu@endlessos.org>
 Christian Borntraeger <borntraeger@linux.ibm.com> <borntraeger@de.ibm.com>
 Christian Borntraeger <borntraeger@linux.ibm.com> <cborntra@de.ibm.com>
 Christian Borntraeger <borntraeger@linux.ibm.com> <borntrae@de.ibm.com>
+Christian Brauner <brauner@kernel.org> <christian@brauner.io>
+Christian Brauner <brauner@kernel.org> <christian.brauner@canonical.com>
+Christian Brauner <brauner@kernel.org> <christian.brauner@ubuntu.com>
 Christophe Ricard <christophe.ricard@gmail.com>
 Christoph Hellwig <hch@lst.de>
 Colin Ian King <colin.king@intel.com> <colin.king@canonical.com>
index f2b3439..860fe65 100644 (file)
@@ -92,7 +92,8 @@ Triggers can be set on more than one psi metric and more than one trigger
 for the same psi metric can be specified. However for each trigger a separate
 file descriptor is required to be able to poll it separately from others,
 therefore for each trigger a separate open() syscall should be made even
-when opening the same psi interface file.
+when opening the same psi interface file. Write operations to a file descriptor
+with an already existing psi trigger will fail with EBUSY.
 
 Monitors activate only when system enters stall state for the monitored
 psi metric and deactivates upon exit from the stall state. While system is
index 7db3675..f6861ca 100644 (file)
@@ -10,6 +10,7 @@ gpio
     gpio-aggregator
     sysfs
     gpio-mockup
+    gpio-sim
 
 .. only::  subproject and html
 
index 9485a5a..2f41caa 100644 (file)
@@ -266,10 +266,12 @@ Avanta family
 -------------
 
   Flavors:
+       - 88F6500
        - 88F6510
        - 88F6530P
        - 88F6550
        - 88F6560
+       - 88F6601
 
   Homepage:
        https://web.archive.org/web/20181005145041/http://www.marvell.com/broadband/
index 5342e89..ea281dd 100644 (file)
@@ -52,6 +52,12 @@ stable kernels.
 | Allwinner      | A64/R18         | UNKNOWN1        | SUN50I_ERRATUM_UNKNOWN1     |
 +----------------+-----------------+-----------------+-----------------------------+
 +----------------+-----------------+-----------------+-----------------------------+
+| ARM            | Cortex-A510     | #2064142        | ARM64_ERRATUM_2064142       |
++----------------+-----------------+-----------------+-----------------------------+
+| ARM            | Cortex-A510     | #2038923        | ARM64_ERRATUM_2038923       |
++----------------+-----------------+-----------------+-----------------------------+
+| ARM            | Cortex-A510     | #1902691        | ARM64_ERRATUM_1902691       |
++----------------+-----------------+-----------------+-----------------------------+
 | ARM            | Cortex-A53      | #826319         | ARM64_ERRATUM_826319        |
 +----------------+-----------------+-----------------+-----------------------------+
 | ARM            | Cortex-A53      | #827319         | ARM64_ERRATUM_827319        |
@@ -92,12 +98,20 @@ stable kernels.
 +----------------+-----------------+-----------------+-----------------------------+
 | ARM            | Cortex-A77      | #1508412        | ARM64_ERRATUM_1508412       |
 +----------------+-----------------+-----------------+-----------------------------+
+| ARM            | Cortex-A510     | #2051678        | ARM64_ERRATUM_2051678       |
++----------------+-----------------+-----------------+-----------------------------+
+| ARM            | Cortex-A510     | #2077057        | ARM64_ERRATUM_2077057       |
++----------------+-----------------+-----------------+-----------------------------+
 | ARM            | Cortex-A710     | #2119858        | ARM64_ERRATUM_2119858       |
 +----------------+-----------------+-----------------+-----------------------------+
 | ARM            | Cortex-A710     | #2054223        | ARM64_ERRATUM_2054223       |
 +----------------+-----------------+-----------------+-----------------------------+
 | ARM            | Cortex-A710     | #2224489        | ARM64_ERRATUM_2224489       |
 +----------------+-----------------+-----------------+-----------------------------+
+| ARM            | Cortex-X2       | #2119858        | ARM64_ERRATUM_2119858       |
++----------------+-----------------+-----------------+-----------------------------+
+| ARM            | Cortex-X2       | #2224489        | ARM64_ERRATUM_2224489       |
++----------------+-----------------+-----------------+-----------------------------+
 | ARM            | Neoverse-N1     | #1188873,1418040| ARM64_ERRATUM_1418040       |
 +----------------+-----------------+-----------------+-----------------------------+
 | ARM            | Neoverse-N1     | #1349291        | N/A                         |
index dcefee7..a833ecf 100644 (file)
@@ -7,6 +7,14 @@ directory. These are intended to be small tests to exercise individual code
 paths in the kernel. Tests are intended to be run after building, installing
 and booting a kernel.
 
+Kselftest from mainline can be run on older stable kernels. Running tests
+from mainline offers the best coverage. Several test rings run mainline
+kselftest suite on stable releases. The reason is that when a new test
+gets added to test existing code to regression test a bug, we should be
+able to run that test on an older kernel. Hence, it is important to keep
+code that can still test an older kernel and make sure it skips the test
+gracefully on newer releases.
+
 You can find additional information on Kselftest framework, how to
 write new tests using the framework on Kselftest wiki:
 
diff --git a/Documentation/devicetree/bindings/arm/airoha.yaml b/Documentation/devicetree/bindings/arm/airoha.yaml
new file mode 100644 (file)
index 0000000..fc19b1a
--- /dev/null
@@ -0,0 +1,28 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/airoha.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Airoha SoC based Platforms Device Tree Bindings
+
+maintainers:
+  - Felix Fietkau <nbd@nbd.name>
+  - John Crispin <john@phrozen.org>
+
+description:
+  Boards with an Airoha SoC shall have the following properties.
+
+properties:
+  $nodename:
+    const: '/'
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - airoha,en7523-evb
+          - const: airoha,en7523
+
+additionalProperties: true
+
+...
index c15c92f..5e2017c 100644 (file)
@@ -13,12 +13,46 @@ properties:
   $nodename:
     const: "/"
   compatible:
-    items:
-      - enum:
-          - altr,socfpga-cyclone5
-          - altr,socfpga-arria5
-          - altr,socfpga-arria10
-      - const: altr,socfpga
+    oneOf:
+      - description: Arria 5 boards
+        items:
+          - enum:
+              - altr,socfpga-arria5-socdk
+          - const: altr,socfpga-arria5
+          - const: altr,socfpga
+
+      - description: Arria 10 boards
+        items:
+          - enum:
+              - altr,socfpga-arria10-socdk
+              - enclustra,mercury-aa1
+          - const: altr,socfpga-arria10
+          - const: altr,socfpga
+
+      - description: Cyclone 5 boards
+        items:
+          - enum:
+              - altr,socfpga-cyclone5-socdk
+              - denx,mcvevk
+              - ebv,socrates
+              - macnica,sodia
+              - novtech,chameleon96
+              - samtec,vining
+              - terasic,de0-atlas
+              - terasic,socfpga-cyclone5-sockit
+          - const: altr,socfpga-cyclone5
+          - const: altr,socfpga
+
+      - description: Stratix 10 boards
+        items:
+          - enum:
+              - altr,socfpga-stratix10-socdk
+          - const: altr,socfpga-stratix10
+
+      - description: SoCFPGA VT
+        items:
+          - const: altr,socfpga-vt
+          - const: altr,socfpga
 
 additionalProperties: true
 
index 3608173..61a6cab 100644 (file)
@@ -108,6 +108,7 @@ properties:
               - amlogic,p230
               - amlogic,p231
               - libretech,aml-s905d-pc
+              - osmc,vero4k-plus
               - phicomm,n1
               - smartlabs,sml5442tw
               - videostrong,gxl-kii-pro
@@ -170,9 +171,14 @@ properties:
       - description: Boards with the Amlogic Meson SM1 S905X3/D3/Y3 SoC
         items:
           - enum:
+              - amediatech,x96-air
+              - amediatech,x96-air-gbit
               - bananapi,bpi-m5
+              - cyx,a95xf3-air
+              - cyx,a95xf3-air-gbit
               - hardkernel,odroid-c4
               - hardkernel,odroid-hc4
+              - haochuangyi,h96-max
               - khadas,vim3l
               - seirobotics,sei610
           - const: amlogic,sm1
@@ -183,6 +189,12 @@ properties:
               - amlogic,ad401
           - const: amlogic,a1
 
+      - description: Boards with the Amlogic Meson S4 S805X2 SoC
+        items:
+          - enum:
+              - amlogic,aq222
+          - const: amlogic,s4
+
 additionalProperties: true
 
 ...
index c612e1f..9d46ff7 100644 (file)
@@ -174,6 +174,15 @@ properties:
           - const: microchip,lan9668
           - const: microchip,lan966
 
+      - description: Kontron KSwitch D10 MMT series
+        items:
+          - enum:
+              - kontron,kswitch-d10-mmt-8g
+              - kontron,kswitch-d10-mmt-6g-2gs
+          - const: kontron,s1921
+          - const: microchip,lan9668
+          - const: microchip,lan966
+
       - items:
           - enum:
               - atmel,sams70j19
index 0dcebc4..3aad1b9 100644 (file)
@@ -173,6 +173,7 @@ properties:
       - nvidia,tegra194-carmel
       - qcom,krait
       - qcom,kryo
+      - qcom,kryo250
       - qcom,kryo260
       - qcom,kryo280
       - qcom,kryo385
index 97f6eeb..08bdd30 100644 (file)
@@ -762,6 +762,7 @@ properties:
           - enum:
               - beacon,imx8mm-beacon-kit  # i.MX8MM Beacon Development Kit
               - boundary,imx8mm-nitrogen8mm  # i.MX8MM Nitrogen Board
+              - emtrion,emcon-mx8mm-avari # emCON-MX8MM SoM on Avari Base
               - fsl,imx8mm-ddr4-evk       # i.MX8MM DDR4 EVK Board
               - fsl,imx8mm-evk            # i.MX8MM EVK Board
               - gw,imx8mm-gw71xx-0x       # i.MX8MM Gateworks Development Kit
@@ -769,8 +770,13 @@ properties:
               - gw,imx8mm-gw73xx-0x       # i.MX8MM Gateworks Development Kit
               - gw,imx8mm-gw7901          # i.MX8MM Gateworks Board
               - gw,imx8mm-gw7902          # i.MX8MM Gateworks Board
+              - gw,imx8mm-gw7903          # i.MX8MM Gateworks Board
               - kontron,imx8mm-n801x-som  # i.MX8MM Kontron SL (N801X) SOM
+              - toradex,verdin-imx8mm     # Verdin iMX8M Mini Modules
+              - toradex,verdin-imx8mm-nonwifi  # Verdin iMX8M Mini Modules without Wi-Fi / BT
+              - toradex,verdin-imx8mm-wifi  # Verdin iMX8M Mini Wi-Fi / BT Modules
               - variscite,var-som-mx8mm   # i.MX8MM Variscite VAR-SOM-MX8MM module
+              - prt,prt8mm                # i.MX8MM Protonic PRT8MM Board
           - const: fsl,imx8mm
 
       - description: Engicam i.Core MX8M Mini SoM based boards
@@ -787,6 +793,24 @@ properties:
           - const: kontron,imx8mm-n801x-som
           - const: fsl,imx8mm
 
+      - description: Toradex Boards with Verdin iMX8M Mini Modules
+        items:
+          - enum:
+              - toradex,verdin-imx8mm-nonwifi-dahlia # Verdin iMX8M Mini Module on Dahlia
+              - toradex,verdin-imx8mm-nonwifi-dev    # Verdin iMX8M Mini Module on Verdin Development Board
+          - const: toradex,verdin-imx8mm-nonwifi     # Verdin iMX8M Mini Module without Wi-Fi / BT
+          - const: toradex,verdin-imx8mm             # Verdin iMX8M Mini Module
+          - const: fsl,imx8mm
+
+      - description: Toradex Boards with Verdin iMX8M Mini Wi-Fi / BT Modules
+        items:
+          - enum:
+              - toradex,verdin-imx8mm-wifi-dahlia # Verdin iMX8M Mini Wi-Fi / BT Module on Dahlia
+              - toradex,verdin-imx8mm-wifi-dev    # Verdin iMX8M Mini Wi-Fi / BT M. on Verdin Development B.
+          - const: toradex,verdin-imx8mm-wifi     # Verdin iMX8M Mini Wi-Fi / BT Module
+          - const: toradex,verdin-imx8mm          # Verdin iMX8M Mini Module
+          - const: fsl,imx8mm
+
       - description: Variscite VAR-SOM-MX8MM based boards
         items:
           - const: variscite,var-som-mx8mm-symphony
diff --git a/Documentation/devicetree/bindings/arm/intel,socfpga.yaml b/Documentation/devicetree/bindings/arm/intel,socfpga.yaml
new file mode 100644 (file)
index 0000000..6e04345
--- /dev/null
@@ -0,0 +1,26 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/intel,socfpga.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Intel SoCFPGA platform device tree bindings
+
+maintainers:
+  - Dinh Nguyen <dinguyen@kernel.org>
+
+properties:
+  $nodename:
+    const: "/"
+  compatible:
+    oneOf:
+      - description: AgileX boards
+        items:
+          - enum:
+              - intel,n5x-socdk
+              - intel,socfpga-agilex-socdk
+          - const: intel,socfpga-agilex
+
+additionalProperties: true
+
+...
index 0ffe1ac..ab0593c 100644 (file)
@@ -32,6 +32,10 @@ properties:
           - const: mediatek,mt6580
       - items:
           - enum:
+              - prestigio,pmt5008-3g
+          - const: mediatek,mt6582
+      - items:
+          - enum:
               - fairphone,fp1
               - mundoreader,bq-aquaris5
           - const: mediatek,mt6589
index a316eef..8892eb6 100644 (file)
@@ -23,8 +23,12 @@ properties:
       - description: infinity2m boards
         items:
           - enum:
+              - 100ask,dongshanpione # 100ask DongShanPiOne
               - honestar,ssd201htv2 # Honestar SSD201_HT_V2 devkit
               - m5stack,unitv2 # M5Stack UnitV2
+              - miyoo,miyoo-mini # Miyoo Mini
+              - wirelesstag,ido-som2d01 # Wireless Tag IDO-SOM2D01
+              - wirelesstag,ido-sbc2d06-v1b-22w # Wireless Tag IDO-SBC2D06-1VB-22W
           - const: mstar,infinity2m
 
       - description: infinity3 boards
diff --git a/Documentation/devicetree/bindings/arm/npcm/nuvoton,gcr.yaml b/Documentation/devicetree/bindings/arm/npcm/nuvoton,gcr.yaml
new file mode 100644 (file)
index 0000000..fcb211a
--- /dev/null
@@ -0,0 +1,48 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/npcm/nuvoton,gcr.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Global Control Registers block in Nuvoton SoCs
+
+maintainers:
+  - Jonathan Neuschäfer <j.neuschaefer@gmx.net>
+
+description:
+  The Global Control Registers (GCR) are a block of registers in Nuvoton SoCs
+  that expose misc functionality such as chip model and version information or
+  pinmux settings.
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - nuvoton,wpcm450-gcr
+          - nuvoton,npcm750-gcr
+      - const: syscon
+      - const: simple-mfd
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties:
+  type: object
+
+examples:
+  - |
+    gcr: syscon@800000 {
+      compatible = "nuvoton,npcm750-gcr", "syscon", "simple-mfd";
+      reg = <0x800000 0x1000>;
+
+      mux-controller {
+        compatible = "mmio-mux";
+        #mux-control-cells = <1>;
+        mux-reg-masks = <0x38 0x07>;
+        idle-states = <2>;
+      };
+    };
index 370aab2..f4336ea 100644 (file)
@@ -42,6 +42,7 @@ description: |
         sc7180
         sc7280
         sdm630
+        sdm632
         sdm660
         sdm845
         sdx55
@@ -173,7 +174,21 @@ properties:
           - const: qcom,apq8094
 
       - items:
-          - const: qcom,msm8996-mtp
+          - enum:
+              - arrow,apq8096-db820c
+              - inforce,ifc6640
+          - const: qcom,apq8096-sbc
+          - const: qcom,apq8096
+
+      - items:
+          - enum:
+              - qcom,msm8996-mtp
+              - sony,dora-row
+              - sony,kagura-row
+              - sony,keyaki-row
+              - xiaomi,gemini
+              - xiaomi,scorpio
+          - const: qcom,msm8996
 
       - items:
           - enum:
@@ -213,6 +228,11 @@ properties:
 
       - items:
           - enum:
+              - fairphone,fp3
+          - const: qcom,sdm632
+
+      - items:
+          - enum:
               - xiaomi,lavender
           - const: qcom,sdm660
 
@@ -268,6 +288,7 @@ properties:
 
       - items:
           - enum:
+              - qcom,sm8450-hdk
               - qcom,sm8450-qrd
           - const: qcom,sm8450
 
index 6a9350e..fa435d6 100644 (file)
@@ -421,6 +421,15 @@ properties:
               - renesas,r9a07g044l2 # Dual Cortex-A55 RZ/G2L
           - const: renesas,r9a07g044
 
+      - description: RZ/V2L (R9A07G054)
+        items:
+          - enum:
+              - renesas,smarc-evk # SMARC EVK
+          - enum:
+              - renesas,r9a07g054l1 # Single Cortex-A55 RZ/V2L
+              - renesas,r9a07g054l2 # Dual Cortex-A55 RZ/V2L
+          - const: renesas,r9a07g054
+
 additionalProperties: true
 
 ...
index 4aed161..eece92f 100644 (file)
@@ -481,6 +481,14 @@ properties:
           - const: pine64,pinebook-pro
           - const: rockchip,rk3399
 
+      - description: Pine64 PineNote
+        items:
+          - enum:
+              - pine64,pinenote-v1.1
+              - pine64,pinenote-v1.2
+          - const: pine64,pinenote
+          - const: rockchip,rk3566
+
       - description: Pine64 Rock64
         items:
           - const: pine64,rock64
@@ -651,6 +659,11 @@ properties:
           - const: rockchip,rk3568-evb1-v10
           - const: rockchip,rk3568
 
+      - description: Rockchip RK3568 Banana Pi R2 Pro
+        items:
+          - const: rockchip,rk3568-bpi-r2pro
+          - const: rockchip,rk3568
+
 additionalProperties: true
 
 ...
index 052cd94..faea33e 100644 (file)
@@ -140,6 +140,8 @@ properties:
         items:
           - enum:
               - insignal,arndale-octa           # Insignal Arndale Octa
+              - samsung,chagall-wifi            # Samsung SM-T800
+              - samsung,klimt-wifi              # Samsung SM-T700
               - samsung,smdk5420                # Samsung SMDK5420 eval
           - const: samsung,exynos5420
           - const: samsung,exynos5
index b07720e..fa0a1b8 100644 (file)
@@ -28,6 +28,12 @@ properties:
           - enum:
               - st,stm32mp153
               - st,stm32mp157
+
+      - description: emtrion STM32MP1 Argon based Boards
+        items:
+          - const: emtrion,stm32mp157c-emsbc-argon
+          - const: emtrion,stm32mp157c-emstamp-argon
+          - const: st,stm32mp157
       - items:
           - enum:
               - st,stm32f429i-disco
index c8a3102..086c687 100644 (file)
@@ -444,6 +444,11 @@ properties:
           - const: haoyu,a10-marsboard
           - const: allwinner,sun4i-a10
 
+      - description: HAOYU Electronics Marsboard A20
+        items:
+          - const: haoyu,a20-marsboard
+          - const: allwinner,sun7i-a20
+
       - description: MapleBoard MP130
         items:
           - const: mapleboard,mp130
diff --git a/Documentation/devicetree/bindings/arm/tesla.yaml b/Documentation/devicetree/bindings/arm/tesla.yaml
new file mode 100644 (file)
index 0000000..09856da
--- /dev/null
@@ -0,0 +1,27 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/tesla.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Tesla Full Self Driving(FSD) platforms device tree bindings
+
+maintainers:
+  - Alim Akhtar <alim.akhtar@samsung.com>
+  - linux-fsd@tesla.com
+
+properties:
+  $nodename:
+    const: '/'
+  compatible:
+    oneOf:
+
+      - description: FSD SoC board
+        items:
+          - enum:
+              - tesla,fsd-evb   # Tesla FSD Evaluation
+          - const: tesla,fsd
+
+additionalProperties: true
+
+...
index b03c10f..61c6ab4 100644 (file)
@@ -46,6 +46,12 @@ properties:
                   - ti,j7200-evm
               - const: ti,j7200
 
+      - description: K3 AM625 SoC
+        items:
+          - enum:
+              - ti,am625-sk
+          - const: ti,am625
+
       - description: K3 AM642 SoC
         items:
           - enum:
diff --git a/Documentation/devicetree/bindings/clock/intc_stratix10.txt b/Documentation/devicetree/bindings/clock/intc_stratix10.txt
deleted file mode 100644 (file)
index 9f4ec5c..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-Device Tree Clock bindings for Intel's SoCFPGA Stratix10 platform
-
-This binding uses the common clock binding[1].
-
-[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
-
-Required properties:
-- compatible : shall be
-       "intel,stratix10-clkmgr"
-
-- reg : shall be the control register offset from CLOCK_MANAGER's base for the clock.
-
-- #clock-cells : from common clock binding, shall be set to 1.
-
-Example:
-       clkmgr: clock-controller@ffd10000 {
-               compatible = "intel,stratix10-clkmgr";
-               reg = <0xffd10000 0x1000>;
-               #clock-cells = <1>;
-       };
diff --git a/Documentation/devicetree/bindings/clock/intel,stratix10.yaml b/Documentation/devicetree/bindings/clock/intel,stratix10.yaml
new file mode 100644 (file)
index 0000000..f506e3d
--- /dev/null
@@ -0,0 +1,35 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/intel,stratix10.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Intel SoCFPGA Stratix10 platform clock controller binding
+
+maintainers:
+  - Dinh Nguyen <dinguyen@kernel.org>
+
+properties:
+  compatible:
+    const: intel,stratix10-clkmgr
+
+  '#clock-cells':
+    const: 1
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - '#clock-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    clock-controller@ffd10000 {
+        compatible = "intel,stratix10-clkmgr";
+        reg = <0xffd10000 0x1000>;
+        #clock-cells = <1>;
+    };
diff --git a/Documentation/devicetree/bindings/clock/mstar,msc313-cpupll.yaml b/Documentation/devicetree/bindings/clock/mstar,msc313-cpupll.yaml
new file mode 100644 (file)
index 0000000..a9ad7ab
--- /dev/null
@@ -0,0 +1,45 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/mstar,msc313-cpupll.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MStar/Sigmastar MSC313 CPU PLL
+
+maintainers:
+  - Daniel Palmer <daniel@thingy.jp>
+
+description: |
+  The MStar/SigmaStar MSC313 and later ARMv7 chips have a scalable
+  PLL that can be used as the clock source for the CPU(s).
+
+properties:
+  compatible:
+    const: mstar,msc313-cpupll
+
+  "#clock-cells":
+    const: 1
+
+  clocks:
+    maxItems: 1
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - "#clock-cells"
+  - clocks
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/mstar-msc313-mpll.h>
+    cpupll: cpupll@206400 {
+        compatible = "mstar,msc313-cpupll";
+        reg = <0x206400 0x200>;
+        #clock-cells = <1>;
+        clocks = <&mpll MSTAR_MSC313_MPLL_DIV2>;
+    };
diff --git a/Documentation/devicetree/bindings/clock/tesla,fsd-clock.yaml b/Documentation/devicetree/bindings/clock/tesla,fsd-clock.yaml
new file mode 100644 (file)
index 0000000..dc808e2
--- /dev/null
@@ -0,0 +1,198 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/tesla,fsd-clock.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Tesla FSD (Full Self-Driving) SoC clock controller
+
+maintainers:
+  - Alim Akhtar <alim.akhtar@samsung.com>
+  - linux-fsd@tesla.com
+
+description: |
+  FSD clock controller consist of several clock management unit
+  (CMU), which generates clocks for various inteernal SoC blocks.
+  The root clock comes from external OSC clock (24 MHz).
+
+  All available clocks are defined as preprocessor macros in
+  'dt-bindings/clock/fsd-clk.h' header.
+
+properties:
+  compatible:
+    enum:
+      - tesla,fsd-clock-cmu
+      - tesla,fsd-clock-imem
+      - tesla,fsd-clock-peric
+      - tesla,fsd-clock-fsys0
+      - tesla,fsd-clock-fsys1
+      - tesla,fsd-clock-mfc
+      - tesla,fsd-clock-cam_csi
+
+  clocks:
+    minItems: 1
+    maxItems: 6
+
+  clock-names:
+    minItems: 1
+    maxItems: 6
+
+  "#clock-cells":
+    const: 1
+
+  reg:
+    maxItems: 1
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: tesla,fsd-clock-cmu
+    then:
+      properties:
+        clocks:
+          items:
+            - description: External reference clock (24 MHz)
+        clock-names:
+          items:
+            - const: fin_pll
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: tesla,fsd-clock-imem
+    then:
+      properties:
+        clocks:
+          items:
+            - description: External reference clock (24 MHz)
+            - description: IMEM TCU clock (from CMU_CMU)
+            - description: IMEM bus clock (from CMU_CMU)
+            - description: IMEM DMA clock (from CMU_CMU)
+        clock-names:
+          items:
+            - const: fin_pll
+            - const: dout_cmu_imem_tcuclk
+            - const: dout_cmu_imem_aclk
+            - const: dout_cmu_imem_dmaclk
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: tesla,fsd-clock-peric
+    then:
+      properties:
+        clocks:
+          items:
+            - description: External reference clock (24 MHz)
+            - description: Shared0 PLL div4 clock (from CMU_CMU)
+            - description: PERIC shared1 div36 clock (from CMU_CMU)
+            - description: PERIC shared0 div3 TBU clock (from CMU_CMU)
+            - description: PERIC shared0 div20 clock (from CMU_CMU)
+            - description: PERIC shared1 div4 DMAclock (from CMU_CMU)
+        clock-names:
+          items:
+            - const: fin_pll
+            - const: dout_cmu_pll_shared0_div4
+            - const: dout_cmu_peric_shared1div36
+            - const: dout_cmu_peric_shared0div3_tbuclk
+            - const: dout_cmu_peric_shared0div20
+            - const: dout_cmu_peric_shared1div4_dmaclk
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: tesla,fsd-clock-fsys0
+    then:
+      properties:
+        clocks:
+          items:
+            - description: External reference clock (24 MHz)
+            - description: Shared0 PLL div6 clock (from CMU_CMU)
+            - description: FSYS0 shared1 div4 clock (from CMU_CMU)
+            - description: FSYS0 shared0 div4 clock (from CMU_CMU)
+        clock-names:
+          items:
+            - const: fin_pll
+            - const: dout_cmu_pll_shared0_div6
+            - const: dout_cmu_fsys0_shared1div4
+            - const: dout_cmu_fsys0_shared0div4
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: tesla,fsd-clock-fsys1
+    then:
+      properties:
+        clocks:
+          items:
+            - description: External reference clock (24 MHz)
+            - description: FSYS1 shared0 div8 clock (from CMU_CMU)
+            - description: FSYS1 shared0 div4 clock (from CMU_CMU)
+        clock-names:
+          items:
+            - const: fin_pll
+            - const: dout_cmu_fsys1_shared0div8
+            - const: dout_cmu_fsys1_shared0div4
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: tesla,fsd-clock-mfc
+    then:
+      properties:
+        clocks:
+          items:
+            - description: External reference clock (24 MHz)
+        clock-names:
+          items:
+            - const: fin_pll
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: tesla,fsd-clock-cam_csi
+    then:
+      properties:
+        clocks:
+          items:
+            - description: External reference clock (24 MHz)
+        clock-names:
+          items:
+            - const: fin_pll
+
+required:
+  - compatible
+  - "#clock-cells"
+  - clocks
+  - clock-names
+  - reg
+
+additionalProperties: false
+
+examples:
+  # Clock controller node for CMU_FSYS1
+  - |
+    #include <dt-bindings/clock/fsd-clk.h>
+
+    clock_fsys1: clock-controller@16810000 {
+          compatible = "tesla,fsd-clock-fsys1";
+          reg = <0x16810000 0x3000>;
+          #clock-cells = <1>;
+
+          clocks = <&fin_pll>,
+                   <&clock_cmu DOUT_CMU_FSYS1_SHARED0DIV8>,
+                   <&clock_cmu DOUT_CMU_FSYS1_SHARED0DIV4>;
+          clock-names = "fin_pll",
+                        "dout_cmu_fsys1_shared0div8",
+                        "dout_cmu_fsys1_shared0div4";
+    };
+
+...
index 79d0358..620f017 100644 (file)
@@ -36,6 +36,7 @@ properties:
           - renesas,intc-ex-r8a77980    # R-Car V3H
           - renesas,intc-ex-r8a77990    # R-Car E3
           - renesas,intc-ex-r8a77995    # R-Car D3
+          - renesas,intc-ex-r8a779a0    # R-Car V3U
       - const: renesas,irqc
 
   '#interrupt-cells':
index 28b6b17..0dfa6b2 100644 (file)
@@ -62,6 +62,7 @@ properties:
 
   interrupts-extended:
     minItems: 1
+    maxItems: 15872
     description:
       Specifies which contexts are connected to the PLIC, with "-1" specifying
       that a context is not present. Each node pointed to should be a
@@ -90,12 +91,11 @@ examples:
       #interrupt-cells = <1>;
       compatible = "sifive,fu540-c000-plic", "sifive,plic-1.0.0";
       interrupt-controller;
-      interrupts-extended = <
-        &cpu0_intc 11
-        &cpu1_intc 11 &cpu1_intc 9
-        &cpu2_intc 11 &cpu2_intc 9
-        &cpu3_intc 11 &cpu3_intc 9
-        &cpu4_intc 11 &cpu4_intc 9>;
+      interrupts-extended = <&cpu0_intc 11>,
+                            <&cpu1_intc 11>, <&cpu1_intc 9>,
+                            <&cpu2_intc 11>, <&cpu2_intc 9>,
+                            <&cpu3_intc 11>, <&cpu3_intc 9>,
+                            <&cpu4_intc 11>, <&cpu4_intc 9>;
       reg = <0xc000000 0x4000000>;
       riscv,ndev = <10>;
     };
index 0968b40..e3501bf 100644 (file)
@@ -31,7 +31,7 @@ tcan4x5x: tcan4x5x@0 {
                #address-cells = <1>;
                #size-cells = <1>;
                spi-max-frequency = <10000000>;
-               bosch,mram-cfg = <0x0 0 0 32 0 0 1 1>;
+               bosch,mram-cfg = <0x0 0 0 16 0 0 1 1>;
                interrupt-parent = <&gpio1>;
                interrupts = <14 IRQ_TYPE_LEVEL_LOW>;
                device-state-gpios = <&gpio3 21 GPIO_ACTIVE_HIGH>;
index b86edf6..58ecc62 100644 (file)
@@ -107,6 +107,10 @@ properties:
           - const: imem
           - const: config
 
+  qcom,qmp:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: phandle to the AOSS side-channel message RAM
+
   qcom,smem-states:
     $ref: /schemas/types.yaml#/definitions/phandle-array
     description: State bits used in by the AP to signal the modem.
@@ -222,6 +226,8 @@ examples:
                                      "imem",
                                      "config";
 
+                qcom,qmp = <&aoss_qmp>;
+
                 qcom,smem-states = <&ipa_smp2p_out 0>,
                                    <&ipa_smp2p_out 1>;
                 qcom,smem-state-names = "ipa-clock-enabled-valid",
index b3b75c1..6814dcc 100644 (file)
@@ -9,6 +9,7 @@ PROPERTIES
                 following:
 
                         "qcom,usb-hs-phy-apq8064"
+                        "qcom,usb-hs-phy-msm8226"
                         "qcom,usb-hs-phy-msm8916"
                         "qcom,usb-hs-phy-msm8974"
 
diff --git a/Documentation/devicetree/bindings/pinctrl/samsung,pinctrl-gpio-bank.yaml b/Documentation/devicetree/bindings/pinctrl/samsung,pinctrl-gpio-bank.yaml
new file mode 100644 (file)
index 0000000..f73348c
--- /dev/null
@@ -0,0 +1,52 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/samsung,pinctrl-gpio-bank.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Samsung S3C/S5P/Exynos SoC pin controller - gpio bank
+
+maintainers:
+  - Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
+  - Sylwester Nawrocki <s.nawrocki@samsung.com>
+  - Tomasz Figa <tomasz.figa@gmail.com>
+
+description: |
+  This is a part of device tree bindings for Samsung S3C/S5P/Exynos SoC pin
+  controller.
+
+  GPIO bank description for Samsung S3C/S5P/Exynos SoC pin controller.
+
+  See also Documentation/devicetree/bindings/pinctrl/samsung,pinctrl.yaml for
+  additional information and example.
+
+properties:
+  '#gpio-cells':
+    const: 2
+
+  gpio-controller: true
+
+  '#interrupt-cells':
+    description:
+      For GPIO banks supporting external GPIO interrupts or external wake-up
+      interrupts.
+    const: 2
+
+  interrupt-controller:
+    description:
+      For GPIO banks supporting external GPIO interrupts or external wake-up
+      interrupts.
+
+  interrupts:
+    description:
+      For GPIO banks supporting direct external wake-up interrupts (without
+      multiplexing).  Number of interrupts must match number of wake-up capable
+      pins of this bank.
+    minItems: 1
+    maxItems: 8
+
+required:
+  - '#gpio-cells'
+  - gpio-controller
+
+additionalProperties: false
diff --git a/Documentation/devicetree/bindings/pinctrl/samsung,pinctrl-pins-cfg.yaml b/Documentation/devicetree/bindings/pinctrl/samsung,pinctrl-pins-cfg.yaml
new file mode 100644 (file)
index 0000000..c71939a
--- /dev/null
@@ -0,0 +1,81 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/samsung,pinctrl-pins-cfg.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Samsung S3C/S5P/Exynos SoC pin controller - pins configuration
+
+maintainers:
+  - Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
+  - Sylwester Nawrocki <s.nawrocki@samsung.com>
+  - Tomasz Figa <tomasz.figa@gmail.com>
+
+description: |
+  This is a part of device tree bindings for Samsung S3C/S5P/Exynos SoC pin
+  controller.
+
+  Pins configuration for Samsung S3C/S5P/Exynos SoC pin controller.
+
+  The values used for config properties should be derived from the hardware
+  manual and these values are programmed as-is into the pin pull up/down and
+  driver strength register of the pin-controller.
+  See also include/dt-bindings/pinctrl/samsung.h with useful constants.
+
+  See also Documentation/devicetree/bindings/pinctrl/samsung,pinctrl.yaml for
+  additional information and example.
+
+properties:
+  samsung,pins:
+    description: |
+      List of pins to configure. For initial and sleep states, the maximum
+      number is one pin. In other cases there is no upper limit.
+
+      The pins should use lowercase names matching hardware manual, e.g. for
+      GPA0 bank: gpa0-0, gpa0-1, gpa0-2.
+    $ref: /schemas/types.yaml#/definitions/string-array
+
+  samsung,pin-function:
+    description: |
+      The pin function selection that should be applied on the pins listed in the
+      child node is specified using the "samsung,pin-function" property. The value
+      of this property that should be applied to each of the pins listed in the
+      "samsung,pins" property should be picked from the hardware manual of the SoC
+      for the specified pin group. This property is optional in the child node if
+      no specific function selection is desired for the pins listed in the child
+      node. The value of this property is used as-is to program the pin-controller
+      function selector register of the pin-bank.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 0
+    maximum: 15
+
+  samsung,pin-drv:
+    description: Drive strength configuration.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 0
+    maximum: 15
+
+  samsung,pin-pud:
+    description: Pull up/down configuration.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1, 2, 3]
+
+  samsung,pin-val:
+    description: Initial value of pin output buffer.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1]
+
+  samsung,pin-con-pdn:
+    description: Function in power down mode.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1, 2, 3]
+
+  samsung,pin-pud-pdn:
+    description: Pull up/down configuration in power down mode.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1, 2, 3]
+
+required:
+  - samsung,pins
+
+additionalProperties: false
diff --git a/Documentation/devicetree/bindings/pinctrl/samsung,pinctrl-wakeup-interrupt.yaml b/Documentation/devicetree/bindings/pinctrl/samsung,pinctrl-wakeup-interrupt.yaml
new file mode 100644 (file)
index 0000000..a822f70
--- /dev/null
@@ -0,0 +1,106 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/samsung,pinctrl-wakeup-interrupt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Samsung S3C/S5P/Exynos SoC pin controller - wake-up interrupt controller
+
+maintainers:
+  - Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
+  - Sylwester Nawrocki <s.nawrocki@samsung.com>
+  - Tomasz Figa <tomasz.figa@gmail.com>
+
+description: |
+  This is a part of device tree bindings for Samsung S3C/S5P/Exynos SoC pin
+  controller.
+
+  External wake-up interrupts for Samsung S3C/S5P/Exynos SoC pin controller.
+  For S3C24xx, S3C64xx, S5PV210 and Exynos4210 compatible wake-up interrupt
+  controllers, only one pin-controller device node can include external wake-up
+  interrupts child node (in other words, only one External wake-up interrupts
+  pin-controller is supported).
+  For newer controllers, multiple pin-controller device node can include
+  external wake-up interrupts child node.
+
+  See also Documentation/devicetree/bindings/pinctrl/samsung,pinctrl.yaml for
+  additional information and example.
+
+properties:
+  compatible:
+    enum:
+      - samsung,s3c2410-wakeup-eint
+      - samsung,s3c2412-wakeup-eint
+      - samsung,s3c64xx-wakeup-eint
+      - samsung,s5pv210-wakeup-eint
+      - samsung,exynos4210-wakeup-eint
+      - samsung,exynos7-wakeup-eint
+      - samsung,exynos850-wakeup-eint
+      - samsung,exynosautov9-wakeup-eint
+
+  interrupts:
+    description:
+      Interrupt used by multiplexed external wake-up interrupts.
+    minItems: 1
+    maxItems: 6
+
+required:
+  - compatible
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - samsung,s3c2410-wakeup-eint
+              - samsung,s3c2412-wakeup-eint
+    then:
+      properties:
+        interrupts:
+          minItems: 6
+          maxItems: 6
+      required:
+        - interrupts
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: samsung,s3c64xx-wakeup-eint
+    then:
+      properties:
+        interrupts:
+          minItems: 4
+          maxItems: 4
+      required:
+        - interrupts
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - samsung,s5pv210-wakeup-eint
+              - samsung,exynos4210-wakeup-eint
+              - samsung,exynos7-wakeup-eint
+    then:
+      properties:
+        interrupts:
+          minItems: 1
+          maxItems: 1
+      required:
+        - interrupts
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - samsung,exynos850-wakeup-eint
+              - samsung,exynosautov9-wakeup-eint
+    then:
+      properties:
+        interrupts: false
+
+additionalProperties: false
diff --git a/Documentation/devicetree/bindings/pinctrl/samsung,pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/samsung,pinctrl.yaml
new file mode 100644 (file)
index 0000000..28f0851
--- /dev/null
@@ -0,0 +1,392 @@
+# SPDX-License-Identifier: GPL-2.0-only
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/samsung,pinctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Samsung S3C/S5P/Exynos SoC pin controller
+
+maintainers:
+  - Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
+  - Sylwester Nawrocki <s.nawrocki@samsung.com>
+  - Tomasz Figa <tomasz.figa@gmail.com>
+
+description: |
+  This is a part of device tree bindings for Samsung S3C/S5P/Exynos SoC pin
+  controller.
+
+  Pin group settings (like drive strength, pull up/down) are available as
+  macros in include/dt-bindings/pinctrl/samsung.h.
+
+  All the pin controller nodes should be represented in the aliases node using
+  the following format 'pinctrl{n}' where n is a unique number for the alias.
+
+  The controller supports three types of interrupts::
+   - External GPIO interrupts (see interrupts property in pin controller node);
+
+   - External wake-up interrupts - multiplexed (capable of waking up the system
+     see interrupts property in external wake-up interrupt controller node -
+     samsung,pinctrl-wakeup-interrupt.yaml);
+
+   - External wake-up interrupts - direct (capable of waking up the system, see
+     interrupts property in every bank of pin controller with external wake-up
+     interrupt controller - samsung,pinctrl-gpio-bank.yaml).
+
+properties:
+  $nodename:
+    pattern: "^pinctrl(@.*)?"
+
+  compatible:
+    enum:
+      - samsung,s3c2412-pinctrl
+      - samsung,s3c2416-pinctrl
+      - samsung,s3c2440-pinctrl
+      - samsung,s3c2450-pinctrl
+      - samsung,s3c64xx-pinctrl
+      - samsung,s5pv210-pinctrl
+      - samsung,exynos3250-pinctrl
+      - samsung,exynos4210-pinctrl
+      - samsung,exynos4x12-pinctrl
+      - samsung,exynos5250-pinctrl
+      - samsung,exynos5260-pinctrl
+      - samsung,exynos5410-pinctrl
+      - samsung,exynos5420-pinctrl
+      - samsung,exynos5433-pinctrl
+      - samsung,exynos7-pinctrl
+      - samsung,exynos7885-pinctrl
+      - samsung,exynos850-pinctrl
+      - samsung,exynosautov9-pinctrl
+
+  interrupts:
+    description:
+      Required for GPIO banks supporting external GPIO interrupts.
+    maxItems: 1
+
+  power-domains:
+    maxItems: 1
+
+  reg:
+    description:
+      Second base address of the pin controller if the specific registers of
+      the pin controller are separated into the different base address.
+      Only certain banks of certain pin controller might need it.
+    minItems: 1
+    maxItems: 2
+
+  wakeup-interrupt-controller:
+    $ref: samsung,pinctrl-wakeup-interrupt.yaml
+
+patternProperties:
+  "^[a-z]+[0-9]*-gpio-bank$":
+    description:
+      Pin banks of the controller are represented by child nodes of the
+      controller node. Bank name is taken from name of the node.
+    $ref: samsung,pinctrl-gpio-bank.yaml
+
+  "^[a-z0-9-]+-pins$":
+    oneOf:
+      - $ref: samsung,pinctrl-pins-cfg.yaml
+        required:
+          - samsung,pins
+      - type: object
+        patternProperties:
+          "^[a-z0-9-]+-pins$":
+            $ref: samsung,pinctrl-pins-cfg.yaml
+
+        additionalProperties: false
+
+  "^(initial|sleep)-state$":
+    patternProperties:
+      "^(pin-[a-z0-9-]+|[a-z0-9-]+-pin)$":
+        $ref: samsung,pinctrl-pins-cfg.yaml
+
+        properties:
+          samsung,pins:
+            description: See samsung,pinctrl-pins-cfg.yaml
+            $ref: /schemas/types.yaml#/definitions/string-array
+            maxItems: 1
+
+        required:
+          - samsung,pins
+
+        unevaluatedProperties: false
+
+required:
+  - compatible
+  - reg
+
+allOf:
+  - $ref: "pinctrl.yaml#"
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: samsung,exynos5433-pinctrl
+    then:
+      properties:
+        reg:
+          minItems: 1
+          maxItems: 2
+    else:
+      properties:
+        reg:
+          minItems: 1
+          maxItems: 1
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/pinctrl/samsung.h>
+
+    pinctrl@7f008000 {
+        compatible = "samsung,s3c64xx-pinctrl";
+        reg = <0x7f008000 0x1000>;
+        interrupt-parent = <&vic1>;
+        interrupts = <21>;
+
+        wakeup-interrupt-controller {
+            compatible = "samsung,s3c64xx-wakeup-eint";
+            interrupts-extended = <&vic0 0>,
+                                  <&vic0 1>,
+                                  <&vic1 0>,
+                                  <&vic1 1>;
+        };
+
+        /* Pin bank with external GPIO or muxed external wake-up interrupts */
+        gpa-gpio-bank {
+            gpio-controller;
+            #gpio-cells = <2>;
+            interrupt-controller;
+            #interrupt-cells = <2>;
+        };
+
+        // ...
+
+        uart0-data-pins {
+            samsung,pins = "gpa-0", "gpa-1";
+            samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+            samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
+        };
+
+        // ...
+    };
+
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/pinctrl/samsung.h>
+
+    pinctrl@11400000 {
+        compatible = "samsung,exynos4210-pinctrl";
+        reg = <0x11400000 0x1000>;
+        interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>;
+
+        pinctrl-names = "default";
+        pinctrl-0 = <&sleep0>;
+
+        /* Pin bank with external GPIO or muxed external wake-up interrupts */
+        gpa0-gpio-bank {
+            gpio-controller;
+            #gpio-cells = <2>;
+            interrupt-controller;
+            #interrupt-cells = <2>;
+        };
+
+        // ...
+
+        uart0-data-pins {
+            samsung,pins = "gpa0-0", "gpa0-1";
+            samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+            samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+            samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+        };
+
+        // ...
+
+        sleep0: sleep-state {
+            gpa0-0-pin {
+                samsung,pins = "gpa0-0";
+                samsung,pin-con-pdn = <EXYNOS_PIN_PDN_INPUT>;
+                samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_NONE>;
+            };
+
+            gpa0-1-pin {
+                samsung,pins = "gpa0-1";
+                samsung,pin-con-pdn = <EXYNOS_PIN_PDN_OUT0>;
+                samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_NONE>;
+            };
+
+            // ...
+        };
+    };
+
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/pinctrl/samsung.h>
+
+    pinctrl@11000000 {
+        compatible = "samsung,exynos4210-pinctrl";
+        reg = <0x11000000 0x1000>;
+        interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
+
+        wakeup-interrupt-controller {
+            compatible = "samsung,exynos4210-wakeup-eint";
+            interrupt-parent = <&gic>;
+            interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+        };
+
+        /* Pin bank with external GPIO or muxed external wake-up interrupts */
+        gpj0-gpio-bank {
+            gpio-controller;
+            #gpio-cells = <2>;
+            interrupt-controller;
+            #interrupt-cells = <2>;
+        };
+
+        /* Pin bank without external interrupts */
+        gpy0-gpio-bank {
+            gpio-controller;
+            #gpio-cells = <2>;
+        };
+
+        /* Pin bank with external direct wake-up interrupts */
+        gpx0-gpio-bank {
+            gpio-controller;
+            #gpio-cells = <2>;
+
+            interrupt-controller;
+            interrupt-parent = <&gic>;
+            interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
+            #interrupt-cells = <2>;
+        };
+
+        // ...
+
+        sd0-clk-pins {
+            samsung,pins = "gpk0-0";
+            samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+            samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+            samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
+        };
+
+        sd4-bus-width8-pins {
+            part-1-pins {
+                samsung,pins = "gpk0-3", "gpk0-4",
+                               "gpk0-5", "gpk0-6";
+                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
+            };
+
+            part-2-pins {
+                samsung,pins = "gpk1-3", "gpk1-4",
+                               "gpk1-5", "gpk1-6";
+                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
+                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
+            };
+        };
+
+        // ...
+
+        otg-gp-pins {
+            samsung,pins = "gpx3-3";
+            samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
+            samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+            samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+            samsung,pin-val = <0>;
+        };
+    };
+
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/pinctrl/samsung.h>
+
+    pinctrl@10580000 {
+        compatible = "samsung,exynos5433-pinctrl";
+        reg = <0x10580000 0x1a20>, <0x11090000 0x100>;
+
+        pinctrl-names = "default";
+        pinctrl-0 = <&initial_alive>;
+
+        wakeup-interrupt-controller {
+            compatible = "samsung,exynos7-wakeup-eint";
+            interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
+        };
+
+        /* Pin bank with external direct wake-up interrupts */
+        gpa0-gpio-bank {
+            gpio-controller;
+            #gpio-cells = <2>;
+
+            interrupt-controller;
+            interrupt-parent = <&gic>;
+            interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
+            #interrupt-cells = <2>;
+        };
+
+        // ...
+
+        te-irq-pins {
+            samsung,pins = "gpf1-3";
+            samsung,pin-function = <0xf>;
+        };
+
+        // ..
+
+        initial_alive: initial-state {
+            gpa0-0-pin {
+                samsung,pins = "gpa0-0";
+                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
+                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
+            };
+
+            // ...
+        };
+    };
+
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/pinctrl/samsung.h>
+
+    pinctrl@114b0000 {
+        compatible = "samsung,exynos5433-pinctrl";
+        reg = <0x114b0000 0x1000>;
+        interrupts = <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>;
+        power-domains = <&pd_aud>;
+
+        /* Pin bank with external GPIO or muxed external wake-up interrupts */
+        gpz0-gpio-bank {
+            gpio-controller;
+            #gpio-cells = <2>;
+            interrupt-controller;
+            #interrupt-cells = <2>;
+        };
+
+        // ...
+
+        i2s0-bus-pins {
+            samsung,pins = "gpz0-0", "gpz0-1", "gpz0-2", "gpz0-3",
+                           "gpz0-4", "gpz0-5", "gpz0-6";
+            samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+            samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+            samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
+        };
+
+        // ...
+    };
diff --git a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt
deleted file mode 100644 (file)
index 9e70edc..0000000
+++ /dev/null
@@ -1,383 +0,0 @@
-Samsung GPIO and Pin Mux/Config controller
-
-Samsung's ARM based SoC's integrates a GPIO and Pin mux/config hardware
-controller. It controls the input/output settings on the available pads/pins
-and also provides ability to multiplex and configure the output of various
-on-chip controllers onto these pads.
-
-Required Properties:
-- compatible: should be one of the following.
-  - "samsung,s3c2412-pinctrl": for S3C2412-compatible pin-controller,
-  - "samsung,s3c2416-pinctrl": for S3C2416-compatible pin-controller,
-  - "samsung,s3c2440-pinctrl": for S3C2440-compatible pin-controller,
-  - "samsung,s3c2450-pinctrl": for S3C2450-compatible pin-controller,
-  - "samsung,s3c64xx-pinctrl": for S3C64xx-compatible pin-controller,
-  - "samsung,s5pv210-pinctrl": for S5PV210-compatible pin-controller,
-  - "samsung,exynos3250-pinctrl": for Exynos3250 compatible pin-controller.
-  - "samsung,exynos4210-pinctrl": for Exynos4210 compatible pin-controller.
-  - "samsung,exynos4x12-pinctrl": for Exynos4x12 compatible pin-controller.
-  - "samsung,exynos5250-pinctrl": for Exynos5250 compatible pin-controller.
-  - "samsung,exynos5260-pinctrl": for Exynos5260 compatible pin-controller.
-  - "samsung,exynos5410-pinctrl": for Exynos5410 compatible pin-controller.
-  - "samsung,exynos5420-pinctrl": for Exynos5420 compatible pin-controller.
-  - "samsung,exynos5433-pinctrl": for Exynos5433 compatible pin-controller.
-  - "samsung,exynos7-pinctrl": for Exynos7 compatible pin-controller.
-  - "samsung,exynos7885-pinctrl": for Exynos7885 compatible pin-controller.
-  - "samsung,exynos850-pinctrl": for Exynos850 compatible pin-controller.
-  - "samsung,exynosautov9-pinctrl": for ExynosAutov9 compatible pin-controller.
-
-- reg: Base address of the pin controller hardware module and length of
-  the address space it occupies.
-
-  - reg: Second base address of the pin controller if the specific registers
-  of the pin controller are separated into the different base address.
-
-       Eg: GPF[1-5] of Exynos5433 are separated into the two base address.
-       - First base address is for GPAx and GPF[1-5] external interrupt
-         registers.
-       - Second base address is for GPF[1-5] pinctrl registers.
-
-       pinctrl_0: pinctrl@10580000 {
-               compatible = "samsung,exynos5433-pinctrl";
-               reg = <0x10580000 0x1a20>, <0x11090000 0x100>;
-
-               wakeup-interrupt-controller {
-                       compatible = "samsung,exynos7-wakeup-eint";
-                       interrupts = <0 16 0>;
-               };
-       };
-
-- Pin banks as child nodes: Pin banks of the controller are represented by child
-  nodes of the controller node. Bank name is taken from name of the node. Each
-  bank node must contain following properties:
-
-  - gpio-controller: identifies the node as a gpio controller and pin bank.
-  - #gpio-cells: number of cells in GPIO specifier. Since the generic GPIO
-    binding is used, the amount of cells must be specified as 2. See the below
-    mentioned gpio binding representation for description of particular cells.
-
-       Eg: <&gpx2 6 0>
-       <[phandle of the gpio controller node]
-       [pin number within the gpio controller]
-       [flags]>
-
-       Values for gpio specifier:
-       - Pin number: is a value between 0 to 7.
-       - Flags: 0 - Active High
-                1 - Active Low
-
-- Pin mux/config groups as child nodes: The pin mux (selecting pin function
-  mode) and pin config (pull up/down, driver strength) settings are represented
-  as child nodes of the pin-controller node. There should be at least one
-  child node and there is no limit on the count of these child nodes. It is
-  also possible for a child node to consist of several further child nodes
-  to allow grouping multiple pinctrl groups into one. The format of second
-  level child nodes is exactly the same as for first level ones and is
-  described below.
-
-  The child node should contain a list of pin(s) on which a particular pin
-  function selection or pin configuration (or both) have to applied. This
-  list of pins is specified using the property name "samsung,pins". There
-  should be at least one pin specified for this property and there is no upper
-  limit on the count of pins that can be specified. The pins are specified
-  using pin names which are derived from the hardware manual of the SoC. As
-  an example, the pins in GPA0 bank of the pin controller can be represented
-  as "gpa0-0", "gpa0-1", "gpa0-2" and so on. The names should be in lower case.
-  The format of the pin names should be (as per the hardware manual)
-  "[pin bank name]-[pin number within the bank]".
-
-  The pin function selection that should be applied on the pins listed in the
-  child node is specified using the "samsung,pin-function" property. The value
-  of this property that should be applied to each of the pins listed in the
-  "samsung,pins" property should be picked from the hardware manual of the SoC
-  for the specified pin group. This property is optional in the child node if
-  no specific function selection is desired for the pins listed in the child
-  node. The value of this property is used as-is to program the pin-controller
-  function selector register of the pin-bank.
-
-  The child node can also optionally specify one or more of the pin
-  configuration that should be applied on all the pins listed in the
-  "samsung,pins" property of the child node. The following pin configuration
-  properties are supported.
-
-  - samsung,pin-val: Initial value of pin output buffer.
-  - samsung,pin-pud: Pull up/down configuration.
-  - samsung,pin-drv: Drive strength configuration.
-  - samsung,pin-pud-pdn: Pull up/down configuration in power down mode.
-  - samsung,pin-drv-pdn: Drive strength configuration in power down mode.
-
-  The values specified by these config properties should be derived from the
-  hardware manual and these values are programmed as-is into the pin
-  pull up/down and driver strength register of the pin-controller.
-
-  Note: A child should include at least a pin function selection property or
-  pin configuration property (one or more) or both.
-
-  The client nodes that require a particular pin function selection and/or
-  pin configuration should use the bindings listed in the "pinctrl-bindings.txt"
-  file.
-
-External GPIO and Wakeup Interrupts:
-
-The controller supports two types of external interrupts over gpio. The first
-is the external gpio interrupt and second is the external wakeup interrupts.
-The difference between the two is that the external wakeup interrupts can be
-used as system wakeup events.
-
-A. External GPIO Interrupts: For supporting external gpio interrupts, the
-   following properties should be specified in the pin-controller device node.
-
-   - interrupts: interrupt specifier for the controller. The format and value of
-     the interrupt specifier depends on the interrupt parent for the controller.
-
-   In addition, following properties must be present in node of every bank
-   of pins supporting GPIO interrupts:
-
-   - interrupt-controller: identifies the controller node as interrupt-parent.
-   - #interrupt-cells: the value of this property should be 2.
-     - First Cell: represents the external gpio interrupt number local to the
-       external gpio interrupt space of the controller.
-     - Second Cell: flags to identify the type of the interrupt
-       - 1 = rising edge triggered
-       - 2 = falling edge triggered
-       - 3 = rising and falling edge triggered
-       - 4 = high level triggered
-       - 8 = low level triggered
-
-B. External Wakeup Interrupts: For supporting external wakeup interrupts, a
-   child node representing the external wakeup interrupt controller should be
-   included in the pin-controller device node.
-
-   Only one pin-controller device node can include external wakeup interrupts
-   child node (in other words, only one External Wakeup Interrupts
-   pin-controller is supported).
-
-   This child node should include following properties:
-
-   - compatible: identifies the type of the external wakeup interrupt controller
-     The possible values are:
-     - samsung,s3c2410-wakeup-eint: represents wakeup interrupt controller
-       found on Samsung S3C24xx SoCs except S3C2412 and S3C2413,
-     - samsung,s3c2412-wakeup-eint: represents wakeup interrupt controller
-       found on Samsung S3C2412 and S3C2413 SoCs,
-     - samsung,s3c64xx-wakeup-eint: represents wakeup interrupt controller
-       found on Samsung S3C64xx SoCs,
-     - samsung,s5pv210-wakeup-eint: represents wakeup interrupt controller
-       found on Samsung S5Pv210 SoCs,
-     - samsung,exynos4210-wakeup-eint: represents wakeup interrupt controller
-       found on Samsung Exynos4210 and S5PC110/S5PV210 SoCs.
-     - samsung,exynos7-wakeup-eint: represents wakeup interrupt controller
-       found on Samsung Exynos7 SoC.
-   - interrupts: interrupt used by multiplexed wakeup interrupts.
-
-   In addition, following properties must be present in node of every bank
-   of pins supporting wake-up interrupts:
-
-   - interrupt-controller: identifies the node as interrupt-parent.
-   - #interrupt-cells: the value of this property should be 2
-     - First Cell: represents the external wakeup interrupt number local to
-       the external wakeup interrupt space of the controller.
-     - Second Cell: flags to identify the type of the interrupt
-       - 1 = rising edge triggered
-       - 2 = falling edge triggered
-       - 3 = rising and falling edge triggered
-       - 4 = high level triggered
-       - 8 = low level triggered
-
-   Node of every bank of pins supporting direct wake-up interrupts (without
-   multiplexing) must contain following properties:
-
-   - interrupts: interrupts of the interrupt parent which are used for external
-     wakeup interrupts from pins of the bank, must contain interrupts for all
-     pins of the bank.
-
-Aliases:
-
-All the pin controller nodes should be represented in the aliases node using
-the following format 'pinctrl{n}' where n is a unique number for the alias.
-
-Aliases for controllers compatible with "samsung,exynos7-pinctrl":
-- pinctrl0: pin controller of ALIVE block,
-- pinctrl1: pin controller of BUS0 block,
-- pinctrl2: pin controller of NFC block,
-- pinctrl3: pin controller of TOUCH block,
-- pinctrl4: pin controller of FF block,
-- pinctrl5: pin controller of ESE block,
-- pinctrl6: pin controller of FSYS0 block,
-- pinctrl7: pin controller of FSYS1 block,
-- pinctrl8: pin controller of BUS1 block,
-- pinctrl9: pin controller of AUDIO block,
-
-Example: A pin-controller node with pin banks:
-
-       pinctrl_0: pinctrl@11400000 {
-               compatible = "samsung,exynos4210-pinctrl";
-               reg = <0x11400000 0x1000>;
-               interrupts = <0 47 0>;
-
-               /* ... */
-
-               /* Pin bank without external interrupts */
-               gpy0: gpy0 {
-                       gpio-controller;
-                       #gpio-cells = <2>;
-               };
-
-               /* ... */
-
-               /* Pin bank with external GPIO or muxed wake-up interrupts */
-               gpj0: gpj0 {
-                       gpio-controller;
-                       #gpio-cells = <2>;
-
-                       interrupt-controller;
-                       #interrupt-cells = <2>;
-               };
-
-               /* ... */
-
-               /* Pin bank with external direct wake-up interrupts */
-               gpx0: gpx0 {
-                       gpio-controller;
-                       #gpio-cells = <2>;
-
-                       interrupt-controller;
-                       interrupt-parent = <&gic>;
-                       interrupts = <0 16 0>, <0 17 0>, <0 18 0>, <0 19 0>,
-                                    <0 20 0>, <0 21 0>, <0 22 0>, <0 23 0>;
-                       #interrupt-cells = <2>;
-               };
-
-               /* ... */
-       };
-
-Example 1: A pin-controller node with pin groups.
-
-       #include <dt-bindings/pinctrl/samsung.h>
-
-       pinctrl_0: pinctrl@11400000 {
-               compatible = "samsung,exynos4210-pinctrl";
-               reg = <0x11400000 0x1000>;
-               interrupts = <0 47 0>;
-
-               /* ... */
-
-               uart0_data: uart0-data {
-                       samsung,pins = "gpa0-0", "gpa0-1";
-                       samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
-                       samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
-                       samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
-               };
-
-               uart0_fctl: uart0-fctl {
-                       samsung,pins = "gpa0-2", "gpa0-3";
-                       samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
-                       samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
-                       samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
-               };
-
-               uart1_data: uart1-data {
-                       samsung,pins = "gpa0-4", "gpa0-5";
-                       samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
-                       samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
-                       samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
-               };
-
-               uart1_fctl: uart1-fctl {
-                       samsung,pins = "gpa0-6", "gpa0-7";
-                       samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
-                       samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
-                       samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
-               };
-
-               i2c2_bus: i2c2-bus {
-                       samsung,pins = "gpa0-6", "gpa0-7";
-                       samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
-                       samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
-                       samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
-               };
-
-               sd4_bus8: sd4-bus-width8 {
-                       part-1 {
-                               samsung,pins = "gpk0-3", "gpk0-4",
-                                               "gpk0-5", "gpk0-6";
-                               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
-                               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
-                               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
-                       };
-                       part-2 {
-                               samsung,pins = "gpk1-3", "gpk1-4",
-                                               "gpk1-5", "gpk1-6";
-                               samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
-                               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
-                               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
-                       };
-               };
-       };
-
-Example 2: A pin-controller node with external wakeup interrupt controller node.
-
-       pinctrl_1: pinctrl@11000000 {
-               compatible = "samsung,exynos4210-pinctrl";
-               reg = <0x11000000 0x1000>;
-               interrupts = <0 46 0>
-
-               /* ... */
-
-               wakeup-interrupt-controller {
-                       compatible = "samsung,exynos4210-wakeup-eint";
-                       interrupt-parent = <&gic>;
-                       interrupts = <0 32 0>;
-               };
-       };
-
-Example 3: A uart client node that supports 'default' and 'flow-control' states.
-
-       uart@13800000 {
-               compatible = "samsung,exynos4210-uart";
-               reg = <0x13800000 0x100>;
-               interrupts = <0 52 0>;
-               pinctrl-names = "default", "flow-control;
-               pinctrl-0 = <&uart0_data>;
-               pinctrl-1 = <&uart0_data>, <&uart0_fctl>;
-       };
-
-Example 4: Set up the default pin state for uart controller.
-
-       static int s3c24xx_serial_probe(struct platform_device *pdev) {
-               struct pinctrl *pinctrl;
-
-               /* ... */
-
-               pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
-       }
-
-Example 5: A display port client node that supports 'default' pinctrl state
-          and gpio binding.
-
-       display-port-controller {
-               /* ... */
-
-               samsung,hpd-gpio = <&gpx2 6 0>;
-               pinctrl-names = "default";
-               pinctrl-0 = <&dp_hpd>;
-       };
-
-Example 6: Request the gpio for display port controller
-
-       static int exynos_dp_probe(struct platform_device *pdev)
-       {
-               int hpd_gpio, ret;
-               struct device *dev = &pdev->dev;
-               struct device_node *dp_node = dev->of_node;
-
-               /* ... */
-
-               hpd_gpio = of_get_named_gpio(dp_node, "samsung,hpd-gpio", 0);
-
-               /* ... */
-
-               ret = devm_gpio_request_one(&pdev->dev, hpd_gpio, GPIOF_IN,
-                                           "hpd_gpio");
-               /* ... */
-       }
index 01bdda1..747622b 100644 (file)
@@ -28,6 +28,7 @@ properties:
       - fsl,imx8mn-gpc
       - fsl,imx8mq-gpc
       - fsl,imx8mm-gpc
+      - fsl,imx8mp-gpc
 
   reg:
     maxItems: 1
@@ -57,6 +58,7 @@ properties:
               include/dt-bindings/power/imx7-power.h for fsl,imx7d-gpc and
               include/dt-bindings/power/imx8m-power.h for fsl,imx8mq-gpc
               include/dt-bindings/power/imx8mm-power.h for fsl,imx8mm-gpc
+              include/dt-bindings/power/imx8mp-power.h for fsl,imx8mp-gpc
             maxItems: 1
 
           clocks:
index 84ddc77..bb433e7 100644 (file)
@@ -4,14 +4,14 @@
 $id: "http://devicetree.org/schemas/power/renesas,rzg2l-sysc.yaml#"
 $schema: "http://devicetree.org/meta-schemas/core.yaml#"
 
-title: Renesas RZ/G2L System Controller (SYSC)
+title: Renesas RZ/{G2L,V2L} System Controller (SYSC)
 
 maintainers:
   - Geert Uytterhoeven <geert+renesas@glider.be>
 
 description:
-  The RZ/G2L System Controller (SYSC) performs system control of the LSI and
-  supports following functions,
+  The RZ/{G2L,V2L} System Controller (SYSC) performs system control of the LSI
+  and supports following functions,
   - External terminal state capture function
   - 34-bit address space access function
   - Low power consumption control
@@ -21,6 +21,7 @@ properties:
   compatible:
     enum:
       - renesas,r9a07g044-sysc # RZ/G2{L,LC}
+      - renesas,r9a07g054-sysc # RZ/V2L
 
   reg:
     maxItems: 1
diff --git a/Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-hsio-blk-ctrl.yaml b/Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-hsio-blk-ctrl.yaml
new file mode 100644 (file)
index 0000000..c1e29d9
--- /dev/null
@@ -0,0 +1,78 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/imx/fsl,imx8mp-hsio-blk-ctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP i.MX8MP HSIO blk-ctrl
+
+maintainers:
+  - Lucas Stach <l.stach@pengutronix.de>
+
+description:
+  The i.MX8MP HSIO blk-ctrl is a top-level peripheral providing access to
+  the NoC and ensuring proper power sequencing of the high-speed IO
+  (USB an PCIe) peripherals located in the HSIO domain of the SoC.
+
+properties:
+  compatible:
+    items:
+      - const: fsl,imx8mp-hsio-blk-ctrl
+      - const: syscon
+
+  reg:
+    maxItems: 1
+
+  '#power-domain-cells':
+    const: 1
+
+  power-domains:
+    minItems: 6
+    maxItems: 6
+
+  power-domain-names:
+    items:
+      - const: bus
+      - const: usb
+      - const: usb-phy1
+      - const: usb-phy2
+      - const: pcie
+      - const: pcie-phy
+
+  clocks:
+    minItems: 2
+    maxItems: 2
+
+  clock-names:
+    items:
+      - const: usb
+      - const: pcie
+
+required:
+  - compatible
+  - reg
+  - power-domains
+  - power-domain-names
+  - clocks
+  - clock-names
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/imx8mp-clock.h>
+    #include <dt-bindings/power/imx8mp-power.h>
+
+    hsio_blk_ctrl: blk-ctrl@32f10000 {
+        compatible = "fsl,imx8mp-hsio-blk-ctrl", "syscon";
+        reg = <0x32f10000 0x24>;
+        clocks = <&clk IMX8MP_CLK_USB_ROOT>,
+                 <&clk IMX8MP_CLK_PCIE_ROOT>;
+        clock-names = "usb", "pcie";
+        power-domains = <&pgc_hsiomix>, <&pgc_hsiomix>,
+                        <&pgc_usb1_phy>, <&pgc_usb2_phy>,
+                        <&pgc_hsiomix>, <&pgc_pcie_phy>;
+        power-domain-names = "bus", "usb", "usb-phy1",
+                             "usb-phy2", "pcie", "pcie-phy";
+        #power-domain-cells = <1>;
+    };
diff --git a/Documentation/devicetree/bindings/soc/imx/fsl,imx8mq-vpu-blk-ctrl.yaml b/Documentation/devicetree/bindings/soc/imx/fsl,imx8mq-vpu-blk-ctrl.yaml
new file mode 100644 (file)
index 0000000..7263ebe
--- /dev/null
@@ -0,0 +1,71 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/imx/fsl,imx8mq-vpu-blk-ctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP i.MX8MQ VPU blk-ctrl
+
+maintainers:
+  - Lucas Stach <l.stach@pengutronix.de>
+
+description:
+  The i.MX8MQ VPU blk-ctrl is a top-level peripheral providing access to
+  the NoC and ensuring proper power sequencing of the VPU peripherals
+  located in the VPU domain of the SoC.
+
+properties:
+  compatible:
+    items:
+      - const: fsl,imx8mq-vpu-blk-ctrl
+
+  reg:
+    maxItems: 1
+
+  '#power-domain-cells':
+    const: 1
+
+  power-domains:
+    minItems: 3
+    maxItems: 3
+
+  power-domain-names:
+    items:
+      - const: bus
+      - const: g1
+      - const: g2
+
+  clocks:
+    minItems: 2
+    maxItems: 2
+
+  clock-names:
+    items:
+      - const: g1
+      - const: g2
+
+required:
+  - compatible
+  - reg
+  - power-domains
+  - power-domain-names
+  - clocks
+  - clock-names
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/imx8mq-clock.h>
+    #include <dt-bindings/power/imx8mq-power.h>
+
+    vpu_blk_ctrl: blk-ctrl@38320000 {
+      compatible = "fsl,imx8mq-vpu-blk-ctrl";
+      reg = <0x38320000 0x100>;
+      power-domains = <&pgc_vpu>, <&pgc_vpu>, <&pgc_vpu>;
+      power-domain-names = "bus", "g1", "g2";
+      clocks = <&clk IMX8MQ_CLK_VPU_G1_ROOT>,
+               <&clk IMX8MQ_CLK_VPU_G2_ROOT>;
+      clock-names = "g1", "g2";
+      #power-domain-cells = <1>;
+    };
index dfebf42..b2ba7be 100644 (file)
@@ -15,6 +15,7 @@ properties:
       - items:
           - enum:
               - rockchip,rk3288-sgrf
+              - rockchip,rk3568-usb2phy-grf
               - rockchip,rv1108-usbgrf
           - const: syscon
       - items:
index 2c913aa..12c31b4 100644 (file)
@@ -23,6 +23,7 @@ properties:
       - const: nvidia,tegra30-hda
       - items:
           - enum:
+              - nvidia,tegra234-hda
               - nvidia,tegra194-hda
               - nvidia,tegra186-hda
               - nvidia,tegra210-hda
@@ -41,9 +42,11 @@ properties:
     maxItems: 1
 
   clocks:
+    minItems: 2
     maxItems: 3
 
   clock-names:
+    minItems: 2
     items:
       - const: hda
       - const: hda2hdmi
index 5dd2092..3ec2d7b 100644 (file)
@@ -23,8 +23,9 @@ properties:
     minItems: 1
     maxItems: 256
     items:
-      minimum: 0
-      maximum: 256
+      items:
+        - minimum: 0
+          maximum: 256
     description:
       Chip select used by the device.
 
index e5c57d6..fbd76a8 100644 (file)
@@ -12,6 +12,7 @@ Required properties:
        For those SoCs that use GPT
        * "mediatek,mt2701-timer" for MT2701 compatible timers (GPT)
        * "mediatek,mt6580-timer" for MT6580 compatible timers (GPT)
+       * "mediatek,mt6582-timer" for MT6582 compatible timers (GPT)
        * "mediatek,mt6589-timer" for MT6589 compatible timers (GPT)
        * "mediatek,mt7623-timer" for MT7623 compatible timers (GPT)
        * "mediatek,mt8127-timer" for MT8127 compatible timers (GPT)
index dececb6..32c374d 100644 (file)
@@ -23,6 +23,8 @@ patternProperties:
   "^(simple-audio-card|st-plgpio|st-spics|ts),.*": true
 
   # Keep list in alphabetical order.
+  "^100ask,.*":
+    description: Baiwen.com (100ask).
   "^70mai,.*":
     description: 70mai Co., Ltd.
   "^8dev,.*":
@@ -61,6 +63,8 @@ patternProperties:
     description: Aeroflex Gaisler AB
   "^aesop,.*":
     description: AESOP Embedded Forum
+  "^airoha,.*":
+    description: Airoha
   "^al,.*":
     description: Annapurna Labs
   "^alcatel,.*":
@@ -285,6 +289,8 @@ patternProperties:
     description: CUI Devices
   "^cypress,.*":
     description: Cypress Semiconductor Corporation
+  "^cyx,.*":
+    description: Shenzhen CYX Industrial Co., Ltd
   "^cznic,.*":
     description: CZ.NIC, z.s.p.o.
   "^dallas,.*":
@@ -491,6 +497,8 @@ patternProperties:
     deprecated: true
   "^hannstar,.*":
     description: HannStar Display Corporation
+  "^haochuangyi,.*":
+    description: Shenzhen Haochuangyi Technology Co.,Ltd
   "^haoyu,.*":
     description: Haoyu Microelectronic Co. Ltd.
   "^hardkernel,.*":
@@ -771,6 +779,8 @@ patternProperties:
     description: MiraMEMS Sensing Technology Co., Ltd.
   "^mitsubishi,.*":
     description: Mitsubishi Electric Corporation
+  "^miyoo,.*":
+    description: Miyoo
   "^mntre,.*":
     description: MNT Research GmbH
   "^modtronix,.*":
@@ -894,6 +904,8 @@ patternProperties:
     description: Ortus Technology Co., Ltd.
   "^osddisplays,.*":
     description: OSD Displays
+  "^osmc,.*":
+    description: Sam Nazarko Trading Ltd. (Open Source Media Centre)
   "^ouya,.*":
     description: Ouya Inc.
   "^overkiz,.*":
@@ -1207,6 +1219,8 @@ patternProperties:
     description: Shenzhen Techstar Electronics Co., Ltd.
   "^terasic,.*":
     description: Terasic Inc.
+  "^tesla,.*":
+    description: Tesla, Inc.
   "^tfc,.*":
     description: Three Five Corp
   "^thead,.*":
@@ -1350,6 +1364,8 @@ patternProperties:
     description: WinLink Co., Ltd
   "^winstar,.*":
     description: Winstar Display Corp.
+  "^wirelesstag,.*":
+    description: Wireless Tag (qiming yunduan)
   "^wits,.*":
     description: Shenzhen Merrii Technology Co., Ltd. (WITS)
   "^wlf,.*":
index 0114871..a97418c 100644 (file)
@@ -8,6 +8,7 @@ Required properties:
 - compatible should contain:
        "mediatek,mt2701-wdt", "mediatek,mt6589-wdt": for MT2701
        "mediatek,mt2712-wdt": for MT2712
+       "mediatek,mt6582-wdt", "mediatek,mt6589-wdt": for MT6582
        "mediatek,mt6589-wdt": for MT6589
        "mediatek,mt6797-wdt", "mediatek,mt6589-wdt": for MT6797
        "mediatek,mt7622-wdt", "mediatek,mt6589-wdt": for MT7622
index 136f8da..4f373a8 100644 (file)
@@ -462,6 +462,10 @@ operation table looks like the following::
                             struct iov_iter *iter,
                             netfs_io_terminated_t term_func,
                             void *term_func_priv);
+
+               int (*query_occupancy)(struct netfs_cache_resources *cres,
+                                      loff_t start, size_t len, size_t granularity,
+                                      loff_t *_data_start, size_t *_data_len);
        };
 
 With a termination handler function pointer::
@@ -536,6 +540,18 @@ The methods defined in the table are:
    indicating whether the termination is definitely happening in the caller's
    context.
 
+ * ``query_occupancy()``
+
+   [Required] Called to find out where the next piece of data is within a
+   particular region of the cache.  The start and length of the region to be
+   queried are passed in, along with the granularity to which the answer needs
+   to be aligned.  The function passes back the start and length of the data,
+   if any, available within that region.  Note that there may be a hole at the
+   front.
+
+   It returns 0 if some data was found, -ENODATA if there was no usable data
+   within the region or -ENOBUFS if there is no caching on this file.
+
 Note that these methods are passed a pointer to the cache resource structure,
 not the read request structure as they could be used in other situations where
 there isn't a read request structure as well, such as writing dirty data to the
index da138dd..a1212b5 100644 (file)
@@ -300,30 +300,6 @@ Contact: Daniel Vetter, Noralf Tronnes
 
 Level: Advanced
 
-Garbage collect fbdev scrolling acceleration
---------------------------------------------
-
-Scroll acceleration has been disabled in fbcon. Now it works as the old
-SCROLL_REDRAW mode. A ton of code was removed in fbcon.c and the hook bmove was
-removed from fbcon_ops.
-Remaining tasks:
-
-- a bunch of the hooks in fbcon_ops could be removed or simplified by calling
-  directly instead of the function table (with a switch on p->rotate)
-
-- fb_copyarea is unused after this, and can be deleted from all drivers
-
-- after that, fb_copyarea can be deleted from fb_ops in include/linux/fb.h as
-  well as cfb_copyarea
-
-Note that not all acceleration code can be deleted, since clearing and cursor
-support is still accelerated, which might be good candidates for further
-deletion projects.
-
-Contact: Daniel Vetter
-
-Level: Intermediate
-
 idr_init_base()
 ---------------
 
index 2b4de39..b58692d 100644 (file)
@@ -166,6 +166,7 @@ to ReStructured Text format, or are simply too old.
 .. toctree::
    :maxdepth: 2
 
+   tools/index
    staging/index
    watch_queue
 
index e6cd406..4cbd50e 100644 (file)
@@ -295,7 +295,7 @@ Pete Zaitcev gives the following summary:
 
 -  If you are in a process context (any syscall) and want to lock other
    process out, use a mutex. You can take a mutex and sleep
-   (``copy_from_user*(`` or ``kmalloc(x,GFP_KERNEL)``).
+   (``copy_from_user()`` or ``kmalloc(x,GFP_KERNEL)``).
 
 -  Otherwise (== data can be touched in an interrupt), use
    spin_lock_irqsave() and
diff --git a/Documentation/tools/index.rst b/Documentation/tools/index.rst
new file mode 100644 (file)
index 0000000..0bb1e61
--- /dev/null
@@ -0,0 +1,20 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+============
+Kernel tools
+============
+
+This book covers user-space tools that are shipped with the kernel source;
+more additions are needed here:
+
+.. toctree::
+   :maxdepth: 1
+
+   rtla/index
+
+.. only::  subproject and html
+
+   Indices
+   =======
+
+   * :ref:`genindex`
diff --git a/Documentation/tools/rtla/index.rst b/Documentation/tools/rtla/index.rst
new file mode 100644 (file)
index 0000000..840f0bf
--- /dev/null
@@ -0,0 +1,26 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+================================
+The realtime Linux analysis tool
+================================
+
+RTLA provides a set of tools for the analysis of the kernel's realtime
+behavior on specific hardware.
+
+.. toctree::
+   :maxdepth: 1
+
+   rtla
+   rtla-osnoise
+   rtla-osnoise-hist
+   rtla-osnoise-top
+   rtla-timerlat
+   rtla-timerlat-hist
+   rtla-timerlat-top
+
+.. only::  subproject and html
+
+   Indices
+   =======
+
+   * :ref:`genindex`
index 687efcf..e6fce2c 100644 (file)
@@ -115,6 +115,7 @@ Code  Seq#    Include File                                           Comments
 'B'   00-1F  linux/cciss_ioctl.h                                     conflict!
 'B'   00-0F  include/linux/pmu.h                                     conflict!
 'B'   C0-FF  advanced bbus                                           <mailto:maassen@uni-freiburg.de>
+'B'   00-0F  xen/xenbus_dev.h                                        conflict!
 'C'   all    linux/soundcard.h                                       conflict!
 'C'   01-2F  linux/capi.h                                            conflict!
 'C'   F0-FF  drivers/net/wan/cosa.h                                  conflict!
@@ -134,6 +135,7 @@ Code  Seq#    Include File                                           Comments
 'F'   80-8F  linux/arcfb.h                                           conflict!
 'F'   DD     video/sstfb.h                                           conflict!
 'G'   00-3F  drivers/misc/sgi-gru/grulib.h                           conflict!
+'G'   00-0F  xen/gntalloc.h, xen/gntdev.h                            conflict!
 'H'   00-7F  linux/hiddev.h                                          conflict!
 'H'   00-0F  linux/hidraw.h                                          conflict!
 'H'   01     linux/mei.h                                             conflict!
@@ -176,6 +178,7 @@ Code  Seq#    Include File                                           Comments
 'P'   60-6F  sound/sscape_ioctl.h                                    conflict!
 'P'   00-0F  drivers/usb/class/usblp.c                               conflict!
 'P'   01-09  drivers/misc/pci_endpoint_test.c                        conflict!
+'P'   00-0F  xen/privcmd.h                                           conflict!
 'Q'   all    linux/soundcard.h
 'R'   00-1F  linux/random.h                                          conflict!
 'R'   01     linux/rfkill.h                                          conflict!
index bb8cfdd..a426710 100644 (file)
@@ -3268,6 +3268,7 @@ number.
 
 :Capability: KVM_CAP_DEVICE_CTRL, KVM_CAP_VM_ATTRIBUTES for vm device,
              KVM_CAP_VCPU_ATTRIBUTES for vcpu device
+             KVM_CAP_SYS_ATTRIBUTES for system (/dev/kvm) device (no set)
 :Type: device ioctl, vm ioctl, vcpu ioctl
 :Parameters: struct kvm_device_attr
 :Returns: 0 on success, -1 on error
@@ -3302,7 +3303,8 @@ transferred is defined by the particular attribute.
 ------------------------
 
 :Capability: KVM_CAP_DEVICE_CTRL, KVM_CAP_VM_ATTRIBUTES for vm device,
-            KVM_CAP_VCPU_ATTRIBUTES for vcpu device
+             KVM_CAP_VCPU_ATTRIBUTES for vcpu device
+             KVM_CAP_SYS_ATTRIBUTES for system (/dev/kvm) device
 :Type: device ioctl, vm ioctl, vcpu ioctl
 :Parameters: struct kvm_device_attr
 :Returns: 0 on success, -1 on error
index 81f521f..1a09472 100644 (file)
@@ -9,7 +9,7 @@ Page Table Check
 Introduction
 ============
 
-Page table check allows to hardern the kernel by ensuring that some types of
+Page table check allows to harden the kernel by ensuring that some types of
 the memory corruptions are prevented.
 
 Page table check performs extra verifications at the time when new pages become
index ea3e6c9..e643bab 100644 (file)
@@ -190,8 +190,9 @@ M:  Johannes Berg <johannes@sipsolutions.net>
 L:     linux-wireless@vger.kernel.org
 S:     Maintained
 W:     https://wireless.wiki.kernel.org/
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git
+Q:     https://patchwork.kernel.org/project/linux-wireless/list/
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless.git
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git
 F:     Documentation/driver-api/80211/cfg80211.rst
 F:     Documentation/networking/regulatory.rst
 F:     include/linux/ieee80211.h
@@ -1684,9 +1685,9 @@ S:        Maintained
 F:     drivers/clk/sunxi/
 
 ARM/Allwinner sunXi SoC support
-M:     Maxime Ripard <mripard@kernel.org>
 M:     Chen-Yu Tsai <wens@csie.org>
-R:     Jernej Skrabec <jernej.skrabec@gmail.com>
+M:     Jernej Skrabec <jernej.skrabec@gmail.com>
+M:     Samuel Holland <samuel@sholland.org>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git
@@ -2363,6 +2364,7 @@ L:        openbmc@lists.ozlabs.org (moderated for non-subscribers)
 S:     Supported
 F:     Documentation/devicetree/bindings/*/*/*npcm*
 F:     Documentation/devicetree/bindings/*/*npcm*
+F:     Documentation/devicetree/bindings/arm/npcm/*
 F:     arch/arm/boot/dts/nuvoton-npcm*
 F:     arch/arm/mach-npcm/
 F:     drivers/*/*npcm*
@@ -2373,6 +2375,7 @@ ARM/NUVOTON WPCM450 ARCHITECTURE
 M:     Jonathan Neuschäfer <j.neuschaefer@gmx.net>
 L:     openbmc@lists.ozlabs.org (moderated for non-subscribers)
 S:     Maintained
+W:     https://github.com/neuschaefer/wpcm450/wiki
 F:     Documentation/devicetree/bindings/*/*wpcm*
 F:     arch/arm/boot/dts/nuvoton-wpcm450*
 F:     arch/arm/mach-npcm/wpcm450.c
@@ -2527,6 +2530,7 @@ M:        Magnus Damm <magnus.damm@gmail.com>
 L:     linux-renesas-soc@vger.kernel.org
 S:     Supported
 Q:     http://patchwork.kernel.org/project/linux-renesas-soc/list/
+C:     irc://irc.libera.chat/renesas-soc
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel.git next
 F:     Documentation/devicetree/bindings/arm/renesas.yaml
 F:     arch/arm64/boot/dts/renesas/
@@ -2640,6 +2644,7 @@ M:        Magnus Damm <magnus.damm@gmail.com>
 L:     linux-renesas-soc@vger.kernel.org
 S:     Supported
 Q:     http://patchwork.kernel.org/project/linux-renesas-soc/list/
+C:     irc://irc.libera.chat/renesas-soc
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel.git next
 F:     Documentation/devicetree/bindings/arm/renesas.yaml
 F:     arch/arm/boot/dts/emev2*
@@ -2753,6 +2758,14 @@ S:       Maintained
 F:     Documentation/devicetree/bindings/media/tegra-cec.txt
 F:     drivers/media/cec/platform/tegra/
 
+ARM/TESLA FSD SoC SUPPORT
+M:     Alim Akhtar <alim.akhtar@samsung.com>
+M:     linux-fsd@tesla.com
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+L:     linux-samsung-soc@vger.kernel.org
+S:     Maintained
+F:     arch/arm64/boot/dts/tesla*
+
 ARM/TETON BGA MACHINE SUPPORT
 M:     "Mark F. Brown" <mark.brown314@gmail.com>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@ -4156,9 +4169,8 @@ N:        csky
 K:     csky
 
 CA8210 IEEE-802.15.4 RADIO DRIVER
-M:     Harry Morris <h.morris@cascoda.com>
 L:     linux-wpan@vger.kernel.org
-S:     Maintained
+S:     Orphan
 W:     https://github.com/Cascoda/ca8210-linux.git
 F:     Documentation/devicetree/bindings/net/ieee802154/ca8210.txt
 F:     drivers/net/ieee802154/ca8210.c
@@ -7208,8 +7220,10 @@ F:       drivers/net/mdio/of_mdio.c
 F:     drivers/net/pcs/
 F:     drivers/net/phy/
 F:     include/dt-bindings/net/qca-ar803x.h
+F:     include/linux/linkmode.h
 F:     include/linux/*mdio*.h
 F:     include/linux/mdio/*.h
+F:     include/linux/mii.h
 F:     include/linux/of_net.h
 F:     include/linux/phy.h
 F:     include/linux/phy_fixed.h
@@ -10877,6 +10891,12 @@ T:     git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
 F:     drivers/ata/pata_arasan_cf.c
 F:     include/linux/pata_arasan_cf_data.h
 
+LIBATA PATA DRIVERS
+R:     Sergey Shtylyov <s.shtylyov@omp.ru>
+L:     linux-ide@vger.kernel.org
+F:     drivers/ata/ata_*.c
+F:     drivers/ata/pata_*.c
+
 LIBATA PATA FARADAY FTIDE010 AND GEMINI SATA BRIDGE DRIVERS
 M:     Linus Walleij <linus.walleij@linaro.org>
 L:     linux-ide@vger.kernel.org
@@ -11366,8 +11386,9 @@ M:      Johannes Berg <johannes@sipsolutions.net>
 L:     linux-wireless@vger.kernel.org
 S:     Maintained
 W:     https://wireless.wiki.kernel.org/
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git
+Q:     https://patchwork.kernel.org/project/linux-wireless/list/
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless.git
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git
 F:     Documentation/networking/mac80211-injection.rst
 F:     Documentation/networking/mac80211_hwsim/mac80211_hwsim.rst
 F:     drivers/net/wireless/mac80211_hwsim.[ch]
@@ -12396,7 +12417,7 @@ F:      include/uapi/linux/membarrier.h
 F:     kernel/sched/membarrier.c
 
 MEMBLOCK
-M:     Mike Rapoport <rppt@linux.ibm.com>
+M:     Mike Rapoport <rppt@kernel.org>
 L:     linux-mm@kvack.org
 S:     Maintained
 F:     Documentation/core-api/boot-time-mm.rst
@@ -13374,9 +13395,10 @@ NETWORKING DRIVERS (WIRELESS)
 M:     Kalle Valo <kvalo@kernel.org>
 L:     linux-wireless@vger.kernel.org
 S:     Maintained
-Q:     http://patchwork.kernel.org/project/linux-wireless/list/
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.git
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git
+W:     https://wireless.wiki.kernel.org/
+Q:     https://patchwork.kernel.org/project/linux-wireless/list/
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless.git
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git
 F:     Documentation/devicetree/bindings/net/wireless/
 F:     drivers/net/wireless/
 
@@ -13449,7 +13471,11 @@ L:     netdev@vger.kernel.org
 S:     Maintained
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
 F:     arch/x86/net/*
+F:     include/linux/ip.h
+F:     include/linux/ipv6*
+F:     include/net/fib*
 F:     include/net/ip*
+F:     include/net/route.h
 F:     net/ipv4/
 F:     net/ipv6/
 
@@ -13510,10 +13536,6 @@ F:     include/net/tls.h
 F:     include/uapi/linux/tls.h
 F:     net/tls/*
 
-NETWORKING [WIRELESS]
-L:     linux-wireless@vger.kernel.org
-Q:     http://patchwork.kernel.org/project/linux-wireless/list/
-
 NETXEN (1/10) GbE SUPPORT
 M:     Manish Chopra <manishc@marvell.com>
 M:     Rahul Verma <rahulv@marvell.com>
@@ -15285,7 +15307,7 @@ L:      linux-samsung-soc@vger.kernel.org
 S:     Maintained
 Q:     https://patchwork.kernel.org/project/linux-samsung-soc/list/
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/samsung.git
-F:     Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt
+F:     Documentation/devicetree/bindings/pinctrl/samsung,pinctrl*yaml
 F:     drivers/pinctrl/samsung/
 F:     include/dt-bindings/pinctrl/samsung.h
 
@@ -16464,6 +16486,14 @@ F:     Documentation/devicetree/bindings/i2c/renesas,rmobile-iic.yaml
 F:     drivers/i2c/busses/i2c-rcar.c
 F:     drivers/i2c/busses/i2c-sh_mobile.c
 
+RENESAS R-CAR SATA DRIVER
+R:     Sergey Shtylyov <s.shtylyov@omp.ru>
+S:     Supported
+L:     linux-ide@vger.kernel.org
+L:     linux-renesas-soc@vger.kernel.org
+F:     Documentation/devicetree/bindings/ata/renesas,rcar-sata.yaml
+F:     drivers/ata/sata_rcar.c
+
 RENESAS R-CAR THERMAL DRIVERS
 M:     Niklas Söderlund <niklas.soderlund@ragnatech.se>
 L:     linux-renesas-soc@vger.kernel.org
@@ -16532,8 +16562,9 @@ M:      Johannes Berg <johannes@sipsolutions.net>
 L:     linux-wireless@vger.kernel.org
 S:     Maintained
 W:     https://wireless.wiki.kernel.org/
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git
+Q:     https://patchwork.kernel.org/project/linux-wireless/list/
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless.git
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git
 F:     Documentation/ABI/stable/sysfs-class-rfkill
 F:     Documentation/driver-api/rfkill.rst
 F:     include/linux/rfkill.h
index 0fb4f94..ceb987e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@
 VERSION = 5
 PATCHLEVEL = 17
 SUBLEVEL = 0
-EXTRAVERSION = -rc1
+EXTRAVERSION = -rc3
 NAME = Gobble Gobble
 
 # *DOCUMENTATION*
index fabe391..160881d 100644 (file)
@@ -83,6 +83,7 @@ config ARM
        select HAVE_EBPF_JIT if !CPU_ENDIAN_BE32
        select HAVE_CONTEXT_TRACKING
        select HAVE_C_RECORDMCOUNT
+       select HAVE_BUILDTIME_MCOUNT_SORT
        select HAVE_DEBUG_KMEMLEAK if !XIP_KERNEL
        select HAVE_DMA_CONTIGUOUS if MMU
        select HAVE_DYNAMIC_FTRACE if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
@@ -572,6 +573,18 @@ config ARCH_VIRT
        select HAVE_ARM_ARCH_TIMER
        select ARCH_SUPPORTS_BIG_ENDIAN
 
+config ARCH_AIROHA
+       bool "Airoha SoC Support"
+       depends on ARCH_MULTI_V7
+       select ARM_AMBA
+       select ARM_GIC
+       select ARM_GIC_V3
+       select ARM_PSCI
+       select HAVE_ARM_ARCH_TIMER
+       select COMMON_CLK
+       help
+         Support for Airoha EN7523 SoCs
+
 #
 # This is sorted alphabetically by mach-* pathname.  However, plat-*
 # Kconfigs may be included either alphabetically (according to the
index 77172d5..34baf88 100644 (file)
@@ -160,6 +160,7 @@ textofs-$(CONFIG_ARCH_AXXIA) := 0x00308000
 # Machine directory name.  This list is sorted alphanumerically
 # by CONFIG_* macro name.
 machine-$(CONFIG_ARCH_ACTIONS)         += actions
+machine-$(CONFIG_ARCH_AIROHA)          += airoha
 machine-$(CONFIG_ARCH_ALPINE)          += alpine
 machine-$(CONFIG_ARCH_ARTPEC)          += artpec
 machine-$(CONFIG_ARCH_ASPEED)           += aspeed
index bc7b3aa..2f4a347 100644 (file)
@@ -187,6 +187,8 @@ dtb-$(CONFIG_ARCH_DAVINCI) += \
        da850-lego-ev3.dtb
 dtb-$(CONFIG_ARCH_DIGICOLOR) += \
        cx92755_equinox.dtb
+dtb-$(CONFIG_ARCH_AIROHA) += \
+       en7523-evb.dtb
 dtb-$(CONFIG_ARCH_EXYNOS3) += \
        exynos3250-artik5-eval.dtb \
        exynos3250-monk.dtb \
@@ -221,6 +223,8 @@ dtb-$(CONFIG_ARCH_EXYNOS5) += \
        exynos5420-arndale-octa.dtb \
        exynos5420-peach-pit.dtb \
        exynos5420-smdk5420.dtb \
+       exynos5420-chagall-wifi.dtb \
+       exynos5420-klimt-wifi.dtb \
        exynos5422-odroidhc1.dtb \
        exynos5422-odroidxu3.dtb \
        exynos5422-odroidxu3-lite.dtb \
@@ -269,7 +273,7 @@ dtb-$(CONFIG_ARCH_IXP4XX) += \
        intel-ixp42x-dlink-dsm-g600.dtb \
        intel-ixp42x-gateworks-gw2348.dtb \
        intel-ixp43x-gateworks-gw2358.dtb \
-       intel-ixp42x-netgear-wg302v2.dtb \
+       intel-ixp42x-netgear-wg302v1.dtb \
        intel-ixp42x-arcom-vulcan.dtb \
        intel-ixp42x-gateway-7001.dtb
 dtb-$(CONFIG_ARCH_KEYSTONE) += \
@@ -736,6 +740,8 @@ dtb-$(CONFIG_SOC_IMX7D) += \
 dtb-$(CONFIG_SOC_IMX7ULP) += \
        imx7ulp-com.dtb \
        imx7ulp-evk.dtb
+dtb-$(CONFIG_SOC_LAN966) += \
+       lan966x-pcb8291.dtb
 dtb-$(CONFIG_SOC_LS1021A) += \
        ls1021a-moxa-uc-8410a.dtb \
        ls1021a-qds.dtb \
@@ -895,6 +901,7 @@ dtb-$(CONFIG_SOC_AM33XX) += \
        am335x-regor-rdk.dtb \
        am335x-sancloud-bbe.dtb \
        am335x-sancloud-bbe-lite.dtb \
+       am335x-sancloud-bbe-extended-wifi.dtb \
        am335x-shc.dtb \
        am335x-sbc-t335.dtb \
        am335x-sl50.dtb \
@@ -1162,6 +1169,7 @@ dtb-$(CONFIG_ARCH_STM32) += \
        stm32mp157c-dhcom-picoitx.dtb \
        stm32mp157c-dk2.dtb \
        stm32mp157c-ed1.dtb \
+       stm32mp157c-emsbc-argon.dtb \
        stm32mp157c-ev1.dtb \
        stm32mp157c-lxa-mc1.dtb \
        stm32mp157c-odyssey.dtb
@@ -1229,6 +1237,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
        sun7i-a20-bananapro.dtb \
        sun7i-a20-cubieboard2.dtb \
        sun7i-a20-cubietruck.dtb \
+       sun7i-a20-haoyu-marsboard.dtb \
        sun7i-a20-hummingbird.dtb \
        sun7i-a20-itead-ibox.dtb \
        sun7i-a20-i12-tvbox.dtb \
@@ -1494,6 +1503,9 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
 dtb-$(CONFIG_ARCH_MILBEAUT) += milbeaut-m10v-evb.dtb
 dtb-$(CONFIG_ARCH_MSTARV7) += \
        mstar-infinity-msc313-breadbee_crust.dtb \
+       mstar-infinity2m-ssd202d-100ask-dongshanpione.dtb \
+       mstar-infinity2m-ssd202d-miyoo-mini.dtb \
+       mstar-infinity2m-ssd202d-wirelesstag-ido-sbc2d06-v1b-22w.dtb \
        mstar-infinity2m-ssd202d-ssd201htv2.dtb \
        mstar-infinity2m-ssd202d-unitv2.dtb \
        mstar-infinity3-msc313e-breadbee.dtb \
@@ -1507,6 +1519,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \
        aspeed-bmc-arm-centriq2400-rep.dtb \
        aspeed-bmc-arm-stardragon4800-rep2.dtb \
        aspeed-bmc-asrock-e3c246d4i.dtb \
+       aspeed-bmc-asrock-romed8hm3.dtb \
        aspeed-bmc-bytedance-g220a.dtb \
        aspeed-bmc-facebook-bletchley.dtb \
        aspeed-bmc-facebook-cloudripper.dtb \
@@ -1544,6 +1557,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \
        aspeed-bmc-opp-zaius.dtb \
        aspeed-bmc-portwell-neptune.dtb \
        aspeed-bmc-quanta-q71l.dtb \
+       aspeed-bmc-quanta-s6q.dtb \
        aspeed-bmc-supermicro-x11spi.dtb \
        aspeed-bmc-inventec-transformers.dtb \
        aspeed-bmc-tyan-s7106.dtb \
index b793bee..ce6cc2b 100644 (file)
                };
        };
 
-       mcp79400: mcp79400@6f {
+       mcp79400: rtc@6f {
                compatible = "microchip,mcp7940x";
                reg = <0x6f>;
        };
diff --git a/arch/arm/boot/dts/am335x-sancloud-bbe-extended-wifi.dts b/arch/arm/boot/dts/am335x-sancloud-bbe-extended-wifi.dts
new file mode 100644 (file)
index 0000000..246a1a9
--- /dev/null
@@ -0,0 +1,113 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (C) 2021 Sancloud Ltd
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
+ */
+/dts-v1/;
+
+#include "am33xx.dtsi"
+#include "am335x-bone-common.dtsi"
+#include "am335x-boneblack-common.dtsi"
+#include "am335x-sancloud-bbe-common.dtsi"
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+       model = "SanCloud BeagleBone Enhanced Extended WiFi";
+       compatible = "sancloud,am335x-boneenhanced",
+                    "ti,am335x-bone-black",
+                    "ti,am335x-bone",
+                    "ti,am33xx";
+
+       wlan_en_reg: fixedregulator@2 {
+               compatible = "regulator-fixed";
+               regulator-name = "wlan-en-regulator";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               startup-delay-us= <100000>;
+       };
+};
+
+&am33xx_pinmux {
+       mmc3_pins: pinmux_mmc3_pins {
+               pinctrl-single,pins = <
+                       /* gpmc_a9.gpio1_25: RADIO_EN */
+                       AM33XX_PADCONF(AM335X_PIN_GPMC_A9, PIN_OUTPUT_PULLUP, MUX_MODE7)
+
+                       /* gpmc_ad12.mmc2_dat0 */
+                       AM33XX_PADCONF(AM335X_PIN_GPMC_AD12, PIN_INPUT_PULLUP, MUX_MODE3)
+
+                       /* gpmc_ad13.mmc2_dat1 */
+                       AM33XX_PADCONF(AM335X_PIN_GPMC_AD13, PIN_INPUT_PULLUP, MUX_MODE3)
+
+                       /* gpmc_ad14.mmc2_dat2 */
+                       AM33XX_PADCONF(AM335X_PIN_GPMC_AD14, PIN_INPUT_PULLUP, MUX_MODE3)
+
+                       /* gpmc_ad15.mmc2_dat3 */
+                       AM33XX_PADCONF(AM335X_PIN_GPMC_AD15, PIN_INPUT_PULLUP, MUX_MODE3)
+
+                       /* gpmc_csn3.mmc2_cmd */
+                       AM33XX_PADCONF(AM335X_PIN_GPMC_CSN3, PIN_INPUT_PULLUP, MUX_MODE3)
+
+                       /* gpmc_clk.mmc2_clk */
+                       AM33XX_PADCONF(AM335X_PIN_GPMC_CLK, PIN_INPUT_PULLUP, MUX_MODE3)
+               >;
+       };
+
+       bluetooth_pins: pinmux_bluetooth_pins {
+               pinctrl-single,pins = <
+                       /* event_intr0.gpio0_19 */
+                       AM33XX_PADCONF(AM335X_PIN_XDMA_EVENT_INTR0, PIN_INPUT_PULLUP, MUX_MODE7)
+               >;
+       };
+
+       uart1_pins: pinmux_uart1_pins {
+               pinctrl-single,pins = <
+                       /* uart1_rxd */
+                       AM33XX_PADCONF(AM335X_PIN_UART1_RXD, PIN_INPUT, MUX_MODE0)
+
+                       /* uart1_txd */
+                       AM33XX_PADCONF(AM335X_PIN_UART1_TXD, PIN_INPUT, MUX_MODE0)
+
+                       /* uart1_ctsn */
+                       AM33XX_PADCONF(AM335X_PIN_UART1_CTSN, PIN_INPUT_PULLDOWN, MUX_MODE0)
+
+                       /* uart1_rtsn */
+                       AM33XX_PADCONF(AM335X_PIN_UART1_RTSN, PIN_OUTPUT_PULLDOWN, MUX_MODE0)
+               >;
+       };
+};
+
+&i2c2 {
+       status = "disabled";
+};
+
+&mmc3 {
+       status = "okay";
+       vmmc-supply = <&wlan_en_reg>;
+       bus-width = <4>;
+       non-removable;
+       cap-power-off-card;
+       ti,needs-special-hs-handling;
+       keep-power-in-suspend;
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc3_pins>;
+       dmas = <&edma_xbar 12 0 1
+               &edma_xbar 13 0 2>;
+       dma-names = "tx", "rx";
+       clock-frequency = <50000000>;
+       max-frequency = <50000000>;
+};
+
+&uart1 {
+       status = "okay";
+
+       bluetooth {
+               pinctrl-names = "default";
+               pinctrl-0 = <&uart1_pins &bluetooth_pins>;
+               compatible = "qcom,qca6174-bt";
+               enable-gpios = <&gpio1 25 GPIO_ACTIVE_HIGH>;
+               clocks = <&l4ls_clkctrl AM3_L4LS_UART2_CLKCTRL 0>;
+               interrupt-parent = <&gpio0>;
+               interrupts = <19 IRQ_TYPE_EDGE_RISING>;
+       };
+};
index 4c3c3f1..1b2e7ad 100644 (file)
                        <&adc10mux 0>, <&adc10mux 1>,
                        <&adc11mux 0>, <&adc11mux 1>,
                        <&adc12mux 0>, <&adc12mux 1>,
-                       <&adc13mux 0>, <&adc13mux 1>;
-       };
-
-       iio-hwmon-adc14 {
-               compatible = "iio-hwmon";
-               io-channels = <&adc 14>;
-       };
-
-       iio-hwmon-battery {
-               compatible = "iio-hwmon";
-               io-channels = <&adc 15>;
+                       <&adc13mux 0>, <&adc13mux 1>,
+                       <&adc 14>, <&adc 15>;
        };
 };
 
                /* spi-max-frequency = <50000000>; */
 #include "openbmc-flash-layout-64.dtsi"
        };
+
+       flash@1 {
+               status = "okay";
+               m25p,fast-read;
+               label = "alt-bmc";
+#include "openbmc-flash-layout-64-alt.dtsi"
+       };
 };
 
 &spi1 {
        /*E0-E7*/       "","","","","","","","",
        /*F0-F7*/       "","","BMC_SYS_PSON_L","S0_DDR_SAVE","PGOOD",
                        "S1_DDR_SAVE","","",
-       /*G0-G7*/       "S0_FW_BOOT_OK","SHD_REQ_L","","S0_OVERTEMP_L","","",
+       /*G0-G7*/       "host0-ready","SHD_REQ_L","","S0_OVERTEMP_L","","",
                        "","",
        /*H0-H7*/       "","","","","PSU1_VIN_GOOD","PSU2_VIN_GOOD","","",
        /*I0-I7*/       "PSU1_PRESENT","PSU2_PRESENT","S1_BMC_SPECIAL_BOOT",
        /*Q0-Q7*/       "","","","","","UID_BUTTON","","",
        /*R0-R7*/       "","","BMC_EXT_HIGHTEMP_L","OCP_AUX_PWREN",
                        "OCP_MAIN_PWREN","RESET_BUTTON","","",
-       /*S0-S7*/       "","","","","RTC_BAT_SEN_EN","","","",
+       /*S0-S7*/       "","","","","rtc-battery-voltage-read-enable","","","",
        /*T0-T7*/       "","","","","","","","",
        /*U0-U7*/       "","","","","","","","",
        /*V0-V7*/       "","","","","","","","",
        /*AC0-AC7*/     "SYS_PWR_GD","","","","","BMC_READY","SLAVE_PRESENT_L",
                        "BMC_OCP_PG";
 
-       i2c4_o_en {
+       i2c4-o-en-hog {
                gpio-hog;
                gpios = <ASPEED_GPIO(Y, 2) GPIO_ACTIVE_HIGH>;
                output-high;
diff --git a/arch/arm/boot/dts/aspeed-bmc-asrock-romed8hm3.dts b/arch/arm/boot/dts/aspeed-bmc-asrock-romed8hm3.dts
new file mode 100644 (file)
index 0000000..e71ccfd
--- /dev/null
@@ -0,0 +1,259 @@
+// SPDX-License-Identifier: GPL-2.0+
+/dts-v1/;
+
+#include "aspeed-g5.dtsi"
+#include <dt-bindings/gpio/aspeed-gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/{
+       model = "ASRock ROMED8HM3 BMC v1.00";
+       compatible = "asrock,romed8hm3-bmc", "aspeed,ast2500";
+
+       aliases {
+               serial4 = &uart5;
+       };
+
+       chosen {
+               stdout-path = &uart5;
+               bootargs = "console=tty0 console=ttyS4,115200 earlycon";
+       };
+
+       memory@80000000 {
+               reg = <0x80000000 0x20000000>;
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               heartbeat {
+                       gpios = <&gpio ASPEED_GPIO(H, 6) GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "timer";
+               };
+
+               system-fault {
+                       gpios = <&gpio ASPEED_GPIO(Z, 2) GPIO_ACTIVE_LOW>;
+                       panic-indicator;
+               };
+       };
+
+       iio-hwmon {
+               compatible = "iio-hwmon";
+               io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 3>,
+                       <&adc 4>, <&adc 5>, <&adc 6>, <&adc 7>,
+                       <&adc 8>, <&adc 9>, <&adc 10>, <&adc 11>,
+                       <&adc 12>, <&adc 13>, <&adc 14>, <&adc 15>;
+       };
+};
+
+&fmc {
+       status = "okay";
+       flash@0 {
+               status = "okay";
+               m25p,fast-read;
+               label = "bmc";
+               spi-max-frequency = <100000000>; /* 100 MHz */
+#include "openbmc-flash-layout-64.dtsi"
+       };
+};
+
+&uart5 {
+       status = "okay";
+};
+
+&vuart {
+       status = "okay";
+       aspeed,lpc-io-reg = <0x2f8>;
+       aspeed,lpc-interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
+};
+
+&mac0 {
+       status = "okay";
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_rgmii1_default &pinctrl_mdio1_default>;
+};
+
+&i2c0 {
+       status = "okay";
+
+       /* inlet temp sensor */
+       w83773g@4c {
+               compatible = "nuvoton,w83773g";
+               reg = <0x4c>;
+       };
+};
+
+&i2c1 {
+       status = "okay";
+};
+
+&i2c2 {
+       status = "okay";
+
+       /* IPB temp sensor */
+       w83773g@4c {
+               compatible = "nuvoton,w83773g";
+               reg = <0x4c>;
+       };
+
+       /* IPB PMIC */
+       lm25066@40 {
+               compatible = "lm25066";
+               reg = <0x40>;
+       };
+
+       /* 12VSB PMIC */
+       lm25066@41 {
+               compatible = "lm25066";
+               reg = <0x41>;
+       };
+};
+
+&i2c4 {
+       status = "okay";
+};
+
+&i2c5 {
+       status = "okay";
+};
+
+&i2c6 {
+       status = "okay";
+};
+
+&i2c7 {
+       status = "okay";
+
+       /* Baseboard FRU eeprom */
+       eeprom@50 {
+               compatible = "st,24c128", "atmel,24c128";
+               reg = <0x50>;
+               pagesize = <16>;
+       };
+};
+
+&i2c8 {
+       status = "okay";
+};
+
+&i2c9 {
+       status = "okay";
+};
+
+&video {
+       status = "okay";
+};
+
+&vhub {
+       status = "okay";
+};
+
+&lpc_ctrl {
+       status = "okay";
+};
+
+&lpc_snoop {
+       status = "okay";
+       snoop-ports = <0x80>;
+};
+
+&kcs3 {
+       status = "okay";
+       aspeed,lpc-io-reg = <0xca2>;
+};
+
+&pwm_tacho {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pwm3_default
+               &pinctrl_pwm4_default
+               &pinctrl_pwm5_default
+               &pinctrl_pwm6_default>;
+
+       fan@3 {
+               reg = <0x03>;
+               aspeed,fan-tach-ch = /bits/ 8 <0x03 0x0b>;
+       };
+
+       fan@4 {
+               reg = <0x04>;
+               aspeed,fan-tach-ch = /bits/ 8 <0x04 0x0c>;
+       };
+
+       fan@5 {
+               reg = <0x05>;
+               aspeed,fan-tach-ch = /bits/ 8 <0x05 0x0d>;
+       };
+
+       fan@6 {
+               reg = <0x06>;
+               aspeed,fan-tach-ch = /bits/ 8 <0x06 0x0e>;
+       };
+};
+
+&gpio {
+       status = "okay";
+       gpio-line-names =
+               /*  A */ "LOCATORLED_STATUS_N", "BMC_MAC2_INTB", "NMI_BTN_N", "BMC_NMI",
+                       "", "", "", "",
+               /*  B */ "DDR_MEM_TEMP", "", "", "", "", "", "", "",
+               /*  C */ "", "", "", "", "PCIE_HP_SEL_N", "PCIE_SATA_SEL_N", "LOCATORBTN", "",
+               /*  D */ "BMC_PSIN", "BMC_PSOUT", "BMC_RESETCON", "RESETCON",
+                       "", "", "", "PSU_FAN_FAIL_N",
+               /*  E */ "", "", "", "", "", "", "", "",
+               /*  F */ "NIC_PWR_GOOD", "PRSNTB0", "PRSNTB1", "PRSNTB2",
+                       "PRSNTB3", "", "3VSB_PCIE1_PG", "12V_PCIE1_PG",
+               /*  G */ "HWM_BAT_EN", "CHASSIS_ID0", "CHASSIS_ID1", "CHASSIS_ID2",
+                       "BMC_ALERT1_N_R", "BMC_ALERT2_N_R", "BMC_ALERT3_N", "BMC_ALERT4_N",
+               /*  H */ "X24_C1_PRSNT", "X24_C2_PRSNT", "X24_C3_PRSNT", "FM_MEM_THERM_EVENT_BMC_R_N",
+                       "FACMODE", "BMC_RTCRST", "BMC_HB_LED_N", "BMC_CASEOPEN",
+               /*  I */ "", "", "", "", "", "", "", "",
+               /*  J */ "BMC_READY", "BMC_PCH_BIOS_CS_N", "", "P0_MA_DDR_QS_CS_N",
+                       "", "", "", "",
+               /*  K */ "", "", "", "", "", "", "", "",
+               /*  L */ "", "", "", "", "", "", "", "",
+               /*  M */ "", "", "MEZZ_PWRBRK_N", "OCP_HP_RST_EN",
+                       "MAIN_PWR_EN_G", "BMC_MAIN_EN", "AUX_PWR_EN_G", "BMC_AUX_EN",
+               /*  N */ "", "", "", "", "", "", "", "",
+               /*  O */ "", "", "", "", "", "", "", "",
+               /*  P */ "", "", "", "", "", "", "", "",
+               /*  Q */ "", "", "", "",
+                       "BMC_SMB_PRESENT_1_N", "BMC_SMB_PRESENT_2_N",
+                       "BMC_SMB_PRESENT_3_N", "BMC_PCIE_WAKE_N",
+               /*  R */ "", "", "THERMALTRIP_CLEAR_N", "", "", "", "", "",
+               /*  S */ "", "", "", "", "", "", "", "",
+               /*  T */ "", "", "", "", "", "", "", "",
+               /*  U */ "", "", "", "", "", "", "", "",
+               /*  V */ "", "", "", "", "", "", "", "",
+               /*  W */ "", "", "", "", "", "", "", "",
+               /*  X */ "", "", "", "", "", "", "", "",
+               /*  Y */ "SLP_S3", "SLP_S4_S5", "NODE_ID_1", "NODE_ID_2", "", "", "", "",
+               /*  Z */ "", "", "SYSTEM_FAULT_LED_N", "FAST_THROTTLE_N",
+                       "", "", "", "",
+               /* AA */ "FM_CPU0_IBMC_THERMTRIP_N", "", "PROCHOT_L_G", "",
+                       "", "", "", "",
+               /* AB */ "BMC_FORCE_SELFREFRESH", "PWRGD_OUT", "", "IRQ_BMC_PCH_SMI_LPC_N",
+                       "", "", "", "",
+               /* AC */ "", "", "", "", "", "", "", "";
+};
+
+&adc {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_adc0_default
+               &pinctrl_adc1_default
+               &pinctrl_adc2_default
+               &pinctrl_adc3_default
+               &pinctrl_adc4_default
+               &pinctrl_adc5_default
+               &pinctrl_adc6_default
+               &pinctrl_adc7_default
+               &pinctrl_adc8_default
+               &pinctrl_adc9_default
+               &pinctrl_adc10_default
+               &pinctrl_adc11_default
+               &pinctrl_adc12_default
+               &pinctrl_adc13_default
+               &pinctrl_adc14_default
+               &pinctrl_adc15_default>;
+};
index f973ea8..eaf1bc2 100644 (file)
@@ -5,6 +5,8 @@
 #include "aspeed-g6.dtsi"
 #include <dt-bindings/gpio/aspeed-gpio.h>
 #include <dt-bindings/usb/pd.h>
+#include <dt-bindings/leds/leds-pca955x.h>
+#include <dt-bindings/interrupt-controller/irq.h>
 
 / {
        model = "Facebook Bletchley BMC";
@@ -31,7 +33,7 @@
                        <&adc1 4>, <&adc1 5>, <&adc1 6>, <&adc1 7>;
        };
 
-       spi_gpio: spi-gpio {
+       spi1_gpio: spi1-gpio {
                compatible = "spi-gpio";
                #address-cells = <1>;
                #size-cells = <0>;
                };
        };
 
+       spi2_gpio: spi2-gpio {
+               compatible = "spi-gpio";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               gpio-sck = <&gpio0 ASPEED_GPIO(X, 3) GPIO_ACTIVE_HIGH>;
+               gpio-mosi = <&gpio0 ASPEED_GPIO(X, 4) GPIO_ACTIVE_HIGH>;
+               gpio-miso = <&gpio0 ASPEED_GPIO(X, 5) GPIO_ACTIVE_HIGH>;
+               num-chipselects = <1>;
+               cs-gpios = <&gpio0 ASPEED_GPIO(X, 0) GPIO_ACTIVE_LOW>;
+
+               flash@0 {
+                       reg = <0>;
+                       compatible = "jedec,spi-nor";
+                       m25p,fast-read;
+                       label = "pnor";
+                       spi-max-frequency = <100000000>;
+               };
+       };
+
        switchphy: ethernet-phy@0 {
                // Fixed link
        };
 
-       leds {
+       front_gpio_leds {
                compatible = "gpio-leds";
-
                sys_log_id {
-                       retain-state-shutdown;
-                       default-state = "keep";
+                       default-state = "off";
                        gpios = <&front_leds 0 GPIO_ACTIVE_HIGH>;
                };
+       };
+
+       fan_gpio_leds {
+               compatible = "gpio-leds";
                fan0_blue {
                        retain-state-shutdown;
                        default-state = "on";
-                       gpios = <&fan_ioexp 8 GPIO_ACTIVE_HIGH>;
+                       gpios = <&fan_leds 8 GPIO_ACTIVE_HIGH>;
                };
                fan1_blue {
                        retain-state-shutdown;
                        default-state = "on";
-                       gpios = <&fan_ioexp 9 GPIO_ACTIVE_HIGH>;
+                       gpios = <&fan_leds 9 GPIO_ACTIVE_HIGH>;
                };
                fan2_blue {
                        retain-state-shutdown;
                        default-state = "on";
-                       gpios = <&fan_ioexp 10 GPIO_ACTIVE_HIGH>;
+                       gpios = <&fan_leds 10 GPIO_ACTIVE_HIGH>;
                };
                fan3_blue {
                        retain-state-shutdown;
                        default-state = "on";
-                       gpios = <&fan_ioexp 11 GPIO_ACTIVE_HIGH>;
+                       gpios = <&fan_leds 11 GPIO_ACTIVE_HIGH>;
                };
                fan0_amber {
                        retain-state-shutdown;
                        default-state = "off";
-                       gpios = <&fan_ioexp 12 GPIO_ACTIVE_HIGH>;
+                       gpios = <&fan_leds 12 GPIO_ACTIVE_HIGH>;
                };
                fan1_amber {
                        retain-state-shutdown;
                        default-state = "off";
-                       gpios = <&fan_ioexp 13 GPIO_ACTIVE_HIGH>;
+                       gpios = <&fan_leds 13 GPIO_ACTIVE_HIGH>;
                };
                fan2_amber {
                        retain-state-shutdown;
                        default-state = "off";
-                       gpios = <&fan_ioexp 14 GPIO_ACTIVE_HIGH>;
+                       gpios = <&fan_leds 14 GPIO_ACTIVE_HIGH>;
                };
                fan3_amber {
                        retain-state-shutdown;
                        default-state = "off";
-                       gpios = <&fan_ioexp 15 GPIO_ACTIVE_HIGH>;
-               };
-               sled0_amber {
-                       retain-state-shutdown;
-                       default-state = "off";
-                       gpios = <&sled0_leds 0 GPIO_ACTIVE_LOW>;
-               };
-               sled0_blue {
-                       retain-state-shutdown;
-                       default-state = "off";
-                       gpios = <&sled0_leds 1 GPIO_ACTIVE_LOW>;
+                       gpios = <&fan_leds 15 GPIO_ACTIVE_HIGH>;
                };
+       };
+
+       sled1_gpio_leds {
+               compatible = "gpio-leds";
                sled1_amber {
                        retain-state-shutdown;
-                       default-state = "off";
+                       default-state = "keep";
                        gpios = <&sled1_leds 0 GPIO_ACTIVE_LOW>;
                };
                sled1_blue {
                        retain-state-shutdown;
-                       default-state = "off";
+                       default-state = "keep";
                        gpios = <&sled1_leds 1 GPIO_ACTIVE_LOW>;
                };
+       };
+
+       sled2_gpio_leds {
+               compatible = "gpio-leds";
                sled2_amber {
                        retain-state-shutdown;
-                       default-state = "off";
+                       default-state = "keep";
                        gpios = <&sled2_leds 0 GPIO_ACTIVE_LOW>;
                };
                sled2_blue {
                        retain-state-shutdown;
-                       default-state = "off";
+                       default-state = "keep";
                        gpios = <&sled2_leds 1 GPIO_ACTIVE_LOW>;
                };
+       };
+
+       sled3_gpio_leds {
+               compatible = "gpio-leds";
                sled3_amber {
                        retain-state-shutdown;
-                       default-state = "off";
+                       default-state = "keep";
                        gpios = <&sled3_leds 0 GPIO_ACTIVE_LOW>;
                };
                sled3_blue {
                        retain-state-shutdown;
-                       default-state = "off";
+                       default-state = "keep";
                        gpios = <&sled3_leds 1 GPIO_ACTIVE_LOW>;
                };
+       };
+
+       sled4_gpio_leds {
+               compatible = "gpio-leds";
                sled4_amber {
                        retain-state-shutdown;
-                       default-state = "off";
+                       default-state = "keep";
                        gpios = <&sled4_leds 0 GPIO_ACTIVE_LOW>;
                };
                sled4_blue {
                        retain-state-shutdown;
-                       default-state = "off";
+                       default-state = "keep";
                        gpios = <&sled4_leds 1 GPIO_ACTIVE_LOW>;
                };
+       };
+
+       sled5_gpio_leds {
+               compatible = "gpio-leds";
                sled5_amber {
                        retain-state-shutdown;
-                       default-state = "off";
+                       default-state = "keep";
                        gpios = <&sled5_leds 0 GPIO_ACTIVE_LOW>;
                };
                sled5_blue {
                        retain-state-shutdown;
-                       default-state = "off";
+                       default-state = "keep";
                        gpios = <&sled5_leds 1 GPIO_ACTIVE_LOW>;
                };
        };
+
+       sled6_gpio_leds {
+               compatible = "gpio-leds";
+               sled6_amber {
+                       retain-state-shutdown;
+                       default-state = "keep";
+                       gpios = <&sled6_leds 0 GPIO_ACTIVE_LOW>;
+               };
+               sled6_blue {
+                       retain-state-shutdown;
+                       default-state = "keep";
+                       gpios = <&sled6_leds 1 GPIO_ACTIVE_LOW>;
+               };
+       };
 };
 
 &mac2 {
        };
 };
 
-&rtc {
-       status = "okay";
-};
-
 &fmc {
        status = "okay";
        flash@0 {
                spi-max-frequency = <50000000>;
 #include "openbmc-flash-layout-128.dtsi"
        };
-};
-
-&spi2 {
-       status = "okay";
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_spi2_default>;
-
-       flash@0 {
+       flash@1 {
                status = "okay";
                m25p,fast-read;
-               label = "pnor";
-               spi-max-frequency = <100000000>;
+               label = "flash1";
+               spi-max-frequency = <50000000>;
        };
 };
 
 &i2c0 {
        status = "okay";
-       /* TODO: Add ADC INA230 */
+       ina230@45 {
+               compatible = "ti,ina230";
+               reg = <0x45>;
+               shunt-resistor = <2000>;
+       };
 
        mp5023@40 {
                compatible = "mps,mp5023";
                reg = <0x4f>;
        };
 
-       sled0_ioexp: pca9539@76 {
+       sled1_ioexp: pca9539@76 {
                compatible = "nxp,pca9539";
                reg = <0x76>;
                #address-cells = <1>;
                gpio-controller;
                #gpio-cells = <2>;
 
+               interrupt-parent = <&gpio0>;
+               interrupts = <ASPEED_GPIO(M, 0) IRQ_TYPE_LEVEL_LOW>;
+
                gpio-line-names =
-               "SLED0_MS_DETECT1","SLED0_VBUS_BMC_EN","SLED0_INA230_ALERT","SLED0_P12V_STBY_ALERT",
-               "SLED0_SSD_ALERT","SLED0_MS_DETECT0","SLED0_RST_CCG5","SLED0_FUSB302_INT",
-               "SLED0_MD_STBY_RESET","SLED0_MD_IOEXP_EN_FAULT","SLED0_MD_DIR","SLED0_MD_DECAY",
-               "SLED0_MD_MODE1","SLED0_MD_MODE2","SLED0_MD_MODE3","power-host0";
+               "SLED1_MS_DETECT1","SLED1_VBUS_BMC_EN","SLED1_INA230_ALERT","SLED1_P12V_STBY_ALERT",
+               "SLED1_SSD_ALERT","SLED1_MS_DETECT0","SLED1_RST_CCG5","SLED1_FUSB302_INT",
+               "SLED1_MD_STBY_RESET","SLED1_MD_IOEXP_EN_FAULT","SLED1_MD_DIR","SLED1_MD_DECAY",
+               "SLED1_MD_MODE1","SLED1_MD_MODE2","SLED1_MD_MODE3","power-host1";
        };
 
-       sled0_leds: pca9552@67 {
+       sled1_leds: pca9552@67 {
                compatible = "nxp,pca9552";
                reg = <0x67>;
                #address-cells = <1>;
                #gpio-cells = <2>;
 
                gpio-line-names =
-               "led-sled0-amber","led-sled0-blue","SLED0_RST_IOEXP","",
+               "led-sled1-amber","led-sled1-blue","SLED1_RST_IOEXP","SLED1_MD_REF_PWM",
                "","","","",
                "","","","",
                "","","","";
        };
 
-       sled0_fusb302: typec-portc@22 {
+       sled1_fusb302: typec-portc@22 {
                compatible = "fcs,fusb302";
                reg = <0x22>;
 
 
 &i2c1 {
        status = "okay";
-       /* TODO: Add ADC INA230 */
+       ina230@45 {
+               compatible = "ti,ina230";
+               reg = <0x45>;
+               shunt-resistor = <2000>;
+       };
 
        mp5023@40 {
                compatible = "mps,mp5023";
                reg = <0x4f>;
        };
 
-       sled1_ioexp: pca9539@76 {
+       sled2_ioexp: pca9539@76 {
                compatible = "nxp,pca9539";
                reg = <0x76>;
                #address-cells = <1>;
                gpio-controller;
                #gpio-cells = <2>;
 
+               interrupt-parent = <&gpio0>;
+               interrupts = <ASPEED_GPIO(M, 1) IRQ_TYPE_LEVEL_LOW>;
+
                gpio-line-names =
-               "SLED1_MS_DETECT1","SLED1_VBUS_BMC_EN","SLED1_INA230_ALERT","SLED1_P12V_STBY_ALERT",
-               "SLED1_SSD_ALERT","SLED1_MS_DETECT0","SLED1_RST_CCG5","SLED1_FUSB302_INT",
-               "SLED1_MD_STBY_RESET","SLED1_MD_IOEXP_EN_FAULT","SLED1_MD_DIR","SLED1_MD_DECAY",
-               "SLED1_MD_MODE1","SLED1_MD_MODE2","SLED1_MD_MODE3","power-host1";
+               "SLED2_MS_DETECT1","SLED2_VBUS_BMC_EN","SLED2_INA230_ALERT","SLED2_P12V_STBY_ALERT",
+               "SLED2_SSD_ALERT","SLED2_MS_DETECT0","SLED2_RST_CCG5","SLED2_FUSB302_INT",
+               "SLED2_MD_STBY_RESET","SLED2_MD_IOEXP_EN_FAULT","SLED2_MD_DIR","SLED2_MD_DECAY",
+               "SLED2_MD_MODE1","SLED2_MD_MODE2","SLED2_MD_MODE3","power-host2";
        };
 
-       sled1_leds: pca9552@67 {
+       sled2_leds: pca9552@67 {
                compatible = "nxp,pca9552";
                reg = <0x67>;
                #address-cells = <1>;
                #gpio-cells = <2>;
 
                gpio-line-names =
-               "led-sled1-amber","led-sled1-blue","SLED1_RST_IOEXP","",
+               "led-sled2-amber","led-sled2-blue","SLED2_RST_IOEXP","SLED2_MD_REF_PWM",
                "","","","",
                "","","","",
                "","","","";
        };
 
-       sled1_fusb302: typec-portc@22 {
+       sled2_fusb302: typec-portc@22 {
                compatible = "fcs,fusb302";
                reg = <0x22>;
 
        };
 };
 
-&i2c1 {
-       status = "okay";
-};
-
 &i2c2 {
        status = "okay";
-       /* TODO: Add ADC INA230 */
+       ina230@45 {
+               compatible = "ti,ina230";
+               reg = <0x45>;
+               shunt-resistor = <2000>;
+       };
 
        mp5023@40 {
                compatible = "mps,mp5023";
                reg = <0x4f>;
        };
 
-       sled2_ioexp: pca9539@76 {
+       sled3_ioexp: pca9539@76 {
                compatible = "nxp,pca9539";
                reg = <0x76>;
                #address-cells = <1>;
                gpio-controller;
                #gpio-cells = <2>;
 
+               interrupt-parent = <&gpio0>;
+               interrupts = <ASPEED_GPIO(M, 2) IRQ_TYPE_LEVEL_LOW>;
+
                gpio-line-names =
-               "SLED2_MS_DETECT1","SLED2_VBUS_BMC_EN","SLED2_INA230_ALERT","SLED2_P12V_STBY_ALERT",
-               "SLED2_SSD_ALERT","SLED2_MS_DETECT0","SLED2_RST_CCG5","SLED2_FUSB302_INT",
-               "SLED2_MD_STBY_RESET","SLED2_MD_IOEXP_EN_FAULT","SLED2_MD_DIR","SLED2_MD_DECAY",
-               "SLED2_MD_MODE1","SLED2_MD_MODE2","SLED2_MD_MODE3","power-host2";
+               "SLED3_MS_DETECT1","SLED3_VBUS_BMC_EN","SLED3_INA230_ALERT","SLED3_P12V_STBY_ALERT",
+               "SLED3_SSD_ALERT","SLED3_MS_DETECT0","SLED3_RST_CCG5","SLED3_FUSB302_INT",
+               "SLED3_MD_STBY_RESET","SLED3_MD_IOEXP_EN_FAULT","SLED3_MD_DIR","SLED3_MD_DECAY",
+               "SLED3_MD_MODE1","SLED3_MD_MODE2","SLED3_MD_MODE3","power-host3";
        };
 
-       sled2_leds: pca9552@67 {
+       sled3_leds: pca9552@67 {
                compatible = "nxp,pca9552";
                reg = <0x67>;
                #address-cells = <1>;
                #gpio-cells = <2>;
 
                gpio-line-names =
-               "led-sled2-amber","led-sled2-blue","SLED2_RST_IOEXP","",
+               "led-sled3-amber","led-sled3-blue","SLED3_RST_IOEXP","SLED3_MD_REF_PWM",
                "","","","",
                "","","","",
                "","","","";
        };
 
-       sled2_fusb302: typec-portc@22 {
+       sled3_fusb302: typec-portc@22 {
                compatible = "fcs,fusb302";
                reg = <0x22>;
 
 
 &i2c3 {
        status = "okay";
-       /* TODO: Add ADC INA230 */
+       ina230@45 {
+               compatible = "ti,ina230";
+               reg = <0x45>;
+               shunt-resistor = <2000>;
+       };
 
        mp5023@40 {
                compatible = "mps,mp5023";
                reg = <0x4f>;
        };
 
-       sled3_ioexp: pca9539@76 {
+       sled4_ioexp: pca9539@76 {
                compatible = "nxp,pca9539";
                reg = <0x76>;
                #address-cells = <1>;
                gpio-controller;
                #gpio-cells = <2>;
 
+               interrupt-parent = <&gpio0>;
+               interrupts = <ASPEED_GPIO(M, 3) IRQ_TYPE_LEVEL_LOW>;
+
                gpio-line-names =
-               "SLED3_MS_DETECT1","SLED3_VBUS_BMC_EN","SLED3_INA230_ALERT","SLED3_P12V_STBY_ALERT",
-               "SLED3_SSD_ALERT","SLED3_MS_DETECT0","SLED3_RST_CCG5","SLED3_FUSB302_INT",
-               "SLED3_MD_STBY_RESET","SLED3_MD_IOEXP_EN_FAULT","SLED3_MD_DIR","SLED3_MD_DECAY",
-               "SLED3_MD_MODE1","SLED3_MD_MODE2","SLED3_MD_MODE3","power-host3";
+               "SLED4_MS_DETECT1","SLED4_VBUS_BMC_EN","SLED4_INA230_ALERT","SLED4_P12V_STBY_ALERT",
+               "SLED4_SSD_ALERT","SLED4_MS_DETECT0","SLED4_RST_CCG5","SLED4_FUSB302_INT",
+               "SLED4_MD_STBY_RESET","SLED4_MD_IOEXP_EN_FAULT","SLED4_MD_DIR","SLED4_MD_DECAY",
+               "SLED4_MD_MODE1","SLED4_MD_MODE2","SLED4_MD_MODE3","power-host4";
        };
 
-       sled3_leds: pca9552@67 {
+       sled4_leds: pca9552@67 {
                compatible = "nxp,pca9552";
                reg = <0x67>;
                #address-cells = <1>;
                #gpio-cells = <2>;
 
                gpio-line-names =
-               "led-sled3-amber","led-sled3-blue","SLED3_RST_IOEXP","",
+               "led-sled4-amber","led-sled4-blue","SLED4_RST_IOEXP","SLED4_MD_REF_PWM",
                "","","","",
                "","","","",
                "","","","";
        };
 
-       sled3_fusb302: typec-portc@22 {
+       sled4_fusb302: typec-portc@22 {
                compatible = "fcs,fusb302";
                reg = <0x22>;
 
 
 &i2c4 {
        status = "okay";
-       /* TODO: Add ADC INA230 */
+       ina230@45 {
+               compatible = "ti,ina230";
+               reg = <0x45>;
+               shunt-resistor = <2000>;
+       };
 
        mp5023@40 {
                compatible = "mps,mp5023";
                reg = <0x4f>;
        };
 
-       sled4_ioexp: pca9539@76 {
+       sled5_ioexp: pca9539@76 {
                compatible = "nxp,pca9539";
                reg = <0x76>;
                #address-cells = <1>;
                gpio-controller;
                #gpio-cells = <2>;
 
+               interrupt-parent = <&gpio0>;
+               interrupts = <ASPEED_GPIO(M, 4) IRQ_TYPE_LEVEL_LOW>;
+
                gpio-line-names =
-               "SLED4_MS_DETECT1","SLED4_VBUS_BMC_EN","SLED4_INA230_ALERT","SLED4_P12V_STBY_ALERT",
-               "SLED4_SSD_ALERT","SLED4_MS_DETECT0","SLED4_RST_CCG5","SLED4_FUSB302_INT",
-               "SLED4_MD_STBY_RESET","SLED4_MD_IOEXP_EN_FAULT","SLED4_MD_DIR","SLED4_MD_DECAY",
-               "SLED4_MD_MODE1","SLED4_MD_MODE2","SLED4_MD_MODE3","power-host4";
+               "SLED5_MS_DETECT1","SLED5_VBUS_BMC_EN","SLED5_INA230_ALERT","SLED5_P12V_STBY_ALERT",
+               "SLED5_SSD_ALERT","SLED5_MS_DETECT0","SLED5_RST_CCG5","SLED5_FUSB302_INT",
+               "SLED5_MD_STBY_RESET","SLED5_MD_IOEXP_EN_FAULT","SLED5_MD_DIR","SLED5_MD_DECAY",
+               "SLED5_MD_MODE1","SLED5_MD_MODE2","SLED5_MD_MODE3","power-host5";
        };
 
-       sled4_leds: pca9552@67 {
+       sled5_leds: pca9552@67 {
                compatible = "nxp,pca9552";
                reg = <0x67>;
                #address-cells = <1>;
                #gpio-cells = <2>;
 
                gpio-line-names =
-               "led-sled4-amber","led-sled4-blue","SLED4_RST_IOEXP","",
+               "led-sled5-amber","led-sled5-blue","SLED5_RST_IOEXP","SLED5_MD_REF_PWM",
                "","","","",
                "","","","",
                "","","","";
        };
 
-       sled4_fusb302: typec-portc@22 {
+       sled5_fusb302: typec-portc@22 {
                compatible = "fcs,fusb302";
                reg = <0x22>;
 
 
 &i2c5 {
        status = "okay";
-       /* TODO: Add ADC INA230 */
+       ina230@45 {
+               compatible = "ti,ina230";
+               reg = <0x45>;
+               shunt-resistor = <2000>;
+       };
 
        mp5023@40 {
                compatible = "mps,mp5023";
                reg = <0x4f>;
        };
 
-       sled5_ioexp: pca9539@76 {
+       sled6_ioexp: pca9539@76 {
                compatible = "nxp,pca9539";
                reg = <0x76>;
                #address-cells = <1>;
                gpio-controller;
                #gpio-cells = <2>;
 
+               interrupt-parent = <&gpio0>;
+               interrupts = <ASPEED_GPIO(M, 5) IRQ_TYPE_LEVEL_LOW>;
+
                gpio-line-names =
-               "SLED5_MS_DETECT1","SLED5_VBUS_BMC_EN","SLED5_INA230_ALERT","SLED5_P12V_STBY_ALERT",
-               "SLED5_SSD_ALERT","SLED5_MS_DETECT0","SLED5_RST_CCG5","SLED5_FUSB302_INT",
-               "SLED5_MD_STBY_RESET","SLED5_MD_IOEXP_EN_FAULT","SLED5_MD_DIR","SLED5_MD_DECAY",
-               "SLED5_MD_MODE1","SLED5_MD_MODE2","SLED5_MD_MODE3","power-host5";
+               "SLED6_MS_DETECT1","SLED6_VBUS_BMC_EN","SLED6_INA230_ALERT","SLED6_P12V_STBY_ALERT",
+               "SLED6_SSD_ALERT","SLED6_MS_DETECT0","SLED6_RST_CCG5","SLED6_FUSB302_INT",
+               "SLED6_MD_STBY_RESET","SLED6_MD_IOEXP_EN_FAULT","SLED6_MD_DIR","SLED6_MD_DECAY",
+               "SLED6_MD_MODE1","SLED6_MD_MODE2","SLED6_MD_MODE3","power-host6";
        };
 
-       sled5_leds: pca9552@67 {
+       sled6_leds: pca9552@67 {
                compatible = "nxp,pca9552";
                reg = <0x67>;
                #address-cells = <1>;
                #gpio-cells = <2>;
 
                gpio-line-names =
-               "led-sled5-amber","led-sled5-blue","SLED5_RST_IOEXP","",
+               "led-sled6-amber","led-sled6-blue","SLED6_RST_IOEXP","SLED6_MD_REF_PWM",
                "","","","",
                "","","","",
                "","","","";
        };
 
-       sled5_fusb302: typec-portc@22 {
+       sled6_fusb302: typec-portc@22 {
                compatible = "fcs,fusb302";
                reg = <0x22>;
 
        };
 
        rtc@51 {
+               /* in-chip rtc disabled, use external rtc (battery-backed) */
                compatible = "nxp,pcf85263";
                reg = <0x51>;
        };
        adm1278@11 {
                compatible = "adi,adm1278";
                reg = <0x11>;
+               shunt-resistor-micro-ohms = <300>;
        };
 
        tmp421@4c {
                reg = <0x4d>;
        };
 
-       fan_ioexp: pca9552@67 {
+       fan_leds: pca9552@67 {
                compatible = "nxp,pca9552";
                reg = <0x67>;
                #address-cells = <1>;
        /*D0-D7*/       "","","","","","","","",
        /*E0-E7*/       "","","","","","","","",
        /*F0-F7*/       "","","","","","","","",
-       /*G0-G7*/       "","SWITCH_FRU_MUX","","","","","","",
+       /*G0-G7*/       "BSM_FRU_WP","SWITCH_FRU_MUX","","",
+                       "PWRGD_P1V05_VDDCORE","PWRGD_P1V5_VDD","","",
        /*H0-H7*/       "presence-riser1","presence-riser2",
-                       "presence-sled0","presence-sled1",
-                       "presence-sled2","presence-sled3",
-                       "presence-sled4","presence-sled5",
+                       "presence-sled1","presence-sled2",
+                       "presence-sled3","presence-sled4",
+                       "presence-sled5","presence-sled6",
        /*I0-I7*/       "REV_ID0","","REV_ID1","REV_ID2",
-                       "","","","",
+                       "","BSM_FLASH_WP_STATUS","BMC_TPM_PRES","",
        /*J0-J7*/       "","","","","","","","",
        /*K0-K7*/       "","","","","","","","",
-       /*L0-L7*/       "","","","","","","","",
-       /*M0-M7*/       "ALERT_SLED0","ALERT_SLED1",
-                       "ALERT_SLED2","ALERT_SLED3",
-                       "ALERT_SLED4","ALERT_SLED5",
+       /*L0-L7*/       "","","","","","BMC_RTC_INT","","",
+       /*M0-M7*/       "ALERT_SLED1","ALERT_SLED2",
+                       "ALERT_SLED3","ALERT_SLED4",
+                       "ALERT_SLED5","ALERT_SLED6",
                        "P12V_AUX_ALERT1","",
        /*N0-N7*/       "","","","","","","","",
        /*O0-O7*/       "","","","",
                        "","BOARD_ID0","BOARD_ID1","BOARD_ID2",
-       /*P0-P7*/       "","","","","","","","",
+       /*P0-P7*/       "","","","","","","","BMC_HEARTBEAT",
        /*Q0-Q7*/       "","","","","","","","",
        /*R0-R7*/       "","","","","","","","",
        /*S0-S7*/       "","","","BAT_DETECT",
                        "BMC_BT_WP0","BMC_BT_WP1","","",
        /*T0-T7*/       "","","","","","","","",
        /*U0-U7*/       "","","","","","","","",
-       /*V0-V7*/       "","RST_BMC_MVL","","",
+       /*V0-V7*/       "PWRGD_CNS_PSU","RST_BMC_MVL","","PSU_PRSNT",
                        "USB2_SEL0_A","USB2_SEL1_A",
                        "USB2_SEL0_B","USB2_SEL1_B",
        /*W0-W7*/       "RST_FRONT_IOEXP","","","","","","","",
        /*X0-X7*/       "","","","","","","","",
-       /*Y0-Y7*/       "","","BSM_FLASH_LATCH","","","","","",
+       /*Y0-Y7*/       "BMC_SELF_HW_RST","BSM_PRSNT","BSM_FLASH_LATCH","",
+                       "","","","",
        /*Z0-Z7*/       "","","","","","","","";
 };
 
                &pinctrl_adc12_default &pinctrl_adc13_default
                &pinctrl_adc14_default &pinctrl_adc15_default>;
 };
+
+&mdio3 {
+       status = "okay";
+       /* TODO: Add Marvell 88X3310 */
+};
index 22c06ff..578f9e2 100644 (file)
                /* 48MB region from the end of flash to start of vga memory */
                ramoops@bc000000 {
                        compatible = "ramoops";
-                       reg = <0xbc000000 0x180000>; /* 16 * (3 * 0x8000) */
+                       reg = <0xbc000000 0x200000>; /* 16 * (4 * 0x8000) */
                        record-size = <0x8000>;
                        console-size = <0x8000>;
+                       ftrace-size = <0x8000>;
                        pmsg-size = <0x8000>;
                        max-reason = <3>; /* KMSG_DUMP_EMERG */
                };
        /*C0-C7*/       "","","","","","","","",
        /*D0-D7*/       "","","","","","","","",
        /*E0-E7*/       "","","","","","","","",
-       /*F0-F7*/       "PIN_HOLE_RESET_IN_N","","",
-                               "PIN_HOLE_RESET_OUT_N","","",
-                               "factory-reset-toggle","",
+       /*F0-F7*/       "","","rtc-battery-voltage-read-enable","reset-cause-pinhole","","","factory-reset-toggle","",
        /*G0-G7*/       "","","","","","","","",
        /*H0-H7*/       "led-rtc-battery","led-bmc","led-rear-enc-id0","led-rear-enc-fault0","","","","",
        /*I0-I7*/       "","","","","","","bmc-secure-boot","",
        status = "okay";
 };
 
+&uhci {
+       status = "okay";
+};
+
 &emmc_controller {
        status = "okay";
 };
index c479742..528b49e 100644 (file)
 
                ramoops@bc000000 {
                        compatible = "ramoops";
-                       reg = <0xbc000000 0x180000>; /* 16 * (3 * 0x8000) */
+                       reg = <0xbc000000 0x200000>; /* 16 * (4 * 0x8000) */
                        record-size = <0x8000>;
                        console-size = <0x8000>;
+                       ftrace-size = <0x8000>;
                        pmsg-size = <0x8000>;
                        max-reason = <3>; /* KMSG_DUMP_EMERG */
                };
        status = "okay";
 };
 
+&uhci {
+       status = "okay";
+};
+
 &gpio0 {
        gpio-line-names =
        /*A0-A7*/       "","","","","","","","",
        /*C0-C7*/       "","","","","","","","",
        /*D0-D7*/       "","","","","","","","",
        /*E0-E7*/       "","","","","","","","",
-       /*F0-F7*/       "","","","","","","factory-reset-toggle","",
+       /*F0-F7*/       "","","rtc-battery-voltage-read-enable","reset-cause-pinhole","","","factory-reset-toggle","",
        /*G0-G7*/       "","","","","","","","",
        /*H0-H7*/       "","bmc-ingraham0","rear-enc-id0","rear-enc-fault0","","","","",
        /*I0-I7*/       "","","","","","","bmc-secure-boot","",
        use-ncsi;
 };
 
-&fmc {
-       status = "okay";
-       flash@0 {
-               status = "okay";
-               m25p,fast-read;
-               label = "bmc";
-               spi-max-frequency = <50000000>;
-#include "openbmc-flash-layout-128.dtsi"
-       };
-};
-
-&spi1 {
-       status = "okay";
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_spi1_default>;
-
-       flash@0 {
-               status = "okay";
-               m25p,fast-read;
-               label = "pnor";
-               spi-max-frequency = <100000000>;
-       };
-};
-
 &wdt1 {
        aspeed,reset-type = "none";
        aspeed,external-signal;
index e39f310..72b7a66 100644 (file)
 
        fsi-routing-gpios = <&gpio0 ASPEED_GPIO(Q, 7) GPIO_ACTIVE_HIGH>;
        fsi-mux-gpios = <&gpio0 ASPEED_GPIO(B, 0) GPIO_ACTIVE_HIGH>;
-       cfam-reset-gpios = <&gpio0 ASPEED_GPIO(Q, 0) GPIO_ACTIVE_LOW>;
 
        cfam@0,0 {
                reg = <0 0>;
        status = "okay";
        memory-region = <&vga_memory>;
 };
+
+&kcs2 {
+       status = "okay";
+       aspeed,lpc-io-reg = <0xca8 0xcac>;
+};
+
+&kcs3 {
+       status = "okay";
+       aspeed,lpc-io-reg = <0xca2>;
+       aspeed,lpc-interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+};
diff --git a/arch/arm/boot/dts/aspeed-bmc-quanta-s6q.dts b/arch/arm/boot/dts/aspeed-bmc-quanta-s6q.dts
new file mode 100644 (file)
index 0000000..69e1bd2
--- /dev/null
@@ -0,0 +1,610 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+// Copyright 2022 Quanta Corp.
+/dts-v1/;
+
+#include "aspeed-g6.dtsi"
+#include <dt-bindings/gpio/aspeed-gpio.h>
+#include <dt-bindings/i2c/i2c.h>
+
+/ {
+       model = "Quanta S6Q BMC";
+       compatible = "quanta,s6q-bmc", "aspeed,ast2600";
+
+       aliases {
+               // bus 0
+               i2c20 = &SMB_HOST_DB2000_3V3AUX_SCL;
+               i2c21 = &U12_PCA9546_CH1;
+               i2c22 = &SMB_HOST_DB800_B_SCL;
+               i2c23 = &SMB_HOST_DB800_C_SCL;
+
+               // bus 1
+               i2c24 = &SMB_M2_P0_1V8AUX_SCL;
+               i2c25 = &SMB_M2_P1_1V8AUX_SCL;
+               i2c26 = &SMB_CPU_PIROM_3V3AUX_SCL;
+               i2c27 = &SMB_TEMP_3V3AUX_SCL;
+               i2c28 = &SMB_IPMB_3V3AUX_SSDSB_SCL;
+               i2c29 = &SMB_IPMB_3V3AUX_SCL;
+               i2c31 = &SMB_FB_SCL;
+
+               // bus 1 - Fan board
+               i2c32 = &SMB_IOEXP_SCL;
+               i2c33 = &SMB_PROGRAM_SCL;
+               i2c34 = &SMB_FB_SCL_CH2;
+               i2c35 = &SMB_FAN_SENSE_SCL;
+
+               // bus 6
+               i2c36 = &U197_PCA9546_CH0;
+               i2c37 = &U197_PCA9546_CH1;
+               i2c38 = &U197_PCA9546_CH2;
+               i2c39 = &U197_PCA9546_CH3;
+
+               //bus 7
+               i2c40 = &SMB_OCP_SFF_3V3AUX_SCL; //OCP1
+               i2c41 = &SMB_OCP_LFF_3V3AUX_SCL; //OCP2
+       };
+
+       chosen {
+               stdout-path = &uart5;
+               bootargs = "console=ttyS4,115200n8 earlycon";
+       };
+
+       memory@80000000 {
+               device_type = "memory";
+               reg = <0x80000000 0x40000000>;
+       };
+
+       iio-hwmon {
+               compatible = "iio-hwmon";
+               io-channels = <&adc0 0>, <&adc0 1>, <&adc0 2>, <&adc0 3>,
+                       <&adc0 4>, <&adc0 5>, <&adc0 6>, <&adc0 7>,
+                       <&adc1 0>, <&adc1 1>, <&adc1 2>, <&adc1 3>,
+                       <&adc1 4>, <&adc1 5>, <&adc1 6>, <&adc1 7>;
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               BMC_HEARTBEAT_N {
+                       label="BMC_HEARTBEAT_N";
+                       gpios = <&gpio0 ASPEED_GPIO(P, 7) GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "heartbeat";
+               };
+
+               BMC_LED_STATUS_AMBER_N {
+                       label="BMC_LED_STATUS_AMBER_N";
+                       gpios = <&gpio0 ASPEED_GPIO(S, 6) GPIO_ACTIVE_LOW>;
+                       default-state = "off";
+               };
+
+               FM_ID_LED_N {
+                       label="FM_ID_LED_N";
+                       gpios = <&gpio0 ASPEED_GPIO(B, 5) GPIO_ACTIVE_LOW>;
+                       default-state = "off";
+               };
+       };
+};
+
+&gpio0 {
+       gpio-line-names =
+       /*A0 - A7*/     "", "", "", "", "", "", "", "",
+       /*B0 - B7*/     "", "", "", "", "", "", "", "",
+       /*C0 - C7*/     "", "", "", "", "", "", "", "",
+       /*D0 - D7*/     "", "", "", "", "", "", "", "",
+       /*E0 - E7*/     "", "", "", "", "", "", "", "",
+       /*F0 - F7*/     "PLTRST_N", "", "PWR_DEBUG_N", "", "", "", "", "",
+       /*G0 - G7*/     "", "", "", "", "", "", "", "",
+       /*H0 - H7*/     "", "", "", "", "", "", "", "",
+       /*I0 - I7*/     "", "", "", "", "", "", "", "",
+       /*J0 - J7*/     "", "", "", "", "", "", "", "",
+       /*K0 - K7*/     "", "", "", "", "", "", "", "",
+       /*L0 - L7*/     "", "", "", "", "PREQ_N", "TCK_MUX_SEL", "", "",
+       /*M0 - M7*/     "", "", "", "PWRGD_SYS_PWROK", "", "PRDY_N", "", "",
+       /*N0 - N7*/     "", "", "", "", "", "", "", "",
+       /*O0 - O7*/     "", "", "", "", "", "", "", "",
+       /*P0 - P7*/     "SYS_BMC_PWRBTN_R_N", "SYS_PWRBTN_N", "FM_MB_RST_BTN", "RST_BMC_RSTBTN_OUT_N", "", "", "", "",
+       /*Q0 - Q7*/     "", "", "", "", "", "", "", "",
+       /*R0 - R7*/     "", "", "", "", "", "", "", "",
+       /*S0 - S7*/     "", "", "", "FP_ID_BTN_SCM_N", "", "", "", "",
+       /*T0 - T7*/     "", "", "", "", "", "", "", "",
+       /*U0 - U7*/     "", "", "", "", "", "", "", "",
+       /*V0 - V7*/     "", "", "", "", "", "SMI", "", "",
+       /*W0 - W7*/     "", "", "", "", "", "", "", "",
+       /*X0 - X7*/     "", "", "", "", "", "", "", "",
+       /*Y0 - Y7*/     "", "", "", "", "", "", "", "",
+       /*Z0 - Z7*/     "FM_BMC_READY_N", "", "", "", "", "", "", "",
+       /*AA0 - AA7*/   "", "", "", "", "", "", "", "",
+       /*AB0 - AB7*/   "", "", "", "", "", "", "", "",
+       /*AC0 - AC7*/   "", "", "", "", "", "", "", "";
+};
+
+&sgpiom0 {
+       status = "okay";
+       ngpios = <128>;
+       bus-frequency = <48000>;
+       gpio-line-names =
+       /* SGPIO input lines */
+       /*IOA0-IOA7*/   "","", "SIO_POWER_GOOD","OA1", "XDP_PRST_N","", "","", "FM_SLPS3_PLD_N","", "FM_SLPS4_PLD_N","", "FM_BIOS_POST_CMPLT_BMC_N","", "FM_ADR_TRIGGER_N","OA7",
+       /*IOB0-IOB7*/   "FM_ADR_COMPLETE","", "FM_PMBUS_ALERT_B_EN","", "PSU0_PRESENT_N","", "PSU1_PRESENT_N","", "PSU0_VIN_BUF_GOOD","", "PSU01_VIN_BUF_GOOD","", "PWRGD_PS0_PWROK_R","", "PWRGD_PS1_PWROK_R","",
+       /*IOC0-IOC7*/   "PWRGD_PS_PWROK_PLD_R","", "CHASSIS_INTRUSION","", "BMC_MFG_MODE","", "FM_BMC_EN_DET_R","", "FM_ME_BT_DONE","", "CPU1_PRESENCE","", "CPU2_PRESENCE","", "IRQ_PSYS_CRIT_N","",
+       /*IOD0-IOD7*/   "","", "CPU1_THERMTRIP","", "CPU2_THERMTRIP","", "CPU1_MEM_THERM_EVENT","", "CPU2_MEM_THERM_EVENT","", "CPU1_VRHOT","", "CPU2_VRHOT","", "","",
+       /*IOE0-IOE7*/   "","", "CPU1_MEM_VRHOT","", "CPU2_MEM_VRHOT","", "","", "PCH_BMC_THERMTRIP","", "","", "","", "","",
+       /*IOF0-IOF7*/   "CPU_ERR0","", "CPU_ERR1","", "CPU_ERR2","", "","", "","", "CPU_CATERR","", "","", "","",
+       /*IOG0-IOG7*/   "","", "","", "","", "","", "","", "","", "","", "","",
+       /*IOH0-IOH7*/   "","", "FP_ID_BTN_R1_N","", "FP_RST_BTN_N","", "","", "","", "FP_PWR_BTN_PLD_N_R","", "","", "","",
+       /*IOI0-IOI7*/   "","", "","", "","", "","", "","", "","", "","", "","",
+       /*IOJ0-IOJ7*/   "","", "","", "","", "","", "","", "","", "","", "","",
+       /*IOK0-IOK7*/   "","", "","", "","", "","", "","", "","", "","", "","",
+       /*IOL0-IOL7*/   "","", "","", "","", "","", "","", "","", "","", "","",
+       /*IOM0-IOM7*/   "","", "","", "","", "","", "","", "","", "","", "","",
+       /*ION0-ION7*/   "","BMC_SW_HEARTBEAT_N_R", "","FP_LED_FAULT_N", "","FP_ID_LED_N", "","FM_BMC_RSTBTN_OUT_N", "","FM_THERMTRIP_DLY_LVC1_R_N", "","", "","RST_PCA9548_SENSOR_PLD_N", "","USB_OC1_REAR_N",
+       /*IOO0-IOO7*/   "","IRQ_TPM_SPI_N", "","", "","IRQ_PCH_SCI_WHEA_R_N", "","IRQ_BMC_PCH_NMI_R", "","H_CPU_NMI_LVC1_R_N", "","", "","", "","FM_JTAG_BMC_PLD_MUX_SEL",
+       /*IOP0-IOP7*/   "IP0","OP0", "","", "","", "","", "","", "","", "","", "IP7","OP7";
+};
+
+&adc0 {
+       vref = <2500>;
+       status = "okay";
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_adc0_default &pinctrl_adc1_default
+               &pinctrl_adc2_default &pinctrl_adc3_default
+               &pinctrl_adc4_default &pinctrl_adc5_default
+               &pinctrl_adc6_default &pinctrl_adc7_default>;
+};
+
+&adc1 {
+       vref = <2500>;
+       status = "okay";
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_adc8_default &pinctrl_adc9_default
+               &pinctrl_adc10_default &pinctrl_adc11_default
+               &pinctrl_adc12_default &pinctrl_adc13_default
+               &pinctrl_adc14_default &pinctrl_adc15_default>;
+};
+
+&mdio2 {
+       status = "okay";
+
+       ethphy2: ethernet-phy@0 {
+               compatible = "ethernet-phy-ieee802.3-c22";
+               reg = <0>;
+       };
+};
+
+&mac2 {
+       status = "okay";
+
+       phy-mode = "rgmii";
+       phy-handle = <&ethphy2>;
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_rgmii3_default>;
+};
+
+&mac3 {
+       status = "okay";
+
+       phy-mode = "rmii";
+       use-ncsi;
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_rmii4_default>;
+};
+
+&fmc {
+       status = "okay";
+
+       flash@0 {
+               status = "okay";
+               m25p,fast-read;
+               label = "bmc";
+               spi-max-frequency = <50000000>;
+#include "openbmc-flash-layout-64.dtsi"
+       };
+};
+
+&spi2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_spi2_default &pinctrl_spi2cs1_default
+               &pinctrl_spi2cs2_default>;
+       status = "okay";
+
+       flash@0 {
+               status = "okay";
+               m25p,fast-read;
+               label = "spi2:0";
+               spi-max-frequency = <50000000>;
+       };
+};
+
+&kcs1 {
+       status = "okay";
+       aspeed,lpc-io-reg = <0xCA0>;
+};
+
+&kcs2 {
+       status = "okay";
+       aspeed,lpc-io-reg = <0xCA8>;
+};
+
+&kcs3 {
+       status = "okay";
+       aspeed,lpc-io-reg = <0xCA2>;
+};
+
+&emmc_controller {
+       status = "okay";
+};
+
+&emmc {
+       non-removable;
+       bus-width = <4>;
+       max-frequency = <100000000>;
+};
+
+&vhub {
+       status = "okay";
+};
+
+&lpc_snoop {
+       status = "okay";
+       snoop-ports = <0x80>;
+};
+
+&uart1 {
+       status = "okay";
+};
+
+&uart2 {
+       status = "okay";
+};
+
+&uart4 {
+       status = "okay";
+};
+
+&uart5 {
+       status = "okay";
+};
+
+&uart_routing {
+       status = "okay";
+};
+
+&i2c0 {
+       status = "okay";
+
+       U34_PWR_ADC@48 {
+               compatible = "ti,ads7830";
+               reg = <0x48>;
+       };
+
+       U35_PWR_ADC@4b {
+               compatible = "ti,ads7830";
+               reg = <0x4b>;
+       };
+
+       i2c-switch@70 {
+               compatible = "nxp,pca9546";
+               reg = <0x70>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               i2c-mux-idle-disconnect;
+
+               SMB_HOST_DB2000_3V3AUX_SCL: i2c@0 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0>;
+               };
+
+               U12_PCA9546_CH1: i2c@1 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <1>;
+               };
+
+               SMB_HOST_DB800_B_SCL: i2c@2 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <2>;
+               };
+
+               SMB_HOST_DB800_C_SCL: i2c@3 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <3>;
+               };
+       };
+};
+
+&i2c1 {
+       status = "okay";
+
+       i2c-switch@59 {
+               compatible = "nxp,pca9848";
+               reg = <0x59>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               i2c-mux-idle-disconnect;
+
+               SMB_M2_P0_1V8AUX_SCL: i2c@0 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0>;
+               };
+
+               SMB_M2_P1_1V8AUX_SCL: i2c@1 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <1>;
+               };
+
+               SMB_CPU_PIROM_3V3AUX_SCL: i2c@2 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <2>;
+               };
+
+               SMB_TEMP_3V3AUX_SCL: i2c@3 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <3>;
+
+                       U163_tmp75@48 {
+                               compatible = "ti,tmp75";
+                               reg = <0x48>;
+                       };
+                       U114_tmp75@49 {
+                               compatible = "ti,tmp75";
+                               reg = <0x49>;
+                       };
+               };
+
+               SMB_IPMB_3V3AUX_SSDSB_SCL: i2c@4 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <4>;
+
+                       U4_tmp75@4c {
+                               compatible = "ti,tmp75";
+                               reg = <0x4c>;
+                       };
+                       U73_tmp75@4d {
+                               compatible = "ti,tmp75";
+                               reg = <0x4d>;
+                       };
+               };
+
+               SMB_IPMB_3V3AUX_SCL: i2c@5 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <5>;
+
+                       U190_fru@51 {
+                               compatible = "atmel,24c128";
+                               reg = <0x51>;
+                               pagesize = <32>;
+                       };
+               };
+
+               SMB_FB_SCL: i2c@7 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <7>;
+
+                       i2c-switch@77 {
+                               compatible = "nxp,pca9546";
+                               reg = <0x77>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               i2c-mux-idle-disconnect;
+
+                               SMB_IOEXP_SCL: i2c@0 {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       reg = <0>;
+                               };
+
+                               SMB_PROGRAM_SCL: i2c@1 {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       reg = <1>;
+                               };
+
+                               SMB_FB_SCL_CH2: i2c@2 {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       reg = <2>;
+                               };
+
+                               SMB_FAN_SENSE_SCL: i2c@3 {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       reg = <3>;
+
+                                       Current_Meter_U2@45 {
+                                               compatible = "ti,ina219";
+                                               reg = <0x45>;
+                                               shunt-resistor = <1000>; /* = 1 mOhm */
+                                       };
+
+                                       Current_Meter_U3@44 {
+                                               compatible = "ti,ina219";
+                                               reg = <0x44>;
+                                               shunt-resistor = <1000>; /* = 1 mOhm */
+                                       };
+
+                                       TEMP_sensor_U2@4b {
+                                               compatible = "ti,tmp75";
+                                               reg = <0x4b>;
+                                       };
+                               };
+                       };
+               };
+       };
+};
+
+&i2c2 {
+       status = "okay";
+       bus-frequency = <400000>;
+
+       ipmb@10 {
+               compatible = "ipmb-dev";
+               reg = <(0x10 | I2C_OWN_SLAVE_ADDRESS)>;
+               i2c-protocol;
+       };
+};
+
+&i2c3 {
+       status = "okay";
+
+       /* MB FRU (U173) @ 0xA2 */
+       mb_fru: mb_fru@51 {
+               compatible = "atmel,24c128";
+               reg = <0x51>;
+               pagesize = <32>;
+       };
+
+       /* FP_U1 Inlet */
+       FP_U1_tmp75@4a {
+               compatible = "ti,tmp75";
+               reg = <0x4a>;
+       };
+
+       FP_U4_fru@52 {
+               compatible = "atmel,24c02";
+               reg = <0x52>;
+               pagesize = <16>;
+       };
+};
+
+&i2c4 {
+       status = "okay";
+};
+
+&i2c5 {
+       status = "okay";
+};
+
+&i2c6 {
+       status = "okay";
+
+       i2c-switch@77 {
+               compatible = "nxp,pca9548";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0x77>;
+               i2c-mux-idle-disconnect;
+
+               U197_PCA9546_CH0: i2c@0 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0>;
+               };
+
+               U197_PCA9546_CH1: i2c@1 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <1>;
+
+                       cpu0_pvccin@60 {
+                               compatible = "isil,raa229004";
+                               reg = <0x60>;
+                       };
+
+                       cpu0_pvccinfaon@61 {
+                               compatible = "isil,isl69260";
+                               reg = <0x61>;
+                       };
+
+                       cpu0_pvccd_hv@63 {
+                               compatible = "isil,isl69260";
+                               reg = <0x63>;
+                       };
+               };
+
+               U197_PCA9546_CH2: i2c@2 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <2>;
+
+                       cpu1_pvccin@72 {
+                               compatible = "isil,raa229004";
+                               reg = <0x72>;
+                       };
+
+                       cpu1_pvccinfaon@74 {
+                               compatible = "isil,isl69260";
+                               reg = <0x74>;
+                       };
+
+                       cpu1_pvccd_hv@76 {
+                               compatible = "isil,isl69260";
+                               reg = <0x76>;
+                       };
+               };
+
+               U197_PCA9546_CH3: i2c@3 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <3>;
+               };
+       };
+};
+
+&i2c7 {
+       status = "okay";
+
+       i2c-switch@75 {
+               compatible = "nxp,pca9546";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0x75>;
+               i2c-mux-idle-disconnect;
+
+               SMB_OCP_SFF_3V3AUX_SCL: i2c@0 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0>;
+               };
+
+               SMB_OCP_LFF_3V3AUX_SCL: i2c@1 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <1>;
+               };
+       };
+};
+
+&i2c8 {
+       status = "okay";
+};
+
+&i2c9 {
+       status = "okay";
+};
+
+&i2c11 {
+       status = "okay";
+};
+
+&i2c14 {
+       status = "okay";
+
+       /* SCM FRU (U19) @ 0xA2 */
+       scm_fru: scm_fru@51 {
+               compatible = "atmel,24c128";
+               reg = <0x51>;
+               pagesize = <32>;
+       };
+
+       scm_tmp75_u4@4a {
+               compatible = "ti,tmp75";
+               reg = <0x4a>;
+       };
+};
+
+&i2c15 {
+       status = "okay";
+};
index ccf9e22..08685a1 100644 (file)
        status = "okay";
 };
 
+&can0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_can0_default>;
+       status = "okay";
+};
+
+&can1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_can1_default>;
+       status = "okay";
+};
+
 &cpu0 {
        cpu-supply = <&vddcpu>;
 };
 
                                        regulator-state-standby {
                                                regulator-on-in-suspend;
+                                               regulator-suspend-microvolt = <3300000>;
                                                regulator-mode = <4>;
                                        };
 
 
                                        regulator-state-standby {
                                                regulator-on-in-suspend;
+                                               regulator-suspend-voltage = <1150000>;
                                                regulator-mode = <4>;
                                        };
 
 
                                vddcpu: VDD_OTHER {
                                        regulator-name = "VDD_OTHER";
-                                       regulator-min-microvolt = <1125000>;
+                                       regulator-min-microvolt = <1050000>;
                                        regulator-max-microvolt = <1850000>;
                                        regulator-initial-mode = <2>;
                                        regulator-allowed-modes = <2>, <4>;
 
                                        regulator-state-standby {
                                                regulator-on-in-suspend;
+                                               regulator-suspend-voltage = <1050000>;
                                                regulator-mode = <4>;
                                        };
 
                                        regulator-always-on;
 
                                        regulator-state-standby {
+                                               regulator-suspend-voltage = <1800000>;
                                                regulator-on-in-suspend;
                                        };
 
                                        regulator-max-microvolt = <3700000>;
 
                                        regulator-state-standby {
+                                               regulator-suspend-voltage = <1800000>;
                                                regulator-on-in-suspend;
                                        };
 
 };
 
 &pioA {
+
+       pinctrl_can0_default: can0_default {
+               pinmux = <PIN_PD12__CANTX0>,
+                        <PIN_PD13__CANRX0 >;
+               bias-disable;
+       };
+
+       pinctrl_can1_default: can1_default {
+               pinmux = <PIN_PD14__CANTX1>,
+                        <PIN_PD15__CANRX1 >;
+               bias-disable;
+       };
+
        pinctrl_flx0_default: flx0_default {
                pinmux = <PIN_PE3__FLEXCOM0_IO0>,
                         <PIN_PE4__FLEXCOM0_IO1>,
diff --git a/arch/arm/boot/dts/en7523-evb.dts b/arch/arm/boot/dts/en7523-evb.dts
new file mode 100644 (file)
index 0000000..a8d8bb0
--- /dev/null
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+/dts-v1/;
+
+/* Bootloader installs ATF here */
+/memreserve/ 0x80000000 0x200000;
+
+#include "en7523.dtsi"
+
+/ {
+       model = "Airoha EN7523 Evaluation Board";
+       compatible = "airoha,en7523-evb", "airoha,en7523";
+
+       aliases {
+               serial0 = &uart1;
+       };
+
+       chosen {
+               bootargs = "console=ttyS0,115200 earlycon";
+               stdout-path = "serial0:115200n8";
+               linux,usable-memory-range = <0x80200000 0x1fe00000>;
+       };
+
+       memory@80000000 {
+               device_type = "memory";
+               reg = <0x80000000 0x20000000>;
+       };
+};
+
+&gpio0 {
+       status = "okay";
+};
+
+&gpio1 {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/en7523.dtsi b/arch/arm/boot/dts/en7523.dtsi
new file mode 100644 (file)
index 0000000..36597f5
--- /dev/null
@@ -0,0 +1,138 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+       interrupt-parent = <&gic>;
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       reserved-memory {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               npu_binary@84000000 {
+                       no-map;
+                       reg = <0x84000000 0xA00000>;
+               };
+
+               npu_flag@84B0000 {
+                       no-map;
+                       reg = <0x84B00000 0x100000>;
+               };
+
+               npu_pkt@85000000 {
+                       no-map;
+                       reg = <0x85000000 0x1A00000>;
+               };
+
+               npu_phyaddr@86B00000 {
+                       no-map;
+                       reg = <0x86B00000 0x100000>;
+               };
+
+               npu_rxdesc@86D00000 {
+                       no-map;
+                       reg = <0x86D00000 0x100000>;
+               };
+       };
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu-map {
+                       cluster0 {
+                               core0 {
+                                       cpu = <&cpu0>;
+                               };
+                               core1 {
+                                       cpu = <&cpu1>;
+                               };
+                       };
+               };
+
+               cpu0: cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       reg = <0x0>;
+                       enable-method = "psci";
+                       clock-frequency = <80000000>;
+                       next-level-cache = <&L2_0>;
+               };
+
+               cpu1: cpu@1 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       reg = <0x1>;
+                       enable-method = "psci";
+                       clock-frequency = <80000000>;
+                       next-level-cache = <&L2_0>;
+               };
+
+               L2_0: l2-cache0 {
+                       compatible = "cache";
+               };
+       };
+
+       gic: interrupt-controller@9000000 {
+               compatible = "arm,gic-v3";
+               interrupt-controller;
+               #interrupt-cells = <3>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               reg = <0x09000000 0x20000>,
+                     <0x09080000 0x80000>,
+                     <0x09400000 0x2000>,
+                     <0x09500000 0x2000>,
+                     <0x09600000 0x20000>;
+               interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_LOW>;
+       };
+
+       timer {
+               compatible = "arm,armv8-timer";
+               interrupt-parent = <&gic>;
+               interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
+                            <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
+                            <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
+                            <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+       };
+
+       uart1: serial@1fbf0000 {
+               compatible = "ns16550";
+               reg = <0x1fbf0000 0x30>;
+               reg-io-width = <4>;
+               reg-shift = <2>;
+               interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
+               clock-frequency = <1843200>;
+               status = "okay";
+       };
+
+       gpio0: gpio@1fbf0200 {
+               compatible = "airoha,en7523-gpio";
+               reg = <0x1fbf0204 0x4>,
+                     <0x1fbf0200 0x4>,
+                     <0x1fbf0220 0x4>,
+                     <0x1fbf0214 0x4>;
+               gpio-controller;
+               #gpio-cells = <2>;
+       };
+
+       gpio1: gpio@1fbf0270 {
+               compatible = "airoha,en7523-gpio";
+               reg = <0x1fbf0270 0x4>,
+                     <0x1fbf0260 0x4>,
+                     <0x1fbf0264 0x4>,
+                     <0x1fbf0278 0x4>;
+               gpio-controller;
+               #gpio-cells = <2>;
+       };
+};
index 829c05b..7b42962 100644 (file)
 };
 
 &pinctrl_1 {
-       bten: bten {
+       bten: bten-pins {
                samsung,pins ="gpx1-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
                samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_DOWN>;
        };
 
-       wlanen: wlanen {
+       wlanen: wlanen-pins {
                samsung,pins = "gpx2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-val = <1>;
        };
 
-       s2mps14_irq: s2mps14-irq {
+       s2mps14_irq: s2mps14-irq-pins {
                samsung,pins = "gpx3-5";
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       bthostwake: bthostwake {
+       bthostwake: bthostwake-pins {
                samsung,pins = "gpx3-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       btwake: btwake {
+       btwake: btwake-pins {
                samsung,pins = "gpx3-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
index 8b41a9d..02a9dc4 100644 (file)
@@ -69,7 +69,7 @@
                        reg = <0x25>;
                        wakeup-source;
 
-                       muic: max77836-muic {
+                       extcon {
                                compatible = "maxim,max77836-muic";
                        };
 
index dff3c6e..cc30d15 100644 (file)
 #include <dt-bindings/pinctrl/samsung.h>
 
 #define PIN_IN(_pin, _pull, _drv)                                      \
-       _pin {                                                          \
+       pin- ## _pin {                                                  \
                samsung,pins = #_pin;                                   \
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;         \
                samsung,pin-pud = <EXYNOS_PIN_PULL_ ##_pull>;           \
                samsung,pin-drv = <EXYNOS4_PIN_DRV_ ##_drv>;            \
        }
 
-#define PIN_OUT(_pin, _drv)                                            \
-       _pin {                                                          \
-               samsung,pins = #_pin;                                   \
-               samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;        \
-               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;               \
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_ ##_drv>;            \
-       }
-
-#define PIN_OUT_SET(_pin, _val, _drv)                                  \
-       _pin {                                                          \
-               samsung,pins = #_pin;                                   \
-               samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;        \
-               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;               \
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_ ##_drv>;            \
-               samsung,pin-val = <_val>;                               \
-       }
-
-#define PIN_CFG(_pin, _sel, _pull, _drv)                               \
-       _pin {                                                          \
-               samsung,pins = #_pin;                                   \
-               samsung,pin-function = <_sel>;                          \
-               samsung,pin-pud = <EXYNOS_PIN_PULL_ ##_pull>;           \
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_ ##_drv>;            \
-       }
-
 #define PIN_SLP(_pin, _mode, _pull)                                    \
-       _pin {                                                          \
+       pin- ## _pin {                                                  \
                samsung,pins = #_pin;                                   \
                samsung,pin-con-pdn = <EXYNOS_PIN_PDN_ ##_mode>;        \
                samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_ ##_pull>;       \
        }
 
 &pinctrl_0 {
-       gpa0: gpa0 {
+       gpa0: gpa0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -60,7 +35,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpa1: gpa1 {
+       gpa1: gpa1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -68,7 +43,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpb: gpb {
+       gpb: gpb-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -76,7 +51,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpc0: gpc0 {
+       gpc0: gpc0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -84,7 +59,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpc1: gpc1 {
+       gpc1: gpc1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -92,7 +67,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpd0: gpd0 {
+       gpd0: gpd0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpd1: gpd1 {
+       gpd1: gpd1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       uart0_data: uart0-data {
+       uart0_data: uart0-data-pins {
                samsung,pins = "gpa0-0", "gpa0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart0_fctl: uart0-fctl {
+       uart0_fctl: uart0-fctl-pins {
                samsung,pins = "gpa0-2", "gpa0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart1_data: uart1-data {
+       uart1_data: uart1-data-pins {
                samsung,pins = "gpa0-4", "gpa0-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart1_fctl: uart1-fctl {
+       uart1_fctl: uart1-fctl-pins {
                samsung,pins = "gpa0-6", "gpa0-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c2_bus: i2c2-bus {
+       i2c2_bus: i2c2-bus-pins {
                samsung,pins = "gpa0-6", "gpa0-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart2_data: uart2-data {
+       uart2_data: uart2-data-pins {
                samsung,pins = "gpa1-0", "gpa1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c3_bus: i2c3-bus {
+       i2c3_bus: i2c3-bus-pins {
                samsung,pins = "gpa1-2", "gpa1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       spi0_bus: spi0-bus {
+       spi0_bus: spi0-bus-pins {
                samsung,pins = "gpb-0", "gpb-2", "gpb-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c4_bus: i2c4-bus {
+       i2c4_bus: i2c4-bus-pins {
                samsung,pins = "gpb-0", "gpb-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       spi1_bus: spi1-bus {
+       spi1_bus: spi1-bus-pins {
                samsung,pins = "gpb-4", "gpb-6", "gpb-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c5_bus: i2c5-bus {
+       i2c5_bus: i2c5-bus-pins {
                samsung,pins = "gpb-2", "gpb-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2s2_bus: i2s2-bus {
+       i2s2_bus: i2s2-bus-pins {
                samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3",
                                "gpc1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pcm2_bus: pcm2-bus {
+       pcm2_bus: pcm2-bus-pins {
                samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3",
                                "gpc1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c6_bus: i2c6-bus {
+       i2c6_bus: i2c6-bus-pins {
                samsung,pins = "gpc1-3", "gpc1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pwm0_out: pwm0-out {
+       pwm0_out: pwm0-out-pins {
                samsung,pins = "gpd0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pwm1_out: pwm1-out {
+       pwm1_out: pwm1-out-pins {
                samsung,pins = "gpd0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c7_bus: i2c7-bus {
+       i2c7_bus: i2c7-bus-pins {
                samsung,pins = "gpd0-2", "gpd0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pwm2_out: pwm2-out {
+       pwm2_out: pwm2-out-pins {
                samsung,pins = "gpd0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pwm3_out: pwm3-out {
+       pwm3_out: pwm3-out-pins {
                samsung,pins = "gpd0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c0_bus: i2c0-bus {
+       i2c0_bus: i2c0-bus-pins {
                samsung,pins = "gpd1-0", "gpd1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       mipi0_clk: mipi0-clk {
+       mipi0_clk: mipi0-clk-pins {
                samsung,pins = "gpd1-0", "gpd1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c1_bus: i2c1-bus {
+       i2c1_bus: i2c1-bus-pins {
                samsung,pins = "gpd1-2", "gpd1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
 };
 
 &pinctrl_1 {
-       gpe0: gpe0 {
+       gpe0: gpe0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpe1: gpe1 {
+       gpe1: gpe1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpe2: gpe2 {
+       gpe2: gpe2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpk0: gpk0 {
+       gpk0: gpk0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpk1: gpk1 {
+       gpk1: gpk1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpk2: gpk2 {
+       gpk2: gpk2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpl0: gpl0 {
+       gpl0: gpl0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpm0: gpm0 {
+       gpm0: gpm0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpm1: gpm1 {
+       gpm1: gpm1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpm2: gpm2 {
+       gpm2: gpm2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpm3: gpm3 {
+       gpm3: gpm3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpm4: gpm4 {
+       gpm4: gpm4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpx0: gpx0 {
+       gpx0: gpx0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpx1: gpx1 {
+       gpx1: gpx1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpx2: gpx2 {
+       gpx2: gpx2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpx3: gpx3 {
+       gpx3: gpx3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       sd0_clk: sd0-clk {
+       sd0_clk: sd0-clk-pins {
                samsung,pins = "gpk0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_cmd: sd0-cmd {
+       sd0_cmd: sd0-cmd-pins {
                samsung,pins = "gpk0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_cd: sd0-cd {
+       sd0_cd: sd0-cd-pins {
                samsung,pins = "gpk0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_rdqs: sd0-rdqs {
+       sd0_rdqs: sd0-rdqs-pins {
                samsung,pins = "gpk0-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_bus1: sd0-bus-width1 {
+       sd0_bus1: sd0-bus-width1-pins {
                samsung,pins = "gpk0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_bus4: sd0-bus-width4 {
+       sd0_bus4: sd0-bus-width4-pins {
                samsung,pins = "gpk0-4", "gpk0-5", "gpk0-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_bus8: sd0-bus-width8 {
+       sd0_bus8: sd0-bus-width8-pins {
                samsung,pins = "gpl0-0", "gpl0-1", "gpl0-2", "gpl0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd1_clk: sd1-clk {
+       sd1_clk: sd1-clk-pins {
                samsung,pins = "gpk1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd1_cmd: sd1-cmd {
+       sd1_cmd: sd1-cmd-pins {
                samsung,pins = "gpk1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd1_cd: sd1-cd {
+       sd1_cd: sd1-cd-pins {
                samsung,pins = "gpk1-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd1_bus1: sd1-bus-width1 {
+       sd1_bus1: sd1-bus-width1-pins {
                samsung,pins = "gpk1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd1_bus4: sd1-bus-width4 {
+       sd1_bus4: sd1-bus-width4-pins {
                samsung,pins = "gpk1-4", "gpk1-5", "gpk1-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_clk: sd2-clk {
+       sd2_clk: sd2-clk-pins {
                samsung,pins = "gpk2-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_cmd: sd2-cmd {
+       sd2_cmd: sd2-cmd-pins {
                samsung,pins = "gpk2-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_cd: sd2-cd {
+       sd2_cd: sd2-cd-pins {
                samsung,pins = "gpk2-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_bus1: sd2-bus-width1 {
+       sd2_bus1: sd2-bus-width1-pins {
                samsung,pins = "gpk2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_bus4: sd2-bus-width4 {
+       sd2_bus4: sd2-bus-width4-pins {
                samsung,pins = "gpk2-4", "gpk2-5", "gpk2-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       cam_port_b_io: cam-port-b-io {
+       cam_port_b_io: cam-port-b-io-pins {
                samsung,pins = "gpm0-0", "gpm0-1", "gpm0-2", "gpm0-3",
                                "gpm0-4", "gpm0-5", "gpm0-6", "gpm0-7",
                                "gpm1-0", "gpm1-1", "gpm2-0", "gpm2-1";
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       cam_port_b_clk_active: cam-port-b-clk-active {
+       cam_port_b_clk_active: cam-port-b-clk-active-pins {
                samsung,pins = "gpm2-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       cam_port_b_clk_idle: cam-port-b-clk-idle {
+       cam_port_b_clk_idle: cam-port-b-clk-idle-pins {
                samsung,pins = "gpm2-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       fimc_is_i2c0: fimc-is-i2c0 {
+       fimc_is_i2c0: fimc-is-i2c0-pins {
                samsung,pins = "gpm4-0", "gpm4-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       fimc_is_i2c1: fimc-is-i2c1 {
+       fimc_is_i2c1: fimc-is-i2c1-pins {
                samsung,pins = "gpm4-2", "gpm4-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       fimc_is_uart: fimc-is-uart {
+       fimc_is_uart: fimc-is-uart-pins {
                samsung,pins = "gpm3-5", "gpm3-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
index 5f7f8fe..6d2c7bb 100644 (file)
@@ -70,7 +70,7 @@
                        reg = <0x25>;
                        wakeup-source;
 
-                       muic: max77836-muic {
+                       extcon {
                                compatible = "maxim,max77836-muic";
                        };
 
index a10b789..ae64431 100644 (file)
                        status = "disabled";
                };
 
-               pdma0: pdma@12680000 {
+               pdma0: dma-controller@12680000 {
                        compatible = "arm,pl330", "arm,primecell";
                        reg = <0x12680000 0x1000>;
                        interrupts = <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>;
                        #dma-requests = <32>;
                };
 
-               pdma1: pdma@12690000 {
+               pdma1: dma-controller@12690000 {
                        compatible = "arm,pl330", "arm,primecell";
                        reg = <0x12690000 0x1000>;
                        interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_HIGH>;
index eab77a6..e81b3ee 100644 (file)
                        status = "disabled";
                };
 
-               pdma0: pdma@12680000 {
+               pdma0: dma-controller@12680000 {
                        compatible = "arm,pl330", "arm,primecell";
                        reg = <0x12680000 0x1000>;
                        interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
                        #dma-requests = <32>;
                };
 
-               pdma1: pdma@12690000 {
+               pdma1: dma-controller@12690000 {
                        compatible = "arm,pl330", "arm,primecell";
                        reg = <0x12690000 0x1000>;
                        interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
                        #dma-requests = <32>;
                };
 
-               mdma1: mdma@12850000 {
+               mdma1: dma-controller@12850000 {
                        compatible = "arm,pl330", "arm,primecell";
                        reg = <0x12850000 0x1000>;
                        interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
index 3389405..3c0a18b 100644 (file)
        pinctrl-names = "default";
        pinctrl-0 = <&sleep0>;
 
-       sleep0: sleep-states {
-               gpa0-0 {
+       sleep0: sleep-state {
+               gpa0-0-pin {
                        samsung,pins = "gpa0-0";
                        samsung,pin-con-pdn = <EXYNOS_PIN_PDN_INPUT>;
                        samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_NONE>;
                };
 
-               gpa0-1 {
+               gpa0-1-pin {
                        samsung,pins = "gpa0-1";
                        samsung,pin-con-pdn = <EXYNOS_PIN_PDN_OUT0>;
                        samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_NONE>;
                };
 
-               gpa0-2 {
+               gpa0-2-pin {
                        samsung,pins = "gpa0-2";
                        samsung,pin-con-pdn = <EXYNOS_PIN_PDN_INPUT>;
                        samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_NONE>;
                };
 
-               gpa0-3 {
+               gpa0-3-pin {
                        samsung,pins = "gpa0-3";
                        samsung,pin-con-pdn = <EXYNOS_PIN_PDN_OUT1>;
                        samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_NONE>;
 };
 
 &pinctrl_1 {
-       mhl_int: mhl-int {
+       mhl_int: mhl-int-pins {
                samsung,pins = "gpf3-5";
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       i2c_mhl_bus: i2c-mhl-bus {
+       i2c_mhl_bus: i2c-mhl-bus-pins {
                samsung,pins = "gpf0-4", "gpf0-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       usb_sel: usb-sel {
+       usb_sel: usb-sel-pins {
                samsung,pins = "gpl0-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-val = <0>;
        };
 
-       bt_en: bt-en {
+       bt_en: bt-en-pins {
                samsung,pins = "gpl0-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-val = <0>;
        };
 
-       bt_res: bt-res {
+       bt_res: bt-res-pins {
                samsung,pins = "gpl1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-val = <0>;
        };
 
-       otg_gp: otg-gp {
+       otg_gp: otg-gp-pins {
                samsung,pins = "gpx3-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-val = <0>;
        };
 
-       mag_mhl_gpio: mag-mhl {
+       mag_mhl_gpio: mag-mhl-pins {
                samsung,pins = "gpd0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       max8997_irq: max8997-irq {
+       max8997_irq: max8997-irq-pins {
                samsung,pins = "gpx0-7";
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       max17042_fuel_irq: max17042-fuel-irq {
+       max17042_fuel_irq: max17042-fuel-irq-pins {
                samsung,pins = "gpx2-3";
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       tsp224_irq: tsp224-irq {
+       tsp224_irq: tsp224-irq-pins {
                samsung,pins = "gpx0-4";
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
        };
index 435fda6..a08ce2f 100644 (file)
 };
 
 &pinctrl_1 {
-       max8997_irq: max8997-irq {
+       max8997_irq: max8997-irq-pins {
                samsung,pins = "gpx0-3", "gpx0-4";
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
index 520c593..6373009 100644 (file)
@@ -14,7 +14,7 @@
 #include <dt-bindings/pinctrl/samsung.h>
 
 &pinctrl_0 {
-       gpa0: gpa0 {
+       gpa0: gpa0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -22,7 +22,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpa1: gpa1 {
+       gpa1: gpa1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -30,7 +30,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpb: gpb {
+       gpb: gpb-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -38,7 +38,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpc0: gpc0 {
+       gpc0: gpc0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -46,7 +46,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpc1: gpc1 {
+       gpc1: gpc1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -54,7 +54,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpd0: gpd0 {
+       gpd0: gpd0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -62,7 +62,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpd1: gpd1 {
+       gpd1: gpd1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -70,7 +70,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpe0: gpe0 {
+       gpe0: gpe0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -78,7 +78,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpe1: gpe1 {
+       gpe1: gpe1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -86,7 +86,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpe2: gpe2 {
+       gpe2: gpe2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -94,7 +94,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpe3: gpe3 {
+       gpe3: gpe3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpe4: gpe4 {
+       gpe4: gpe4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf0: gpf0 {
+       gpf0: gpf0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf1: gpf1 {
+       gpf1: gpf1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf2: gpf2 {
+       gpf2: gpf2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf3: gpf3 {
+       gpf3: gpf3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       uart0_data: uart0-data {
+       uart0_data: uart0-data-pins {
                samsung,pins = "gpa0-0", "gpa0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart0_fctl: uart0-fctl {
+       uart0_fctl: uart0-fctl-pins {
                samsung,pins = "gpa0-2", "gpa0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart1_data: uart1-data {
+       uart1_data: uart1-data-pins {
                samsung,pins = "gpa0-4", "gpa0-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart1_fctl: uart1-fctl {
+       uart1_fctl: uart1-fctl-pins {
                samsung,pins = "gpa0-6", "gpa0-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c2_bus: i2c2-bus {
+       i2c2_bus: i2c2-bus-pins {
                samsung,pins = "gpa0-6", "gpa0-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart2_data: uart2-data {
+       uart2_data: uart2-data-pins {
                samsung,pins = "gpa1-0", "gpa1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart2_fctl: uart2-fctl {
+       uart2_fctl: uart2-fctl-pins {
                samsung,pins = "gpa1-2", "gpa1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart_audio_a: uart-audio-a {
+       uart_audio_a: uart-audio-a-pins {
                samsung,pins = "gpa1-0", "gpa1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c3_bus: i2c3-bus {
+       i2c3_bus: i2c3-bus-pins {
                samsung,pins = "gpa1-2", "gpa1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart3_data: uart3-data {
+       uart3_data: uart3-data-pins {
                samsung,pins = "gpa1-4", "gpa1-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart_audio_b: uart-audio-b {
+       uart_audio_b: uart-audio-b-pins {
                samsung,pins = "gpa1-4", "gpa1-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       spi0_bus: spi0-bus {
+       spi0_bus: spi0-bus-pins {
                samsung,pins = "gpb-0", "gpb-2", "gpb-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c4_bus: i2c4-bus {
+       i2c4_bus: i2c4-bus-pins {
                samsung,pins = "gpb-2", "gpb-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       spi1_bus: spi1-bus {
+       spi1_bus: spi1-bus-pins {
                samsung,pins = "gpb-4", "gpb-6", "gpb-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c5_bus: i2c5-bus {
+       i2c5_bus: i2c5-bus-pins {
                samsung,pins = "gpb-6", "gpb-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2s1_bus: i2s1-bus {
+       i2s1_bus: i2s1-bus-pins {
                samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3",
                                "gpc0-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pcm1_bus: pcm1-bus {
+       pcm1_bus: pcm1-bus-pins {
                samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3",
                                "gpc0-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       ac97_bus: ac97-bus {
+       ac97_bus: ac97-bus-pins {
                samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3",
                                "gpc0-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2s2_bus: i2s2-bus {
+       i2s2_bus: i2s2-bus-pins {
                samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3",
                                "gpc1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pcm2_bus: pcm2-bus {
+       pcm2_bus: pcm2-bus-pins {
                samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3",
                                "gpc1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       spdif_bus: spdif-bus {
+       spdif_bus: spdif-bus-pins {
                samsung,pins = "gpc1-0", "gpc1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c6_bus: i2c6-bus {
+       i2c6_bus: i2c6-bus-pins {
                samsung,pins = "gpc1-3", "gpc1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       spi2_bus: spi2-bus {
+       spi2_bus: spi2-bus-pins {
                samsung,pins = "gpc1-1", "gpc1-2", "gpc1-3", "gpc1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_5>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c7_bus: i2c7-bus {
+       i2c7_bus: i2c7-bus-pins {
                samsung,pins = "gpd0-2", "gpd0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c0_bus: i2c0-bus {
+       i2c0_bus: i2c0-bus-pins {
                samsung,pins = "gpd1-0", "gpd1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c1_bus: i2c1-bus {
+       i2c1_bus: i2c1-bus-pins {
                samsung,pins = "gpd1-2", "gpd1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pwm0_out: pwm0-out {
+       pwm0_out: pwm0-out-pins {
                samsung,pins = "gpd0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pwm1_out: pwm1-out {
+       pwm1_out: pwm1-out-pins {
                samsung,pins = "gpd0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pwm2_out: pwm2-out {
+       pwm2_out: pwm2-out-pins {
                samsung,pins = "gpd0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pwm3_out: pwm3-out {
+       pwm3_out: pwm3-out-pins {
                samsung,pins = "gpd0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       lcd_ctrl: lcd-ctrl {
+       lcd_ctrl: lcd-ctrl-pins {
                samsung,pins = "gpd0-0", "gpd0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       lcd_sync: lcd-sync {
+       lcd_sync: lcd-sync-pins {
                samsung,pins = "gpf0-0", "gpf0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       lcd_en: lcd-en {
+       lcd_en: lcd-en-pins {
                samsung,pins = "gpe3-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       lcd_clk: lcd-clk {
+       lcd_clk: lcd-clk-pins {
                samsung,pins = "gpf0-0", "gpf0-1", "gpf0-2", "gpf0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       lcd_data16: lcd-data-width16 {
+       lcd_data16: lcd-data-width16-pins {
                samsung,pins = "gpf0-7", "gpf1-0", "gpf1-1", "gpf1-2",
                                "gpf1-3", "gpf1-6", "gpf1-7", "gpf2-0",
                                "gpf2-1", "gpf2-2", "gpf2-3", "gpf2-7",
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       lcd_data18: lcd-data-width18 {
+       lcd_data18: lcd-data-width18-pins {
                samsung,pins = "gpf0-6", "gpf0-7", "gpf1-0", "gpf1-1",
                                "gpf1-2", "gpf1-3", "gpf1-6", "gpf1-7",
                                "gpf2-0", "gpf2-1", "gpf2-2", "gpf2-3",
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       lcd_data24: lcd-data-width24 {
+       lcd_data24: lcd-data-width24-pins {
                samsung,pins = "gpf0-4", "gpf0-5", "gpf0-6", "gpf0-7",
                                "gpf1-0", "gpf1-1", "gpf1-2", "gpf1-3",
                                "gpf1-4", "gpf1-5", "gpf1-6", "gpf1-7",
 };
 
 &pinctrl_1 {
-       gpj0: gpj0 {
+       gpj0: gpj0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpj1: gpj1 {
+       gpj1: gpj1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpk0: gpk0 {
+       gpk0: gpk0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpk1: gpk1 {
+       gpk1: gpk1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpk2: gpk2 {
+       gpk2: gpk2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpk3: gpk3 {
+       gpk3: gpk3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpl0: gpl0 {
+       gpl0: gpl0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpl1: gpl1 {
+       gpl1: gpl1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpl2: gpl2 {
+       gpl2: gpl2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpy0: gpy0 {
+       gpy0: gpy0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy1: gpy1 {
+       gpy1: gpy1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy2: gpy2 {
+       gpy2: gpy2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy3: gpy3 {
+       gpy3: gpy3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy4: gpy4 {
+       gpy4: gpy4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy5: gpy5 {
+       gpy5: gpy5-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy6: gpy6 {
+       gpy6: gpy6-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpx0: gpx0 {
+       gpx0: gpx0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpx1: gpx1 {
+       gpx1: gpx1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpx2: gpx2 {
+       gpx2: gpx2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpx3: gpx3 {
+       gpx3: gpx3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       sd0_clk: sd0-clk {
+       sd0_clk: sd0-clk-pins {
                samsung,pins = "gpk0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_cmd: sd0-cmd {
+       sd0_cmd: sd0-cmd-pins {
                samsung,pins = "gpk0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_cd: sd0-cd {
+       sd0_cd: sd0-cd-pins {
                samsung,pins = "gpk0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_bus1: sd0-bus-width1 {
+       sd0_bus1: sd0-bus-width1-pins {
                samsung,pins = "gpk0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_bus4: sd0-bus-width4 {
+       sd0_bus4: sd0-bus-width4-pins {
                samsung,pins = "gpk0-3", "gpk0-4", "gpk0-5", "gpk0-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_bus8: sd0-bus-width8 {
+       sd0_bus8: sd0-bus-width8-pins {
                samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd4_clk: sd4-clk {
+       sd4_clk: sd4-clk-pins {
                samsung,pins = "gpk0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd4_cmd: sd4-cmd {
+       sd4_cmd: sd4-cmd-pins {
                samsung,pins = "gpk0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd4_cd: sd4-cd {
+       sd4_cd: sd4-cd-pins {
                samsung,pins = "gpk0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd4_bus1: sd4-bus-width1 {
+       sd4_bus1: sd4-bus-width1-pins {
                samsung,pins = "gpk0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd4_bus4: sd4-bus-width4 {
+       sd4_bus4: sd4-bus-width4-pins {
                samsung,pins = "gpk0-3", "gpk0-4", "gpk0-5", "gpk0-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd4_bus8: sd4-bus-width8 {
+       sd4_bus8: sd4-bus-width8-pins {
                samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd1_clk: sd1-clk {
+       sd1_clk: sd1-clk-pins {
                samsung,pins = "gpk1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd1_cmd: sd1-cmd {
+       sd1_cmd: sd1-cmd-pins {
                samsung,pins = "gpk1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd1_cd: sd1-cd {
+       sd1_cd: sd1-cd-pins {
                samsung,pins = "gpk1-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd1_bus1: sd1-bus-width1 {
+       sd1_bus1: sd1-bus-width1-pins {
                samsung,pins = "gpk1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd1_bus4: sd1-bus-width4 {
+       sd1_bus4: sd1-bus-width4-pins {
                samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_clk: sd2-clk {
+       sd2_clk: sd2-clk-pins {
                samsung,pins = "gpk2-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_cmd: sd2-cmd {
+       sd2_cmd: sd2-cmd-pins {
                samsung,pins = "gpk2-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_cd: sd2-cd {
+       sd2_cd: sd2-cd-pins {
                samsung,pins = "gpk2-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_bus1: sd2-bus-width1 {
+       sd2_bus1: sd2-bus-width1-pins {
                samsung,pins = "gpk2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_bus4: sd2-bus-width4 {
+       sd2_bus4: sd2-bus-width4-pins {
                samsung,pins = "gpk2-3", "gpk2-4", "gpk2-5", "gpk2-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_bus8: sd2-bus-width8 {
+       sd2_bus8: sd2-bus-width8-pins {
                samsung,pins = "gpk3-3", "gpk3-4", "gpk3-5", "gpk3-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd3_clk: sd3-clk {
+       sd3_clk: sd3-clk-pins {
                samsung,pins = "gpk3-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd3_cmd: sd3-cmd {
+       sd3_cmd: sd3-cmd-pins {
                samsung,pins = "gpk3-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd3_cd: sd3-cd {
+       sd3_cd: sd3-cd-pins {
                samsung,pins = "gpk3-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd3_bus1: sd3-bus-width1 {
+       sd3_bus1: sd3-bus-width1-pins {
                samsung,pins = "gpk3-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd3_bus4: sd3-bus-width4 {
+       sd3_bus4: sd3-bus-width4-pins {
                samsung,pins = "gpk3-3", "gpk3-4", "gpk3-5", "gpk3-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       eint0: ext-int0 {
+       eint0: ext-int0-pins {
                samsung,pins = "gpx0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       eint8: ext-int8 {
+       eint8: ext-int8-pins {
                samsung,pins = "gpx1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       eint15: ext-int15 {
+       eint15: ext-int15-pins {
                samsung,pins = "gpx1-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       eint16: ext-int16 {
+       eint16: ext-int16-pins {
                samsung,pins = "gpx2-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       eint31: ext-int31 {
+       eint31: ext-int31-pins {
                samsung,pins = "gpx3-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       cam_port_a_io: cam-port-a-io {
+       cam_port_a_io: cam-port-a-io-pins {
                samsung,pins = "gpj0-0", "gpj0-1", "gpj0-2", "gpj0-3",
                                "gpj0-4", "gpj0-5", "gpj0-6", "gpj0-7",
                                "gpj1-0", "gpj1-1", "gpj1-2", "gpj1-4";
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       cam_port_a_clk_active: cam-port-a-clk-active {
+       cam_port_a_clk_active: cam-port-a-clk-active-pins {
                samsung,pins = "gpj1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       cam_port_a_clk_idle: cam-port-a-clk-idle {
+       cam_port_a_clk_idle: cam-port-a-clk-idle-pins {
                samsung,pins = "gpj1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       hdmi_cec: hdmi-cec {
+       hdmi_cec: hdmi-cec-pins {
                samsung,pins = "gpx3-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
 };
 
 &pinctrl_2 {
-       gpz: gpz {
+       gpz: gpz-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       i2s0_bus: i2s0-bus {
+       i2s0_bus: i2s0-bus-pins {
                samsung,pins = "gpz-0", "gpz-1", "gpz-2", "gpz-3",
                                "gpz-4", "gpz-5", "gpz-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pcm0_bus: pcm0-bus {
+       pcm0_bus: pcm0-bus-pins {
                samsung,pins = "gpz-0", "gpz-1", "gpz-2", "gpz-3",
                                "gpz-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
index d5797a6..a5dfd7f 100644 (file)
 };
 
 &pinctrl_1 {
-       keypad_rows: keypad-rows {
+       keypad_rows: keypad-rows-pins {
                samsung,pins = "gpx2-0", "gpx2-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       keypad_cols: keypad-cols {
+       keypad_cols: keypad-cols-pins {
                samsung,pins = "gpx1-0", "gpx1-1", "gpx1-2", "gpx1-3",
                               "gpx1-4", "gpx1-5", "gpx1-6", "gpx1-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
index 9c4ff75..01f44d9 100644 (file)
 };
 
 &pinctrl_1 {
-       bt_shutdown: bt-shutdown {
+       bt_shutdown: bt-shutdown-pins {
                samsung,pins = "gpl1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       bt_host_wakeup: bt-host-wakeup {
+       bt_host_wakeup: bt-host-wakeup-pins {
                samsung,pins = "gpx2-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       bt_device_wakeup: bt-device-wakeup {
+       bt_device_wakeup: bt-device-wakeup-pins {
                samsung,pins = "gpx3-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
index 9f93e74..138d606 100644 (file)
 };
 
 &pinctrl_1 {
-       bt_shutdown: bt-shutdown {
+       bt_shutdown: bt-shutdown-pins {
                samsung,pins = "gpe1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       bt_host_wakeup: bt-host-wakeup {
+       bt_host_wakeup: bt-host-wakeup-pins {
                samsung,pins = "gpx2-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       bt_device_wakeup: bt-device-wakeup {
+       bt_device_wakeup: bt-device-wakeup-pins {
                samsung,pins = "gpx3-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       lp3974_irq: lp3974-irq {
+       lp3974_irq: lp3974-irq-pins {
                samsung,pins = "gpx0-7", "gpx2-7";
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       hdmi_hpd: hdmi-hpd {
+       hdmi_hpd: hdmi-hpd-pins {
                samsung,pins = "gpx3-7";
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 };
 
 &pinctrl_0 {
-       i2c_ddc_bus: i2c-ddc-bus {
+       i2c_ddc_bus: i2c-ddc-bus-pins {
                samsung,pins = "gpe4-2", "gpe4-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
 };
 
 &soc {
-       mdma0: mdma@12840000 {
+       mdma0: dma-controller@12840000 {
                compatible = "arm,pl330", "arm,primecell";
                reg = <0x12840000 0x1000>;
                interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
index 7e7d65c..2c25cc3 100644 (file)
        compatible = "samsung,exynos4210-tmu";
        clocks = <&clock CLK_TMU_APBIF>;
        clock-names = "tmu_apbif";
-       samsung,tmu_gain = <15>;
-       samsung,tmu_reference_voltage = <7>;
 };
 
 #include "exynos4210-pinctrl.dtsi"
index c14e37d..03dffc6 100644 (file)
 };
 
 &pinctrl_0 {
-       camera_flash_host: camera-flash-host {
+       camera_flash_host: camera-flash-host-pins {
                samsung,pins = "gpj1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-val = <0>;
        };
 
-       camera_flash_isp: camera-flash-isp {
+       camera_flash_isp: camera-flash-isp-pins {
                samsung,pins = "gpj1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-val = <1>;
index 4743130..a940628 100644 (file)
 };
 
 &pinctrl_1 {
-       ether-reset {
+       ether-reset-pins {
                samsung,pins = "gpc0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
index b3726d4..a67cb61 100644 (file)
 };
 
 &pinctrl_1 {
-       hsic_reset: hsic-reset {
+       hsic_reset: hsic-reset-pins {
                samsung,pins = "gpm2-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
index 968c794..23f50c9 100644 (file)
        pinctrl-names = "default";
        pinctrl-0 = <&sleep0>;
 
-       mhl_int: mhl-int {
+       mhl_int: mhl-int-pins {
                samsung,pins = "gpf3-5";
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       i2c_mhl_bus: i2c-mhl-bus {
+       i2c_mhl_bus: i2c-mhl-bus-pins {
                samsung,pins = "gpf0-4", "gpf0-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       sleep0: sleep-states {
+       sleep0: sleep-state {
                PIN_SLP(gpa0-0, INPUT, NONE);
                PIN_SLP(gpa0-1, OUT0, NONE);
                PIN_SLP(gpa0-2, INPUT, NONE);
        pinctrl-names = "default";
        pinctrl-0 = <&sleep1>;
 
-       gpio_keys: gpio-keys {
+       gpio_keys: gpio-keys-pins {
                samsung,pins = "gpx0-1", "gpx2-2", "gpx2-7", "gpx3-3";
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       bt_shutdown: bt-shutdown {
+       bt_shutdown: bt-shutdown-pins {
                samsung,pins = "gpl0-6";
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       bt_host_wakeup: bt-host-wakeup {
+       bt_host_wakeup: bt-host-wakeup-pins {
                samsung,pins = "gpx2-6";
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       bt_device_wakeup: bt-device-wakeup {
+       bt_device_wakeup: bt-device-wakeup-pins {
                samsung,pins = "gpx3-1";
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       max77686_irq: max77686-irq {
+       max77686_irq: max77686-irq-pins {
                samsung,pins = "gpx0-7";
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       max77693_irq: max77693-irq {
+       max77693_irq: max77693-irq-pins {
                samsung,pins = "gpx1-5";
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       max77693_fuel_irq: max77693-fuel-irq {
+       max77693_fuel_irq: max77693-fuel-irq-pins {
                samsung,pins = "gpx2-3";
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       sdhci2_cd: sdhci2-cd-irq {
+       sdhci2_cd: sdhci2-cd-irq-pins {
                samsung,pins = "gpx3-4";
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       hdmi_hpd: hdmi-hpd {
+       hdmi_hpd: hdmi-hpd-pins {
                samsung,pins = "gpx3-7";
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
        };
 
-       sleep1: sleep-states {
+       sleep1: sleep-state {
                PIN_SLP(gpk0-0, PREV, NONE);
                PIN_SLP(gpk0-1, PREV, NONE);
                PIN_SLP(gpk0-2, OUT0, NONE);
        pinctrl-names = "default";
        pinctrl-0 = <&sleep2>;
 
-       sleep2: sleep-states {
+       sleep2: sleep-state {
                PIN_SLP(gpz-0, INPUT, DOWN);
                PIN_SLP(gpz-1, INPUT, DOWN);
                PIN_SLP(gpz-2, INPUT, DOWN);
        pinctrl-names = "default";
        pinctrl-0 = <&sleep3>;
 
-       sleep3: sleep-states {
+       sleep3: sleep-state {
                PIN_SLP(gpv0-0, INPUT, DOWN);
                PIN_SLP(gpv0-1, INPUT, DOWN);
                PIN_SLP(gpv0-2, INPUT, DOWN);
index 5b1d459..e7669b9 100644 (file)
 };
 
 &pinctrl_1 {
-       gpio_power_key: power-key {
+       gpio_power_key: power-key-pins {
                samsung,pins = "gpx1-3";
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       max77686_irq: max77686-irq {
+       max77686_irq: max77686-irq-pins {
                samsung,pins = "gpx3-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       hdmi_hpd: hdmi-hpd {
+       hdmi_hpd: hdmi-hpd-pins {
                samsung,pins = "gpx3-7";
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
        };
 
-       emmc_rstn: emmc-rstn {
+       emmc_rstn: emmc-rstn-pins {
                samsung,pins = "gpk1-2";
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
index 440135d..a9fada5 100644 (file)
 };
 
 &pinctrl_1 {
-       gpio_home_key: home-key {
+       gpio_home_key: home-key-pins {
                samsung,pins = "gpx2-2";
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
index e6aec5f..6db09db 100644 (file)
 };
 
 &pinctrl_1 {
-       keypad_rows: keypad-rows {
+       keypad_rows: keypad-rows-pins {
                samsung,pins = "gpx2-0", "gpx2-1", "gpx2-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       keypad_cols: keypad-cols {
+       keypad_cols: keypad-cols-pins {
                samsung,pins = "gpx1-0", "gpx1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
index 22c3086..97f131b 100644 (file)
@@ -16,6 +16,7 @@
 #include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/pinctrl/samsung.h>
+#include <dt-bindings/power/summit,smb347-charger.h>
 
 / {
        compatible = "samsung,p4note", "samsung,exynos4412", "samsung,exynos4";
                clock-names = "ext_clock";
        };
 
+       battery_cell: battery-cell {
+               compatible = "simple-battery";
+               device-chemistry = "lithium-ion";
+               constant-charge-current-max-microamp = <2200000>;
+               precharge-current-microamp = <250000>;
+               charge-term-current-microamp = <250000>;
+               constant-charge-voltage-max-microvolt = <4200000>;
+
+               power-supplies = <&power_supply>;
+       };
+
        i2c-gpio-1 {
                compatible = "i2c-gpio";
                sda-gpios = <&gpy2 4 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
                        };
                };
        };
+
+       i2c-gpio-4 {
+               compatible = "i2c-gpio";
+               sda-gpios = <&gpm2 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+               scl-gpios = <&gpm2 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+
+               i2c-gpio,delay-us = <2>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               power_supply: charger@6 {
+                       compatible = "summit,smb347";
+                       reg = <0x6>;
+                       summit,enable-usb-charging;
+                       summit,enable-charge-control = <SMB3XX_CHG_ENABLE_SW>;
+                       summit,fast-voltage-threshold-microvolt = <2600000>;
+                       summit,chip-temperature-threshold-celsius = <130>;
+                       summit,usb-current-limit-microamp = <1800000>;
+
+                       monitored-battery = <&battery_cell>;
+               };
+       };
 };
 
 &adc {
        pinctrl-names = "default";
        pinctrl-0 = <&sleep0>;
 
-       tsp_reg_gpio_2: tsp-reg-gpio-2 {
+       tsp_reg_gpio_2: tsp-reg-gpio-2-pins {
                samsung,pins = "gpb-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       tsp_reg_gpio_3: tsp-reg-gpio-3 {
+       tsp_reg_gpio_3: tsp-reg-gpio-3-pins {
                samsung,pins = "gpb-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       sleep0: sleep-states {
+       sleep0: sleep-state {
                PIN_SLP(gpa0-0, INPUT, NONE);
                PIN_SLP(gpa0-1, OUT0, NONE);
                PIN_SLP(gpa0-2, INPUT, NONE);
        pinctrl-names = "default";
        pinctrl-0 = <&sleep1>;
 
-       sd3_wifi: sd3-wifi {
+       sd3_wifi: sd3-wifi-pins {
                samsung,pins = "gpk3-3", "gpk3-4", "gpk3-5", "gpk3-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       bt_shutdown: bt-shutdown {
+       bt_shutdown: bt-shutdown-pins {
                samsung,pins = "gpl0-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       uart_sel: uart-sel {
+       uart_sel: uart-sel-pins {
                samsung,pins = "gpl2-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                /* 0 = CP, 1 = AP (serial output) */
        };
 
-       tsp_rst: tsp-rst {
+       tsp_rst: tsp-rst-pins {
                samsung,pins = "gpm0-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       tsp_irq: tsp-irq {
+       tsp_irq: tsp-irq-pins {
                samsung,pins = "gpm2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       wifi_reset: wifi-reset {
+       wifi_reset: wifi-reset-pins {
                samsung,pins = "gpm3-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       tsp_reg_gpio_1: tsp-reg-gpio-1 {
+       tsp_reg_gpio_1: tsp-reg-gpio-1-pins {
                samsung,pins = "gpm4-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       ak8975_irq: ak8975-irq {
+       ak8975_irq: ak8975-irq-pins {
                samsung,pins = "gpm4-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
        };
 
-       stmpe_adc_irq: stmpe-adc-irq {
+       stmpe_adc_irq: stmpe-adc-irq-pins {
                samsung,pins = "gpx0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       max77686_irq: max77686-irq {
+       max77686_irq: max77686-irq-pins {
                samsung,pins = "gpx0-7";
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       gpio_keys: gpio-keys {
+       gpio_keys: gpio-keys-pins {
                samsung,pins = "gpx2-2", "gpx2-7", "gpx3-3";
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       fuel_alert_irq: fuel-alert-irq {
+       fuel_alert_irq: fuel-alert-irq-pins {
                samsung,pins = "gpx2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       wifi_host_wake: wifi-host-wake {
+       wifi_host_wake: wifi-host-wake-pins {
                samsung,pins = "gpx2-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
        };
 
-       bt_host_wakeup: bt-host-wakeup {
+       bt_host_wakeup: bt-host-wakeup-pins {
                samsung,pins = "gpx2-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       bt_device_wakeup: bt-device-wakeup {
+       bt_device_wakeup: bt-device-wakeup-pins {
                samsung,pins = "gpx3-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       sdhci2_cd: sdhci2-cd {
+       sdhci2_cd: sdhci2-cd-pins {
                samsung,pins = "gpx3-4";
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       sleep1: sleep-states {
+       sleep1: sleep-state {
                PIN_SLP(gpk0-0, PREV, NONE);
                PIN_SLP(gpk0-1, PREV, NONE);
                PIN_SLP(gpk0-2, PREV, NONE);
        pinctrl-names = "default";
        pinctrl-0 = <&sleep2>;
 
-       sleep2: sleep-states {
+       sleep2: sleep-state {
                PIN_SLP(gpz-0, INPUT, DOWN);
                PIN_SLP(gpz-1, INPUT, DOWN);
                PIN_SLP(gpz-2, INPUT, DOWN);
        pinctrl-names = "default";
        pinctrl-0 = <&sleep3>;
 
-       sleep3: sleep-states {
+       sleep3: sleep-state {
                PIN_SLP(gpv0-0, INPUT, DOWN);
                PIN_SLP(gpv0-1, INPUT, DOWN);
                PIN_SLP(gpv0-2, INPUT, DOWN);
index d7d5fdc..88b8afd 100644 (file)
@@ -19,7 +19,7 @@
        }
 
 &pinctrl_0 {
-       gpa0: gpa0 {
+       gpa0: gpa0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -27,7 +27,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpa1: gpa1 {
+       gpa1: gpa1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -35,7 +35,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpb: gpb {
+       gpb: gpb-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -43,7 +43,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpc0: gpc0 {
+       gpc0: gpc0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -51,7 +51,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpc1: gpc1 {
+       gpc1: gpc1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -59,7 +59,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpd0: gpd0 {
+       gpd0: gpd0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -67,7 +67,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpd1: gpd1 {
+       gpd1: gpd1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -75,7 +75,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpf0: gpf0 {
+       gpf0: gpf0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -83,7 +83,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpf1: gpf1 {
+       gpf1: gpf1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -91,7 +91,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpf2: gpf2 {
+       gpf2: gpf2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -99,7 +99,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpf3: gpf3 {
+       gpf3: gpf3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpj0: gpj0 {
+       gpj0: gpj0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpj1: gpj1 {
+       gpj1: gpj1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       uart0_data: uart0-data {
+       uart0_data: uart0-data-pins {
                samsung,pins = "gpa0-0", "gpa0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart0_fctl: uart0-fctl {
+       uart0_fctl: uart0-fctl-pins {
                samsung,pins = "gpa0-2", "gpa0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart1_data: uart1-data {
+       uart1_data: uart1-data-pins {
                samsung,pins = "gpa0-4", "gpa0-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart1_fctl: uart1-fctl {
+       uart1_fctl: uart1-fctl-pins {
                samsung,pins = "gpa0-6", "gpa0-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c2_bus: i2c2-bus {
+       i2c2_bus: i2c2-bus-pins {
                samsung,pins = "gpa0-6", "gpa0-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart2_data: uart2-data {
+       uart2_data: uart2-data-pins {
                samsung,pins = "gpa1-0", "gpa1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart2_fctl: uart2-fctl {
+       uart2_fctl: uart2-fctl-pins {
                samsung,pins = "gpa1-2", "gpa1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart_audio_a: uart-audio-a {
+       uart_audio_a: uart-audio-a-pins {
                samsung,pins = "gpa1-0", "gpa1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c3_bus: i2c3-bus {
+       i2c3_bus: i2c3-bus-pins {
                samsung,pins = "gpa1-2", "gpa1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart3_data: uart3-data {
+       uart3_data: uart3-data-pins {
                samsung,pins = "gpa1-4", "gpa1-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart_audio_b: uart-audio-b {
+       uart_audio_b: uart-audio-b-pins {
                samsung,pins = "gpa1-4", "gpa1-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       spi0_bus: spi0-bus {
+       spi0_bus: spi0-bus-pins {
                samsung,pins = "gpb-0", "gpb-2", "gpb-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c4_bus: i2c4-bus {
+       i2c4_bus: i2c4-bus-pins {
                samsung,pins = "gpb-0", "gpb-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       spi1_bus: spi1-bus {
+       spi1_bus: spi1-bus-pins {
                samsung,pins = "gpb-4", "gpb-6", "gpb-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c5_bus: i2c5-bus {
+       i2c5_bus: i2c5-bus-pins {
                samsung,pins = "gpb-2", "gpb-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2s1_bus: i2s1-bus {
+       i2s1_bus: i2s1-bus-pins {
                samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3",
                                "gpc0-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pcm1_bus: pcm1-bus {
+       pcm1_bus: pcm1-bus-pins {
                samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3",
                                "gpc0-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       ac97_bus: ac97-bus {
+       ac97_bus: ac97-bus-pins {
                samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3",
                                "gpc0-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2s2_bus: i2s2-bus {
+       i2s2_bus: i2s2-bus-pins {
                samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3",
                                "gpc1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pcm2_bus: pcm2-bus {
+       pcm2_bus: pcm2-bus-pins {
                samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3",
                                "gpc1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       spdif_bus: spdif-bus {
+       spdif_bus: spdif-bus-pins {
                samsung,pins = "gpc1-0", "gpc1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c6_bus: i2c6-bus {
+       i2c6_bus: i2c6-bus-pins {
                samsung,pins = "gpc1-3", "gpc1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       spi2_bus: spi2-bus {
+       spi2_bus: spi2-bus-pins {
                samsung,pins = "gpc1-1", "gpc1-3", "gpc1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_5>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pwm0_out: pwm0-out {
+       pwm0_out: pwm0-out-pins {
                samsung,pins = "gpd0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pwm1_out: pwm1-out {
+       pwm1_out: pwm1-out-pins {
                samsung,pins = "gpd0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       lcd_ctrl: lcd-ctrl {
+       lcd_ctrl: lcd-ctrl-pins {
                samsung,pins = "gpd0-0", "gpd0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c7_bus: i2c7-bus {
+       i2c7_bus: i2c7-bus-pins {
                samsung,pins = "gpd0-2", "gpd0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pwm2_out: pwm2-out {
+       pwm2_out: pwm2-out-pins {
                samsung,pins = "gpd0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pwm3_out: pwm3-out {
+       pwm3_out: pwm3-out-pins {
                samsung,pins = "gpd0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c0_bus: i2c0-bus {
+       i2c0_bus: i2c0-bus-pins {
                samsung,pins = "gpd1-0", "gpd1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       mipi0_clk: mipi0-clk {
+       mipi0_clk: mipi0-clk-pins {
                samsung,pins = "gpd1-0", "gpd1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c1_bus: i2c1-bus {
+       i2c1_bus: i2c1-bus-pins {
                samsung,pins = "gpd1-2", "gpd1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       mipi1_clk: mipi1-clk {
+       mipi1_clk: mipi1-clk-pins {
                samsung,pins = "gpd1-2", "gpd1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       lcd_clk: lcd-clk {
+       lcd_clk: lcd-clk-pins {
                samsung,pins = "gpf0-0", "gpf0-1", "gpf0-2", "gpf0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       lcd_data16: lcd-data-width16 {
+       lcd_data16: lcd-data-width16-pins {
                samsung,pins = "gpf0-7", "gpf1-0", "gpf1-1", "gpf1-2",
                                "gpf1-3", "gpf1-6", "gpf1-7", "gpf2-0",
                                "gpf2-1", "gpf2-2", "gpf2-3", "gpf2-7",
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       lcd_data18: lcd-data-width18 {
+       lcd_data18: lcd-data-width18-pins {
                samsung,pins = "gpf0-6", "gpf0-7", "gpf1-0", "gpf1-1",
                                "gpf1-2", "gpf1-3", "gpf1-6", "gpf1-7",
                                "gpf2-0", "gpf2-1", "gpf2-2", "gpf2-3",
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       lcd_data24: lcd-data-width24 {
+       lcd_data24: lcd-data-width24-pins {
                samsung,pins = "gpf0-4", "gpf0-5", "gpf0-6", "gpf0-7",
                                "gpf1-0", "gpf1-1", "gpf1-2", "gpf1-3",
                                "gpf1-4", "gpf1-5", "gpf1-6", "gpf1-7",
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       lcd_ldi: lcd-ldi {
+       lcd_ldi: lcd-ldi-pins {
                samsung,pins = "gpf3-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       cam_port_a_io: cam-port-a-io {
+       cam_port_a_io: cam-port-a-io-pins {
                samsung,pins = "gpj0-0", "gpj0-1", "gpj0-2", "gpj0-3",
                                "gpj0-4", "gpj0-5", "gpj0-6", "gpj0-7",
                                "gpj1-0", "gpj1-1", "gpj1-2", "gpj1-4";
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       cam_port_a_clk_active: cam-port-a-clk-active {
+       cam_port_a_clk_active: cam-port-a-clk-active-pins {
                samsung,pins = "gpj1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       cam_port_a_clk_idle: cam-port-a-clk-idle {
+       cam_port_a_clk_idle: cam-port-a-clk-idle-pins {
                samsung,pins = "gpj1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
 };
 
 &pinctrl_1 {
-       gpk0: gpk0 {
+       gpk0: gpk0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpk1: gpk1 {
+       gpk1: gpk1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpk2: gpk2 {
+       gpk2: gpk2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpk3: gpk3 {
+       gpk3: gpk3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpl0: gpl0 {
+       gpl0: gpl0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpl1: gpl1 {
+       gpl1: gpl1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpl2: gpl2 {
+       gpl2: gpl2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpm0: gpm0 {
+       gpm0: gpm0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpm1: gpm1 {
+       gpm1: gpm1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpm2: gpm2 {
+       gpm2: gpm2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpm3: gpm3 {
+       gpm3: gpm3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpm4: gpm4 {
+       gpm4: gpm4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpy0: gpy0 {
+       gpy0: gpy0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy1: gpy1 {
+       gpy1: gpy1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy2: gpy2 {
+       gpy2: gpy2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy3: gpy3 {
+       gpy3: gpy3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy4: gpy4 {
+       gpy4: gpy4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy5: gpy5 {
+       gpy5: gpy5-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy6: gpy6 {
+       gpy6: gpy6-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpx0: gpx0 {
+       gpx0: gpx0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpx1: gpx1 {
+       gpx1: gpx1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpx2: gpx2 {
+       gpx2: gpx2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpx3: gpx3 {
+       gpx3: gpx3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       sd0_clk: sd0-clk {
+       sd0_clk: sd0-clk-pins {
                samsung,pins = "gpk0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_cmd: sd0-cmd {
+       sd0_cmd: sd0-cmd-pins {
                samsung,pins = "gpk0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_cd: sd0-cd {
+       sd0_cd: sd0-cd-pins {
                samsung,pins = "gpk0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_bus1: sd0-bus-width1 {
+       sd0_bus1: sd0-bus-width1-pins {
                samsung,pins = "gpk0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_bus4: sd0-bus-width4 {
+       sd0_bus4: sd0-bus-width4-pins {
                samsung,pins = "gpk0-3", "gpk0-4", "gpk0-5", "gpk0-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_bus8: sd0-bus-width8 {
+       sd0_bus8: sd0-bus-width8-pins {
                samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd4_clk: sd4-clk {
+       sd4_clk: sd4-clk-pins {
                samsung,pins = "gpk0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd4_cmd: sd4-cmd {
+       sd4_cmd: sd4-cmd-pins {
                samsung,pins = "gpk0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd4_cd: sd4-cd {
+       sd4_cd: sd4-cd-pins {
                samsung,pins = "gpk0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd4_bus1: sd4-bus-width1 {
+       sd4_bus1: sd4-bus-width1-pins {
                samsung,pins = "gpk0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd4_bus4: sd4-bus-width4 {
+       sd4_bus4: sd4-bus-width4-pins {
                samsung,pins = "gpk0-3", "gpk0-4", "gpk0-5", "gpk0-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd4_bus8: sd4-bus-width8 {
+       sd4_bus8: sd4-bus-width8-pins {
                samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd1_clk: sd1-clk {
+       sd1_clk: sd1-clk-pins {
                samsung,pins = "gpk1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd1_cmd: sd1-cmd {
+       sd1_cmd: sd1-cmd-pins {
                samsung,pins = "gpk1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd1_cd: sd1-cd {
+       sd1_cd: sd1-cd-pins {
                samsung,pins = "gpk1-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd1_bus1: sd1-bus-width1 {
+       sd1_bus1: sd1-bus-width1-pins {
                samsung,pins = "gpk1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd1_bus4: sd1-bus-width4 {
+       sd1_bus4: sd1-bus-width4-pins {
                samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_clk: sd2-clk {
+       sd2_clk: sd2-clk-pins {
                samsung,pins = "gpk2-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_cmd: sd2-cmd {
+       sd2_cmd: sd2-cmd-pins {
                samsung,pins = "gpk2-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_cd: sd2-cd {
+       sd2_cd: sd2-cd-pins {
                samsung,pins = "gpk2-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_bus1: sd2-bus-width1 {
+       sd2_bus1: sd2-bus-width1-pins {
                samsung,pins = "gpk2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_bus4: sd2-bus-width4 {
+       sd2_bus4: sd2-bus-width4-pins {
                samsung,pins = "gpk2-3", "gpk2-4", "gpk2-5", "gpk2-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_bus8: sd2-bus-width8 {
+       sd2_bus8: sd2-bus-width8-pins {
                samsung,pins = "gpk3-3", "gpk3-4", "gpk3-5", "gpk3-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd3_clk: sd3-clk {
+       sd3_clk: sd3-clk-pins {
                samsung,pins = "gpk3-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd3_cmd: sd3-cmd {
+       sd3_cmd: sd3-cmd-pins {
                samsung,pins = "gpk3-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd3_cd: sd3-cd {
+       sd3_cd: sd3-cd-pins {
                samsung,pins = "gpk3-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd3_bus1: sd3-bus-width1 {
+       sd3_bus1: sd3-bus-width1-pins {
                samsung,pins = "gpk3-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd3_bus4: sd3-bus-width4 {
+       sd3_bus4: sd3-bus-width4-pins {
                samsung,pins = "gpk3-3", "gpk3-4", "gpk3-5", "gpk3-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       cam_port_b_io: cam-port-b-io {
+       cam_port_b_io: cam-port-b-io-pins {
                samsung,pins = "gpm0-0", "gpm0-1", "gpm0-2", "gpm0-3",
                                "gpm0-4", "gpm0-5", "gpm0-6", "gpm0-7",
                                "gpm1-0", "gpm1-1", "gpm2-0", "gpm2-1";
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       cam_port_b_clk_active: cam-port-b-clk-active {
+       cam_port_b_clk_active: cam-port-b-clk-active-pins {
                samsung,pins = "gpm2-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       cam_port_b_clk_idle: cam-port-b-clk-idle {
+       cam_port_b_clk_idle: cam-port-b-clk-idle-pins {
                samsung,pins = "gpm2-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       eint0: ext-int0 {
+       eint0: ext-int0-pins {
                samsung,pins = "gpx0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       eint8: ext-int8 {
+       eint8: ext-int8-pins {
                samsung,pins = "gpx1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       eint15: ext-int15 {
+       eint15: ext-int15-pins {
                samsung,pins = "gpx1-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       eint16: ext-int16 {
+       eint16: ext-int16-pins {
                samsung,pins = "gpx2-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       eint31: ext-int31 {
+       eint31: ext-int31-pins {
                samsung,pins = "gpx3-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       fimc_is_i2c0: fimc-is-i2c0 {
+       fimc_is_i2c0: fimc-is-i2c0-pins {
                samsung,pins = "gpm4-0", "gpm4-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       fimc_is_i2c1: fimc-is-i2c1 {
+       fimc_is_i2c1: fimc-is-i2c1-pins {
                samsung,pins = "gpm4-2", "gpm4-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       fimc_is_uart: fimc-is-uart {
+       fimc_is_uart: fimc-is-uart-pins {
                samsung,pins = "gpm3-5", "gpm3-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       hdmi_cec: hdmi-cec {
+       hdmi_cec: hdmi-cec-pins {
                samsung,pins = "gpx3-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
 };
 
 &pinctrl_2 {
-       gpz: gpz {
+       gpz: gpz-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       i2s0_bus: i2s0-bus {
+       i2s0_bus: i2s0-bus-pins {
                samsung,pins = "gpz-0", "gpz-1", "gpz-2", "gpz-3",
                                "gpz-4", "gpz-5", "gpz-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pcm0_bus: pcm0-bus {
+       pcm0_bus: pcm0-bus-pins {
                samsung,pins = "gpz-0", "gpz-1", "gpz-2", "gpz-3",
                                "gpz-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
 };
 
 &pinctrl_3 {
-       gpv0: gpv0 {
+       gpv0: gpv0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpv1: gpv1 {
+       gpv1: gpv1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpv2: gpv2 {
+       gpv2: gpv2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpv3: gpv3 {
+       gpv3: gpv3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpv4: gpv4 {
+       gpv4: gpv4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       c2c_bus: c2c-bus {
+       c2c_bus: c2c-bus-pins {
                samsung,pins = "gpv0-0", "gpv0-1", "gpv0-2", "gpv0-3",
                                "gpv0-4", "gpv0-5", "gpv0-6", "gpv0-7",
                                "gpv1-0", "gpv1-1", "gpv1-2", "gpv1-3",
index cc99b95..a40ff39 100644 (file)
 };
 
 &pinctrl_1 {
-       keypad_rows: keypad-rows {
+       keypad_rows: keypad-rows-pins {
                samsung,pins = "gpx2-0", "gpx2-1", "gpx2-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       keypad_cols: keypad-cols {
+       keypad_cols: keypad-cols-pins {
                samsung,pins = "gpx1-0", "gpx1-1", "gpx1-2", "gpx1-3",
                               "gpx1-4", "gpx1-5", "gpx1-6", "gpx1-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
index d380204..aa0b61b 100644 (file)
        interrupt-parent = <&combiner>;
        interrupts = <2 4>;
        reg = <0x100C0000 0x100>;
-       clocks = <&clock 383>;
+       clocks = <&clock CLK_TMU_APBIF>;
        clock-names = "tmu_apbif";
        status = "disabled";
 };
index 3583095..f7795f2 100644 (file)
 };
 
 &pinctrl_0 {
-       s5m8767_irq: s5m8767-irq {
+       s5m8767_irq: s5m8767-irq-pins {
                samsung,pins = "gpx3-2";
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
                #size-cells = <0>;
        };
 };
+
+&usbdrd {
+       vdd10-supply = <&ldo15_reg>;
+       vdd33-supply = <&ldo12_reg>;
+};
index d31a686..918947a 100644 (file)
@@ -12,7 +12,7 @@
 #include <dt-bindings/pinctrl/samsung.h>
 
 &pinctrl_0 {
-       gpa0: gpa0 {
+       gpa0: gpa0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -20,7 +20,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpa1: gpa1 {
+       gpa1: gpa1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -28,7 +28,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpa2: gpa2 {
+       gpa2: gpa2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -36,7 +36,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpb0: gpb0 {
+       gpb0: gpb0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -44,7 +44,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpb1: gpb1 {
+       gpb1: gpb1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -52,7 +52,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpb2: gpb2 {
+       gpb2: gpb2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -60,7 +60,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpb3: gpb3 {
+       gpb3: gpb3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -68,7 +68,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpc0: gpc0 {
+       gpc0: gpc0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -76,7 +76,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpc1: gpc1 {
+       gpc1: gpc1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -84,7 +84,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpc2: gpc2 {
+       gpc2: gpc2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -92,7 +92,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpc3: gpc3 {
+       gpc3: gpc3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpd0: gpd0 {
+       gpd0: gpd0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpd1: gpd1 {
+       gpd1: gpd1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpy0: gpy0 {
+       gpy0: gpy0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy1: gpy1 {
+       gpy1: gpy1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy2: gpy2 {
+       gpy2: gpy2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy3: gpy3 {
+       gpy3: gpy3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy4: gpy4 {
+       gpy4: gpy4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy5: gpy5 {
+       gpy5: gpy5-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy6: gpy6 {
+       gpy6: gpy6-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpc4: gpc4 {
+       gpc4: gpc4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpx0: gpx0 {
+       gpx0: gpx0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                             <26 0>, <26 1>, <27 0>, <27 1>;
        };
 
-       gpx1: gpx1 {
+       gpx1: gpx1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                             <30 0>, <30 1>, <31 0>, <31 1>;
        };
 
-       gpx2: gpx2 {
+       gpx2: gpx2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpx3: gpx3 {
+       gpx3: gpx3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       uart0_data: uart0-data {
+       uart0_data: uart0-data-pins {
                samsung,pins = "gpa0-0", "gpa0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart0_fctl: uart0-fctl {
+       uart0_fctl: uart0-fctl-pins {
                samsung,pins = "gpa0-2", "gpa0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c2_bus: i2c2-bus {
+       i2c2_bus: i2c2-bus-pins {
                samsung,pins = "gpa0-6", "gpa0-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c2_hs_bus: i2c2-hs-bus {
+       i2c2_hs_bus: i2c2-hs-bus-pins {
                samsung,pins = "gpa0-6", "gpa0-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c2_gpio_bus: i2c2-gpio-bus {
+       i2c2_gpio_bus: i2c2-gpio-bus-pins {
                samsung,pins = "gpa0-6", "gpa0-7";
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart2_data: uart2-data {
+       uart2_data: uart2-data-pins {
                samsung,pins = "gpa1-0", "gpa1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart2_fctl: uart2-fctl {
+       uart2_fctl: uart2-fctl-pins {
                samsung,pins = "gpa1-2", "gpa1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c3_bus: i2c3-bus {
+       i2c3_bus: i2c3-bus-pins {
                samsung,pins = "gpa1-2", "gpa1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c3_hs_bus: i2c3-hs-bus {
+       i2c3_hs_bus: i2c3-hs-bus-pins {
                samsung,pins = "gpa1-2", "gpa1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart3_data: uart3-data {
-               samsung,pins = "gpa1-4", "gpa1-4";
+       uart3_data: uart3-data-pins {
+               samsung,pins = "gpa1-4", "gpa1-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       spi0_bus: spi0-bus {
+       spi0_bus: spi0-bus-pins {
                samsung,pins = "gpa2-0", "gpa2-2", "gpa2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c4_bus: i2c4-bus {
+       i2c4_bus: i2c4-bus-pins {
                samsung,pins = "gpa2-0", "gpa2-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c5_bus: i2c5-bus {
+       i2c5_bus: i2c5-bus-pins {
                samsung,pins = "gpa2-2", "gpa2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       spi1_bus: spi1-bus {
+       spi1_bus: spi1-bus-pins {
                samsung,pins = "gpa2-4", "gpa2-6", "gpa2-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2s1_bus: i2s1-bus {
+       i2s1_bus: i2s1-bus-pins {
                samsung,pins = "gpb0-0", "gpb0-1", "gpb0-2", "gpb0-3",
                               "gpb0-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pcm1_bus: pcm1-bus {
+       pcm1_bus: pcm1-bus-pins {
                samsung,pins = "gpb0-0", "gpb0-1", "gpb0-2", "gpb0-3",
                               "gpb0-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       ac97_bus: ac97-bus {
+       ac97_bus: ac97-bus-pins {
                samsung,pins = "gpb0-0", "gpb0-1", "gpb0-2", "gpb0-3",
                               "gpb0-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2s2_bus: i2s2-bus {
+       i2s2_bus: i2s2-bus-pins {
                samsung,pins = "gpb1-0", "gpb1-1", "gpb1-2", "gpb1-3",
                               "gpb1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pcm2_bus: pcm2-bus {
+       pcm2_bus: pcm2-bus-pins {
                samsung,pins = "gpb1-0", "gpb1-1", "gpb1-2", "gpb1-3",
                               "gpb1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       spdif_bus: spdif-bus {
+       spdif_bus: spdif-bus-pins {
                samsung,pins = "gpb1-0", "gpb1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       spi2_bus: spi2-bus {
+       spi2_bus: spi2-bus-pins {
                samsung,pins = "gpb1-1", "gpb1-3", "gpb1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_5>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c6_bus: i2c6-bus {
+       i2c6_bus: i2c6-bus-pins {
                samsung,pins = "gpb1-3", "gpb1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pwm0_out: pwm0-out {
+       pwm0_out: pwm0-out-pins {
                samsung,pins = "gpb2-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pwm1_out: pwm1-out {
+       pwm1_out: pwm1-out-pins {
                samsung,pins = "gpb2-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pwm2_out: pwm2-out {
+       pwm2_out: pwm2-out-pins {
                samsung,pins = "gpb2-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pwm3_out: pwm3-out {
+       pwm3_out: pwm3-out-pins {
                samsung,pins = "gpb2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c7_bus: i2c7-bus {
+       i2c7_bus: i2c7-bus-pins {
                samsung,pins = "gpb2-2", "gpb2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c0_bus: i2c0-bus {
+       i2c0_bus: i2c0-bus-pins {
                samsung,pins = "gpb3-0", "gpb3-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c1_bus: i2c1-bus {
+       i2c1_bus: i2c1-bus-pins {
                samsung,pins = "gpb3-2", "gpb3-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c0_hs_bus: i2c0-hs-bus {
+       i2c0_hs_bus: i2c0-hs-bus-pins {
                samsung,pins = "gpb3-0", "gpb3-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c1_hs_bus: i2c1-hs-bus {
+       i2c1_hs_bus: i2c1-hs-bus-pins {
                samsung,pins = "gpb3-2", "gpb3-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       sd0_clk: sd0-clk {
+       sd0_clk: sd0-clk-pins {
                samsung,pins = "gpc0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_cmd: sd0-cmd {
+       sd0_cmd: sd0-cmd-pins {
                samsung,pins = "gpc0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_cd: sd0-cd {
+       sd0_cd: sd0-cd-pins {
                samsung,pins = "gpc0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_bus1: sd0-bus-width1 {
+       sd0_bus1: sd0-bus-width1-pins {
                samsung,pins = "gpc0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_bus4: sd0-bus-width4 {
+       sd0_bus4: sd0-bus-width4-pins {
                samsung,pins = "gpc0-3", "gpc0-4", "gpc0-5", "gpc0-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_bus8: sd0-bus-width8 {
+       sd0_bus8: sd0-bus-width8-pins {
                samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd1_clk: sd1-clk {
+       sd1_clk: sd1-clk-pins {
                samsung,pins = "gpc2-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd1_cmd: sd1-cmd {
+       sd1_cmd: sd1-cmd-pins {
                samsung,pins = "gpc2-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd1_cd: sd1-cd {
+       sd1_cd: sd1-cd-pins {
                samsung,pins = "gpc2-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd1_bus1: sd1-bus-width1 {
+       sd1_bus1: sd1-bus-width1-pins {
                samsung,pins = "gpc2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd1_bus4: sd1-bus-width4 {
+       sd1_bus4: sd1-bus-width4-pins {
                samsung,pins = "gpc2-3", "gpc2-4", "gpc2-5", "gpc2-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_clk: sd2-clk {
+       sd2_clk: sd2-clk-pins {
                samsung,pins = "gpc3-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_cmd: sd2-cmd {
+       sd2_cmd: sd2-cmd-pins {
                samsung,pins = "gpc3-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_cd: sd2-cd {
+       sd2_cd: sd2-cd-pins {
                samsung,pins = "gpc3-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_bus1: sd2-bus-width1 {
+       sd2_bus1: sd2-bus-width1-pins {
                samsung,pins = "gpc3-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_bus4: sd2-bus-width4 {
+       sd2_bus4: sd2-bus-width4-pins {
                samsung,pins = "gpc3-3", "gpc3-4", "gpc3-5", "gpc3-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_bus8: sd2-bus-width8 {
+       sd2_bus8: sd2-bus-width8-pins {
                samsung,pins = "gpc4-3", "gpc4-4", "gpc4-5", "gpc4-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd3_clk: sd3-clk {
+       sd3_clk: sd3-clk-pins {
                samsung,pins = "gpc4-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd3_cmd: sd3-cmd {
+       sd3_cmd: sd3-cmd-pins {
                samsung,pins = "gpc4-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd3_cd: sd3-cd {
+       sd3_cd: sd3-cd-pins {
                samsung,pins = "gpc4-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd3_bus1: sd3-bus-width1 {
+       sd3_bus1: sd3-bus-width1-pins {
                samsung,pins = "gpc4-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd3_bus4: sd3-bus-width4 {
+       sd3_bus4: sd3-bus-width4-pins {
                samsung,pins = "gpc4-3", "gpc4-4", "gpc4-5", "gpc4-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       uart1_data: uart1-data {
+       uart1_data: uart1-data-pins {
                samsung,pins = "gpd0-0", "gpd0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart1_fctl: uart1-fctl {
+       uart1_fctl: uart1-fctl-pins {
                samsung,pins = "gpd0-2", "gpd0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       dp_hpd: dp_hpd {
+       dp_hpd: dp-hpd-pins {
                samsung,pins = "gpx0-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       hdmi_cec: hdmi-cec {
+       hdmi_cec: hdmi-cec-pins {
                samsung,pins = "gpx3-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       hdmi_hpd: hdmi-hpd {
+       hdmi_hpd: hdmi-hpd-pins {
                samsung,pins = "gpx3-7";
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 };
 
 &pinctrl_1 {
-       gpe0: gpe0 {
+       gpe0: gpe0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpe1: gpe1 {
+       gpe1: gpe1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf0: gpf0 {
+       gpf0: gpf0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf1: gpf1 {
+       gpf1: gpf1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpg0: gpg0 {
+       gpg0: gpg0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpg1: gpg1 {
+       gpg1: gpg1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpg2: gpg2 {
+       gpg2: gpg2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gph0: gph0 {
+       gph0: gph0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gph1: gph1 {
+       gph1: gph1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       cam_gpio_a: cam-gpio-a {
+       cam_gpio_a: cam-gpio-a-pins {
                samsung,pins = "gpe0-0", "gpe0-1", "gpe0-2", "gpe0-3",
                               "gpe0-4", "gpe0-5", "gpe0-6", "gpe0-7",
                               "gpe1-0", "gpe1-1";
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       cam_gpio_b: cam-gpio-b {
+       cam_gpio_b: cam-gpio-b-pins {
                samsung,pins = "gpf0-0", "gpf0-1", "gpf0-2", "gpf0-3",
                               "gpf1-0", "gpf1-1", "gpf1-2", "gpf1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       cam_i2c2_bus: cam-i2c2-bus {
+       cam_i2c2_bus: cam-i2c2-bus-pins {
                samsung,pins = "gpe0-6", "gpe1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       cam_spi1_bus: cam-spi1-bus {
+       cam_spi1_bus: cam-spi1-bus-pins {
                samsung,pins = "gpe0-4", "gpe0-5", "gpf0-2", "gpf0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       cam_i2c1_bus: cam-i2c1-bus {
+       cam_i2c1_bus: cam-i2c1-bus-pins {
                samsung,pins = "gpf0-2", "gpf0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       cam_i2c0_bus: cam-i2c0-bus {
+       cam_i2c0_bus: cam-i2c0-bus-pins {
                samsung,pins = "gpf0-0", "gpf0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       cam_spi0_bus: cam-spi0-bus {
+       cam_spi0_bus: cam-spi0-bus-pins {
                samsung,pins = "gpf1-0", "gpf1-1", "gpf1-2", "gpf1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       cam_bayrgb_bus: cam-bayrgb-bus {
+       cam_bayrgb_bus: cam-bayrgb-bus-pins {
                samsung,pins = "gpg0-0", "gpg0-1", "gpg0-2", "gpg0-3",
                               "gpg0-4", "gpg0-5", "gpg0-6", "gpg0-7",
                               "gpg1-0", "gpg1-1", "gpg1-2", "gpg1-3",
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       cam_port_a: cam-port-a {
+       cam_port_a: cam-port-a-pins {
                samsung,pins = "gph0-0", "gph0-1", "gph0-2", "gph0-3",
                               "gph1-0", "gph1-1", "gph1-2", "gph1-3",
                               "gph1-4", "gph1-5", "gph1-6", "gph1-7";
 };
 
 &pinctrl_2 {
-       gpv0: gpv0 {
+       gpv0: gpv0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpv1: gpv1 {
+       gpv1: gpv1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpv2: gpv2 {
+       gpv2: gpv2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpv3: gpv3 {
+       gpv3: gpv3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpv4: gpv4 {
+       gpv4: gpv4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       c2c_rxd: c2c-rxd {
+       c2c_rxd: c2c-rxd-pins {
                samsung,pins = "gpv0-0", "gpv0-1", "gpv0-2", "gpv0-3",
                               "gpv0-4", "gpv0-5", "gpv0-6", "gpv0-7",
                               "gpv1-0", "gpv1-1", "gpv1-2", "gpv1-3",
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       c2c_txd: c2c-txd {
+       c2c_txd: c2c-txd-pins {
                samsung,pins = "gpv2-0", "gpv2-1", "gpv2-2", "gpv2-3",
                               "gpv2-4", "gpv2-5", "gpv2-6", "gpv2-7",
                               "gpv3-0", "gpv3-1", "gpv3-2", "gpv3-3",
 };
 
 &pinctrl_3 {
-       gpz: gpz {
+       gpz: gpz-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       i2s0_bus: i2s0-bus {
+       i2s0_bus: i2s0-bus-pins {
                samsung,pins = "gpz-0", "gpz-1", "gpz-2", "gpz-3",
                                "gpz-4", "gpz-5", "gpz-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
index 39bbe18..21fbbf3 100644 (file)
        status = "okay";
        ddc = <&i2c_2>;
        hpd-gpios = <&gpx3 7 GPIO_ACTIVE_HIGH>;
+       vdd-supply = <&ldo8_reg>;
+       vdd_osc-supply = <&ldo10_reg>;
+       vdd_pll-supply = <&ldo8_reg>;
 };
 
 &i2c_0 {
 };
 
 &pinctrl_0 {
-       max77686_irq: max77686-irq {
+       max77686_irq: max77686-irq-pins {
                samsung,pins = "gpx3-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 };
+
+&usbdrd {
+       vdd10-supply = <&ldo15_reg>;
+       vdd33-supply = <&ldo12_reg>;
+};
index 2335c46..c15ecfc 100644 (file)
 };
 
 &pinctrl_0 {
-       wifi_en: wifi-en {
+       wifi_en: wifi-en-pins {
                samsung,pins = "gpx0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       wifi_rst: wifi-rst {
+       wifi_rst: wifi-rst-pins {
                samsung,pins = "gpx0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       power_key_irq: power-key-irq {
+       power_key_irq: power-key-irq-pins {
                samsung,pins = "gpx1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       ec_irq: ec-irq {
+       ec_irq: ec-irq-pins {
                samsung,pins = "gpx1-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       tps65090_irq: tps65090-irq {
+       tps65090_irq: tps65090-irq-pins {
                samsung,pins = "gpx2-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       usb3_vbus_en: usb3-vbus-en {
+       usb3_vbus_en: usb3-vbus-en-pins {
                samsung,pins = "gpx2-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       max77686_irq: max77686-irq {
+       max77686_irq: max77686-irq-pins {
                samsung,pins = "gpx3-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       lid_irq: lid-irq {
+       lid_irq: lid-irq-pins {
                samsung,pins = "gpx3-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       hdmi_hpd_irq: hdmi-hpd-irq {
+       hdmi_hpd_irq: hdmi-hpd-irq-pins {
                samsung,pins = "gpx3-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
 };
 
 &pinctrl_1 {
-       arb_their_claim: arb-their-claim {
+       arb_their_claim: arb-their-claim-pins {
                samsung,pins = "gpe0-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       arb_our_claim: arb-our-claim {
+       arb_our_claim: arb-our-claim-pins {
                samsung,pins = "gpf0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        cs-gpios = <&gpa2 5 GPIO_ACTIVE_HIGH>;
 };
 
+&usbdrd {
+       vdd10-supply = <&ldo15_reg>;
+       vdd33-supply = <&ldo12_reg>;
+};
+
 &usbdrd_dwc3 {
        dr_mode = "host";
 };
index f8ca61d..0a47597 100644 (file)
@@ -47,7 +47,7 @@
 };
 
 &pinctrl_0 {
-       max98090_irq: max98090-irq {
+       max98090_irq: max98090-irq-pins {
                samsung,pins = "gpx0-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
index a630bc6..906aa7a 100644 (file)
@@ -43,7 +43,7 @@
 };
 
 &pinctrl_0 {
-       max98095_en: max98095-en {
+       max98095_en: max98095-en-pins {
                samsung,pins = "gpx1-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
index e0feedc..24609bb 100644 (file)
 };
 
 &pinctrl_0 {
-       s5m8767_dvs: s5m8767-dvs {
+       s5m8767_dvs: s5m8767-dvs-pins {
                samsung,pins = "gpd1-0", "gpd1-1", "gpd1-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       dp_hpd_gpio: dp-hpd {
+       dp_hpd_gpio: dp-hpd-pins {
                samsung,pins = "gpc3-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       trackpad_irq: trackpad-irq {
+       trackpad_irq: trackpad-irq-pins {
                samsung,pins = "gpx1-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       power_key_irq: power-key-irq {
+       power_key_irq: power-key-irq-pins {
                samsung,pins = "gpx1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       ec_irq: ec-irq {
+       ec_irq: ec-irq-pins {
                samsung,pins = "gpx1-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       s5m8767_ds: s5m8767-ds {
+       s5m8767_ds: s5m8767-ds-pins {
                samsung,pins = "gpx2-3", "gpx2-4", "gpx2-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       s5m8767_irq: s5m8767-irq {
+       s5m8767_irq: s5m8767-irq-pins {
                samsung,pins = "gpx3-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       lid_irq: lid-irq {
+       lid_irq: lid-irq-pins {
                samsung,pins = "gpx3-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       hdmi_hpd_irq: hdmi-hpd-irq {
+       hdmi_hpd_irq: hdmi-hpd-irq-pins {
                samsung,pins = "gpx3-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
 };
 
 &pinctrl_1 {
-       hsic_reset: hsic-reset {
+       hsic_reset: hsic-reset-pins {
                samsung,pins = "gpe1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        num-cs = <1>;
 };
 
+&usbdrd {
+       vdd10-supply = <&ldo15_reg>;
+       vdd33-supply = <&ldo12_reg>;
+};
+
 #include "cros-ec-keyboard.dtsi"
index 1397789..5baaa7e 100644 (file)
                        status = "disabled";
                        reg = <0x12d20000 0x100>;
                        interrupts = <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>;
-                       dmas = <&pdma0 5
-                               &pdma0 4>;
+                       dmas = <&pdma0 5>, <&pdma0 4>;
                        dma-names = "tx", "rx";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "disabled";
                        reg = <0x12d30000 0x100>;
                        interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>;
-                       dmas = <&pdma1 5
-                               &pdma1 4>;
+                       dmas = <&pdma1 5>, <&pdma1 4>;
                        dma-names = "tx", "rx";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "disabled";
                        reg = <0x12d40000 0x100>;
                        interrupts = <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>;
-                       dmas = <&pdma0 7
-                               &pdma0 6>;
+                       dmas = <&pdma0 7>, <&pdma0 6>;
                        dma-names = "tx", "rx";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        #sound-dai-cells = <1>;
                };
 
-               usb_dwc3 {
+               usbdrd: usb3 {
                        compatible = "samsung,exynos5250-dwusb3";
                        clocks = <&clock CLK_USB3>;
                        clock-names = "usbdrd30";
                        samsung,pmureg-phandle = <&pmu_system_controller>;
                };
 
-               pdma0: pdma@121a0000 {
+               pdma0: dma-controller@121a0000 {
                        compatible = "arm,pl330", "arm,primecell";
                        reg = <0x121A0000 0x1000>;
                        interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
                        #dma-requests = <32>;
                };
 
-               pdma1: pdma@121b0000 {
+               pdma1: dma-controller@121b0000 {
                        compatible = "arm,pl330", "arm,primecell";
                        reg = <0x121B0000 0x1000>;
                        interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
                        #dma-requests = <32>;
                };
 
-               mdma0: mdma@10800000 {
+               mdma0: dma-controller@10800000 {
                        compatible = "arm,pl330", "arm,primecell";
                        reg = <0x10800000 0x1000>;
                        interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
                        #dma-requests = <1>;
                };
 
-               mdma1: mdma@11c10000 {
+               mdma1: dma-controller@11c10000 {
                        compatible = "arm,pl330", "arm,primecell";
                        reg = <0x11C10000 0x1000>;
                        interrupts = <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>;
index 17e2f3e..150607f 100644 (file)
@@ -12,7 +12,7 @@
 #include <dt-bindings/pinctrl/samsung.h>
 
 &pinctrl_0 {
-       gpa0: gpa0 {
+       gpa0: gpa0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -20,7 +20,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpa1: gpa1 {
+       gpa1: gpa1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -28,7 +28,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpa2: gpa2 {
+       gpa2: gpa2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -36,7 +36,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpb0: gpb0 {
+       gpb0: gpb0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -44,7 +44,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpb1: gpb1 {
+       gpb1: gpb1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -52,7 +52,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpb2: gpb2 {
+       gpb2: gpb2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -60,7 +60,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpb3: gpb3 {
+       gpb3: gpb3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -68,7 +68,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpb4: gpb4 {
+       gpb4: gpb4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -76,7 +76,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpb5: gpb5 {
+       gpb5: gpb5-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -84,7 +84,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpd0: gpd0 {
+       gpd0: gpd0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -92,7 +92,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpd1: gpd1 {
+       gpd1: gpd1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpd2: gpd2 {
+       gpd2: gpd2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpe0: gpe0 {
+       gpe0: gpe0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpe1: gpe1 {
+       gpe1: gpe1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf0: gpf0 {
+       gpf0: gpf0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf1: gpf1 {
+       gpf1: gpf1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpk0: gpk0 {
+       gpk0: gpk0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpx0: gpx0 {
+       gpx0: gpx0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpx1: gpx1 {
+       gpx1: gpx1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpx2: gpx2 {
+       gpx2: gpx2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpx3: gpx3 {
+       gpx3: gpx3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       uart0_data: uart0-data {
+       uart0_data: uart0-data-pins {
                samsung,pins = "gpa0-0", "gpa0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       uart0_fctl: uart0-fctl {
+       uart0_fctl: uart0-fctl-pins {
                samsung,pins = "gpa0-2", "gpa0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       uart1_data: uart1-data {
+       uart1_data: uart1-data-pins {
                samsung,pins = "gpa1-0", "gpa1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       uart1_fctl: uart1-fctl {
+       uart1_fctl: uart1-fctl-pins {
                samsung,pins = "gpa1-2", "gpa1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       uart2_data: uart2-data {
+       uart2_data: uart2-data-pins {
                samsung,pins = "gpa1-4", "gpa1-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       spi0_bus: spi0-bus {
+       spi0_bus: spi0-bus-pins {
                samsung,pins = "gpa2-0", "gpa2-2", "gpa2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       spi1_bus: spi1-bus {
+       spi1_bus: spi1-bus-pins {
                samsung,pins = "gpa2-4", "gpa2-6", "gpa2-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       usb3_vbus0_en: usb3-vbus0-en {
+       usb3_vbus0_en: usb3-vbus0-en-pins {
                samsung,pins = "gpa2-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       i2s1_bus: i2s1-bus {
+       i2s1_bus: i2s1-bus-pins {
                samsung,pins = "gpb0-0", "gpb0-1", "gpb0-2", "gpb0-3",
                                "gpb0-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       pcm1_bus: pcm1-bus {
+       pcm1_bus: pcm1-bus-pins {
                samsung,pins = "gpb0-0", "gpb0-1", "gpb0-2", "gpb0-3",
                                "gpb0-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       spdif1_bus: spdif1-bus {
+       spdif1_bus: spdif1-bus-pins {
                samsung,pins = "gpb0-0", "gpb0-1", "gpb0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       spi2_bus: spi2-bus {
+       spi2_bus: spi2-bus-pins {
                samsung,pins = "gpb1-0", "gpb1-2", "gpb1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       i2c0_hs_bus: i2c0-hs-bus {
+       i2c0_hs_bus: i2c0-hs-bus-pins {
                samsung,pins = "gpb3-0", "gpb3-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       i2c1_hs_bus: i2c1-hs-bus {
+       i2c1_hs_bus: i2c1-hs-bus-pins {
                samsung,pins = "gpb3-2", "gpb3-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       i2c2_hs_bus: i2c2-hs-bus {
+       i2c2_hs_bus: i2c2-hs-bus-pins {
                samsung,pins = "gpb3-4", "gpb3-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       i2c3_hs_bus: i2c3-hs-bus {
+       i2c3_hs_bus: i2c3-hs-bus-pins {
                samsung,pins = "gpb3-6", "gpb3-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       i2c4_bus: i2c4-bus {
+       i2c4_bus: i2c4-bus-pins {
                samsung,pins = "gpb4-0", "gpb4-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       i2c5_bus: i2c5-bus {
+       i2c5_bus: i2c5-bus-pins {
                samsung,pins = "gpb4-2", "gpb4-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       i2c6_bus: i2c6-bus {
+       i2c6_bus: i2c6-bus-pins {
                samsung,pins = "gpb4-4", "gpb4-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       i2c7_bus: i2c7-bus {
+       i2c7_bus: i2c7-bus-pins {
                samsung,pins = "gpb4-6", "gpb4-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       i2c8_bus: i2c8-bus {
+       i2c8_bus: i2c8-bus-pins {
                samsung,pins = "gpb5-0", "gpb5-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       i2c9_bus: i2c9-bus {
+       i2c9_bus: i2c9-bus-pins {
                samsung,pins = "gpb5-2", "gpb5-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       i2c10_bus: i2c10-bus {
+       i2c10_bus: i2c10-bus-pins {
                samsung,pins = "gpb5-4", "gpb5-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       i2c11_bus: i2c11-bus {
+       i2c11_bus: i2c11-bus-pins {
                samsung,pins = "gpb5-6", "gpb5-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       cam_gpio_a: cam-gpio-a {
+       cam_gpio_a: cam-gpio-a-pins {
                samsung,pins = "gpe0-0", "gpe0-1", "gpe0-2", "gpe0-3",
                        "gpe0-4", "gpe0-5", "gpe0-6", "gpe0-7",
                        "gpe1-0", "gpe1-1";
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       cam_gpio_b: cam-gpio-b {
+       cam_gpio_b: cam-gpio-b-pins {
                samsung,pins = "gpf0-0", "gpf0-1", "gpf0-2", "gpf0-3",
                        "gpf1-0", "gpf1-1", "gpf1-2", "gpf1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       cam_i2c1_bus: cam-i2c1-bus {
+       cam_i2c1_bus: cam-i2c1-bus-pins {
                samsung,pins = "gpf0-2", "gpf0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       cam_i2c0_bus: cam-i2c0-bus {
+       cam_i2c0_bus: cam-i2c0-bus-pins {
                samsung,pins = "gpf0-0", "gpf0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       cam_spi0_bus: cam-spi0-bus {
+       cam_spi0_bus: cam-spi0-bus-pins {
                samsung,pins = "gpf1-0", "gpf1-1", "gpf1-2", "gpf1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV1>;
        };
 
-       cam_spi1_bus: cam-spi1-bus {
+       cam_spi1_bus: cam-spi1-bus-pins {
                samsung,pins = "gpf1-4", "gpf1-5", "gpf1-6", "gpf1-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
 };
 
 &pinctrl_1 {
-       gpc0: gpc0 {
+       gpc0: gpc0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpc1: gpc1 {
+       gpc1: gpc1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpc2: gpc2 {
+       gpc2: gpc2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpc3: gpc3 {
+       gpc3: gpc3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpc4: gpc4 {
+       gpc4: gpc4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       sd0_clk: sd0-clk {
+       sd0_clk: sd0-clk-pins {
                samsung,pins = "gpc0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV6>;
        };
 
-       sd0_cmd: sd0-cmd {
+       sd0_cmd: sd0-cmd-pins {
                samsung,pins = "gpc0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV6>;
        };
 
-       sd0_bus1: sd0-bus-width1 {
+       sd0_bus1: sd0-bus-width1-pins {
                samsung,pins = "gpc0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV6>;
        };
 
-       sd0_bus4: sd0-bus-width4 {
+       sd0_bus4: sd0-bus-width4-pins {
                samsung,pins = "gpc0-3", "gpc0-4", "gpc0-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV6>;
        };
 
-       sd0_bus8: sd0-bus-width8 {
+       sd0_bus8: sd0-bus-width8-pins {
                samsung,pins = "gpc3-0", "gpc3-1", "gpc3-2", "gpc3-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV6>;
        };
 
-       sd0_rdqs: sd0-rdqs {
+       sd0_rdqs: sd0-rdqs-pins {
                samsung,pins = "gpc0-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV6>;
        };
 
-       sd1_clk: sd1-clk {
+       sd1_clk: sd1-clk-pins {
                samsung,pins = "gpc1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV6>;
        };
 
-       sd1_cmd: sd1-cmd {
+       sd1_cmd: sd1-cmd-pins {
                samsung,pins = "gpc1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV6>;
        };
 
-       sd1_bus1: sd1-bus-width1 {
+       sd1_bus1: sd1-bus-width1-pins {
                samsung,pins = "gpc1-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV6>;
        };
 
-       sd1_bus4: sd1-bus-width4 {
+       sd1_bus4: sd1-bus-width4-pins {
                samsung,pins = "gpc1-3", "gpc1-4", "gpc1-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV6>;
        };
 
-       sd1_bus8: sd1-bus-width8 {
+       sd1_bus8: sd1-bus-width8-pins {
                samsung,pins = "gpc4-0", "gpc4-1", "gpc4-2", "gpc4-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV6>;
        };
 
-       sd2_clk: sd2-clk {
+       sd2_clk: sd2-clk-pins {
                samsung,pins = "gpc2-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV6>;
        };
 
-       sd2_cmd: sd2-cmd {
+       sd2_cmd: sd2-cmd-pins {
                samsung,pins = "gpc2-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV6>;
        };
 
-       sd2_cd: sd2-cd {
+       sd2_cd: sd2-cd-pins {
                samsung,pins = "gpc2-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV6>;
        };
 
-       sd2_bus1: sd2-bus-width1 {
+       sd2_bus1: sd2-bus-width1-pins {
                samsung,pins = "gpc2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5260_PIN_DRV_LV6>;
        };
 
-       sd2_bus4: sd2-bus-width4 {
+       sd2_bus4: sd2-bus-width4-pins {
                samsung,pins = "gpc2-4", "gpc2-5", "gpc2-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
 };
 
 &pinctrl_2 {
-       gpz0: gpz0 {
+       gpz0: gpz0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpz1: gpz1 {
+       gpz1: gpz1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
index 0dc2ec1..3c3b751 100644 (file)
                #clock-cells = <0>;
        };
 
+       ioclk_pcm: clock-pcm-ext {
+               compatible = "fixed-clock";
+               clock-frequency = <2048000>;
+               clock-output-names = "ioclk_pcm_extclk";
+               #clock-cells = <0>;
+       };
+
+       ioclk_i2s: clock-i2s-cd {
+               compatible = "fixed-clock";
+               clock-frequency = <147456000>;
+               clock-output-names = "ioclk_i2s_cdclk";
+               #clock-cells = <0>;
+       };
+
+       ioclk_spdif: clock-spdif-ext {
+               compatible = "fixed-clock";
+               clock-frequency = <49152000>;
+               clock-output-names = "ioclk_spdif_extclk";
+               #clock-cells = <0>;
+       };
+
        xrtcxti: xrtcxti {
                compatible = "fixed-clock";
                clock-frequency = <32768>;
@@ -38,7 +59,7 @@
 };
 
 &pinctrl_0 {
-       hdmi_hpd_irq: hdmi-hpd-irq {
+       hdmi_hpd_irq: hdmi-hpd-irq-pins {
                samsung,pins = "gpx3-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
index 524d244..56271e7 100644 (file)
                        compatible = "samsung,exynos5260-clock-top";
                        reg = <0x10010000 0x10000>;
                        #clock-cells = <1>;
+                       clocks = <&fin_pll>,
+                                <&clock_mif MIF_DOUT_MEM_PLL>,
+                                <&clock_mif MIF_DOUT_BUS_PLL>,
+                                <&clock_mif MIF_DOUT_MEDIA_PLL>;
+                       clock-names = "fin_pll",
+                                     "dout_mem_pll",
+                                     "dout_bus_pll",
+                                     "dout_media_pll";
                };
 
                clock_peri: clock-controller@10200000 {
                        compatible = "samsung,exynos5260-clock-peri";
                        reg = <0x10200000 0x10000>;
                        #clock-cells = <1>;
+                       clocks = <&fin_pll>,
+                                <&ioclk_pcm>,
+                                <&ioclk_i2s>,
+                                <&ioclk_spdif>,
+                                <&fin_pll>,
+                                <&clock_top TOP_DOUT_ACLK_PERI_66>,
+                                <&clock_top TOP_DOUT_SCLK_PERI_UART0>,
+                                <&clock_top TOP_DOUT_SCLK_PERI_UART1>,
+                                <&clock_top TOP_DOUT_SCLK_PERI_UART2>,
+                                <&clock_top TOP_DOUT_SCLK_PERI_SPI0_B>,
+                                <&clock_top TOP_DOUT_SCLK_PERI_SPI1_B>,
+                                <&clock_top TOP_DOUT_SCLK_PERI_SPI2_B>,
+                                <&clock_top TOP_DOUT_ACLK_PERI_AUD>;
+                       clock-names = "fin_pll",
+                                     "ioclk_pcm_extclk",
+                                     "ioclk_i2s_cdclk",
+                                     "ioclk_spdif_extclk",
+                                     "phyclk_hdmi_phy_ref_cko",
+                                     "dout_aclk_peri_66",
+                                     "dout_sclk_peri_uart0",
+                                     "dout_sclk_peri_uart1",
+                                     "dout_sclk_peri_uart2",
+                                     "dout_sclk_peri_spi0_b",
+                                     "dout_sclk_peri_spi1_b",
+                                     "dout_sclk_peri_spi2_b",
+                                     "dout_aclk_peri_aud";
                };
 
                clock_egl: clock-controller@10600000 {
                        compatible = "samsung,exynos5260-clock-egl";
                        reg = <0x10600000 0x10000>;
                        #clock-cells = <1>;
+                       clocks = <&fin_pll>,
+                                <&clock_mif MIF_DOUT_BUS_PLL>;
+                       clock-names = "fin_pll",
+                                     "dout_bus_pll";
                };
 
                clock_kfc: clock-controller@10700000 {
                        compatible = "samsung,exynos5260-clock-kfc";
                        reg = <0x10700000 0x10000>;
                        #clock-cells = <1>;
+                       clocks = <&fin_pll>,
+                                <&clock_mif MIF_DOUT_MEDIA_PLL>;
+                       clock-names = "fin_pll",
+                                     "dout_media_pll";
                };
 
                clock_g2d: clock-controller@10a00000 {
                        compatible = "samsung,exynos5260-clock-g2d";
                        reg = <0x10A00000 0x10000>;
                        #clock-cells = <1>;
+                       clocks = <&fin_pll>,
+                                <&clock_top TOP_DOUT_ACLK_G2D_333>;
+                       clock-names = "fin_pll",
+                                     "dout_aclk_g2d_333";
                };
 
                clock_mif: clock-controller@10ce0000 {
                        compatible = "samsung,exynos5260-clock-mif";
                        reg = <0x10CE0000 0x10000>;
                        #clock-cells = <1>;
+                       clocks = <&fin_pll>;
+                       clock-names = "fin_pll";
                };
 
                clock_mfc: clock-controller@11090000 {
                        compatible = "samsung,exynos5260-clock-mfc";
                        reg = <0x11090000 0x10000>;
                        #clock-cells = <1>;
+                       clocks = <&fin_pll>,
+                                <&clock_top TOP_DOUT_ACLK_MFC_333>;
+                       clock-names = "fin_pll",
+                                     "dout_aclk_mfc_333";
                };
 
                clock_g3d: clock-controller@11830000 {
                        compatible = "samsung,exynos5260-clock-g3d";
                        reg = <0x11830000 0x10000>;
                        #clock-cells = <1>;
+                       clocks = <&fin_pll>;
+                       clock-names = "fin_pll";
                };
 
                clock_fsys: clock-controller@122e0000 {
                        compatible = "samsung,exynos5260-clock-fsys";
                        reg = <0x122E0000 0x10000>;
                        #clock-cells = <1>;
+                       clocks = <&fin_pll>,
+                                <&fin_pll>,
+                                <&fin_pll>,
+                                <&fin_pll>,
+                                <&fin_pll>,
+                                <&fin_pll>,
+                                <&clock_top TOP_DOUT_ACLK_FSYS_200>;
+                       clock-names = "fin_pll",
+                                     "phyclk_usbhost20_phy_phyclock",
+                                     "phyclk_usbhost20_phy_freeclk",
+                                     "phyclk_usbhost20_phy_clk48mohci",
+                                     "phyclk_usbdrd30_udrd30_pipe_pclk",
+                                     "phyclk_usbdrd30_udrd30_phyclock",
+                                     "dout_aclk_fsys_200";
                };
 
                clock_aud: clock-controller@128c0000 {
                        compatible = "samsung,exynos5260-clock-aud";
                        reg = <0x128C0000 0x10000>;
                        #clock-cells = <1>;
+                       clocks = <&fin_pll>,
+                                <&clock_top TOP_FOUT_AUD_PLL>,
+                                <&ioclk_i2s>,
+                                <&ioclk_pcm>;
+                       clock-names = "fin_pll",
+                                     "fout_aud_pll",
+                                     "ioclk_i2s_cdclk",
+                                     "ioclk_pcm_extclk";
                };
 
                clock_isp: clock-controller@133c0000 {
                        compatible = "samsung,exynos5260-clock-isp";
                        reg = <0x133C0000 0x10000>;
                        #clock-cells = <1>;
+                       clocks = <&fin_pll>,
+                                <&clock_top TOP_DOUT_ACLK_ISP1_266>,
+                                <&clock_top TOP_DOUT_ACLK_ISP1_400>,
+                                <&clock_top TOP_MOUT_ACLK_ISP1_266>;
+                       clock-names = "fin_pll",
+                                     "dout_aclk_isp1_266",
+                                     "dout_aclk_isp1_400",
+                                     "mout_aclk_isp1_266";
                };
 
                clock_gscl: clock-controller@13f00000 {
                        compatible = "samsung,exynos5260-clock-gscl";
                        reg = <0x13F00000 0x10000>;
                        #clock-cells = <1>;
+                       clocks = <&fin_pll>,
+                                <&clock_top TOP_DOUT_ACLK_GSCL_400>,
+                                <&clock_top TOP_DOUT_ACLK_GSCL_333>;
+                       clock-names = "fin_pll",
+                                     "dout_aclk_gscl_400",
+                                     "dout_aclk_gscl_333";
                };
 
                clock_disp: clock-controller@14550000 {
                        compatible = "samsung,exynos5260-clock-disp";
                        reg = <0x14550000 0x10000>;
                        #clock-cells = <1>;
+                       clocks = <&fin_pll>,
+                                <&fin_pll>,
+                                <&fin_pll>,
+                                <&fin_pll>,
+                                <&fin_pll>,
+                                <&fin_pll>,
+                                <&fin_pll>,
+                                <&fin_pll>,
+                                <&fin_pll>,
+                                <&fin_pll>,
+                                <&fin_pll>,
+                                <&fin_pll>,
+                                <&fin_pll>,
+                                <&fin_pll>,
+                                <&ioclk_spdif>,
+                                <&clock_top TOP_DOUT_ACLK_PERI_AUD>,
+                                <&clock_top TOP_DOUT_ACLK_DISP_222>,
+                                <&clock_top TOP_DOUT_SCLK_DISP_PIXEL>,
+                                <&clock_top TOP_DOUT_ACLK_DISP_333>;
+                       clock-names = "fin_pll",
+                                     "phyclk_dptx_phy_ch3_txd_clk",
+                                     "phyclk_dptx_phy_ch2_txd_clk",
+                                     "phyclk_dptx_phy_ch1_txd_clk",
+                                     "phyclk_dptx_phy_ch0_txd_clk",
+                                     "phyclk_hdmi_phy_tmds_clko",
+                                     "phyclk_hdmi_phy_ref_clko",
+                                     "phyclk_hdmi_phy_pixel_clko",
+                                     "phyclk_hdmi_link_o_tmds_clkhi",
+                                     "phyclk_mipi_dphy_4l_m_txbyte_clkhs",
+                                     "phyclk_dptx_phy_o_ref_clk_24m",
+                                     "phyclk_dptx_phy_clk_div2",
+                                     "phyclk_mipi_dphy_4l_m_rxclkesc0",
+                                     "phyclk_hdmi_phy_ref_cko",
+                                     "ioclk_spdif_extclk",
+                                     "dout_aclk_peri_aud",
+                                     "dout_aclk_disp_222",
+                                     "dout_sclk_disp_pixel",
+                                     "dout_aclk_disp_333";
                };
 
                gic: interrupt-controller@10481000 {
index 884fef5..e54a339 100644 (file)
                interrupt-parent = <&gpx0>;
                interrupts = <4 IRQ_TYPE_NONE>;
                pinctrl-names = "default";
-               pinctrl-0 = <&max77802_irq>, <&pmic_dvs_1>, <&pmic_dvs_2>,
-                           <&pmic_dvs_3>;
+               pinctrl-0 = <&max77802_irq>, <&pmic_dvs_1>, <&pmic_dvs_2>;
                wakeup-source;
                #clock-cells = <1>;
 
                                regulator-always-on;
                        };
 
-                       ldo16_reg: LDO16 {
-                               regulator-name = "ldo16";
-                       };
-
                        ldo17_reg: LDO17 {
                                regulator-name = "cam_sensor_core";
                                regulator-min-microvolt = <1200000>;
                                regulator-max-microvolt = <2850000>;
                        };
 
-                       ldo22_reg: LDO22 {
-                               regulator-name = "ldo22";
-                       };
-
                        ldo23_reg: LDO23 {
                                regulator-name = "dp_p3v3";
                                regulator-min-microvolt = <3300000>;
                                regulator-always-on;
                        };
 
-                       ldo31_reg: LDO31 {
-                               regulator-name = "ldo31";
-                       };
-
                        /* On revisions with ti,ina231 this is sensor VS */
                        ldo32_reg: LDO32 {
                                regulator-name = "vs_power_meter";
 };
 
 &pinctrl_0 {
-       emmc_nrst_pin: emmc-nrst {
+       emmc_nrst_pin: emmc-nrst-pins {
                samsung,pins = "gpd1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       sd2_wp: sd2-wp {
+       sd2_wp: sd2-wp-pins {
                samsung,pins = "gpm5-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                /* Pin is floating so be sure to disable write-protect */
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       pmic_dvs_3: pmic-dvs-3 {
-               samsung,pins = "gpx0-0";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
-               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
-               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
-       };
-
-       pmic_dvs_2: pmic-dvs-2 {
-               samsung,pins = "gpx0-1";
+       pmic_dvs_2: pmic-dvs-2-pins {
+               samsung,pins = "gpx0-0", "gpx0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       pmic_dvs_1: pmic-dvs-1 {
+       pmic_dvs_1: pmic-dvs-1-pins {
                samsung,pins = "gpx0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-val = <1>;
        };
 
-       max77802_irq: max77802-irq {
+       max77802_irq: max77802-irq-pins {
                samsung,pins = "gpx0-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
index 9599ba8..6c7814b 100644 (file)
@@ -9,7 +9,7 @@
 #include <dt-bindings/pinctrl/samsung.h>
 
 &pinctrl_0 {
-       gpa0: gpa0 {
+       gpa0: gpa0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -17,7 +17,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpa1: gpa1 {
+       gpa1: gpa1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -25,7 +25,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpa2: gpa2 {
+       gpa2: gpa2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -33,7 +33,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpb0: gpb0 {
+       gpb0: gpb0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -41,7 +41,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpb1: gpb1 {
+       gpb1: gpb1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -49,7 +49,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpb2: gpb2 {
+       gpb2: gpb2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -57,7 +57,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpb3: gpb3 {
+       gpb3: gpb3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -65,7 +65,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpc0: gpc0 {
+       gpc0: gpc0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -73,7 +73,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpc3: gpc3 {
+       gpc3: gpc3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -81,7 +81,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpc1: gpc1 {
+       gpc1: gpc1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -89,7 +89,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpc2: gpc2 {
+       gpc2: gpc2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpm5: gpm5 {
+       gpm5: gpm5-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpd1: gpd1 {
+       gpd1: gpd1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpe0: gpe0 {
+       gpe0: gpe0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpe1: gpe1 {
+       gpe1: gpe1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf0: gpf0 {
+       gpf0: gpf0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf1: gpf1 {
+       gpf1: gpf1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpg0: gpg0 {
+       gpg0: gpg0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpg1: gpg1 {
+       gpg1: gpg1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpg2: gpg2 {
+       gpg2: gpg2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gph0: gph0 {
+       gph0: gph0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gph1: gph1 {
+       gph1: gph1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpm7: gpm7 {
+       gpm7: gpm7-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy0: gpy0 {
+       gpy0: gpy0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy1: gpy1 {
+       gpy1: gpy1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy2: gpy2 {
+       gpy2: gpy2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy3: gpy3 {
+       gpy3: gpy3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy4: gpy4 {
+       gpy4: gpy4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy5: gpy5 {
+       gpy5: gpy5-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy6: gpy6 {
+       gpy6: gpy6-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy7: gpy7 {
+       gpy7: gpy7-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpx0: gpx0 {
+       gpx0: gpx0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                             <27 1>;
        };
 
-       gpx1: gpx1 {
+       gpx1: gpx1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                             <31 1>;
        };
 
-       gpx2: gpx2 {
+       gpx2: gpx2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpx3: gpx3 {
+       gpx3: gpx3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       uart0_data: uart0-data {
+       uart0_data: uart0-data-pins {
                samsung,pins = "gpa0-0", "gpa0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       uart0_fctl: uart0-fctl {
+       uart0_fctl: uart0-fctl-pins {
                samsung,pins = "gpa0-2", "gpa0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       uart1_data: uart1-data {
+       uart1_data: uart1-data-pins {
                samsung,pins = "gpa0-4", "gpa0-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       uart1_fctl: uart1-fctl {
+       uart1_fctl: uart1-fctl-pins {
                samsung,pins = "gpa0-6", "gpa0-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       i2c2_bus: i2c2-bus {
+       i2c2_bus: i2c2-bus-pins {
                samsung,pins = "gpa0-6", "gpa0-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       uart2_data: uart2-data {
+       uart2_data: uart2-data-pins {
                samsung,pins = "gpa1-0", "gpa1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       uart2_fctl: uart2-fctl {
+       uart2_fctl: uart2-fctl-pins {
                samsung,pins = "gpa1-2", "gpa1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       i2c3_bus: i2c3-bus {
+       i2c3_bus: i2c3-bus-pins {
                samsung,pins = "gpa1-2", "gpa1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       uart3_data: uart3-data {
+       uart3_data: uart3-data-pins {
                samsung,pins = "gpa1-4", "gpa1-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       i2c4_hs_bus: i2c4-hs-bus {
+       i2c4_hs_bus: i2c4-hs-bus-pins {
                samsung,pins = "gpa2-0", "gpa2-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       i2c5_hs_bus: i2c5-hs-bus {
+       i2c5_hs_bus: i2c5-hs-bus-pins {
                samsung,pins = "gpa2-2", "gpa2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       i2c6_hs_bus: i2c6-hs-bus {
+       i2c6_hs_bus: i2c6-hs-bus-pins {
                samsung,pins = "gpb1-3", "gpb1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       pwm0_out: pwm0-out {
+       pwm0_out: pwm0-out-pins {
                samsung,pins = "gpb2-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       pwm1_out: pwm1-out {
+       pwm1_out: pwm1-out-pins {
                samsung,pins = "gpb2-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       pwm2_out: pwm2-out {
+       pwm2_out: pwm2-out-pins {
                samsung,pins = "gpb2-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       pwm3_out: pwm3-out {
+       pwm3_out: pwm3-out-pins {
                samsung,pins = "gpb2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       i2c7_hs_bus: i2c7-hs-bus {
+       i2c7_hs_bus: i2c7-hs-bus-pins {
                samsung,pins = "gpb2-2", "gpb2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       i2c0_bus: i2c0-bus {
+       i2c0_bus: i2c0-bus-pins {
                samsung,pins = "gpb3-0", "gpb3-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       i2c1_bus: i2c1-bus {
+       i2c1_bus: i2c1-bus-pins {
                samsung,pins = "gpb3-2", "gpb3-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       sd0_clk: sd0-clk {
+       sd0_clk: sd0-clk-pins {
                samsung,pins = "gpc0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd0_cmd: sd0-cmd {
+       sd0_cmd: sd0-cmd-pins {
                samsung,pins = "gpc0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd0_cd: sd0-cd {
+       sd0_cd: sd0-cd-pins {
                samsung,pins = "gpc0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd0_bus1: sd0-bus-width1 {
+       sd0_bus1: sd0-bus-width1-pins {
                samsung,pins = "gpc0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd0_bus4: sd0-bus-width4 {
+       sd0_bus4: sd0-bus-width4-pins {
                samsung,pins = "gpc0-4", "gpc0-5", "gpc0-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd2_clk: sd2-clk {
+       sd2_clk: sd2-clk-pins {
                samsung,pins = "gpc2-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd2_cmd: sd2-cmd {
+       sd2_cmd: sd2-cmd-pins {
                samsung,pins = "gpc2-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd2_cd: sd2-cd {
+       sd2_cd: sd2-cd-pins {
                samsung,pins = "gpc2-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd2_bus1: sd2-bus-width1 {
+       sd2_bus1: sd2-bus-width1-pins {
                samsung,pins = "gpc2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd2_bus4: sd2-bus-width4 {
+       sd2_bus4: sd2-bus-width4-pins {
                samsung,pins = "gpc2-4", "gpc2-5", "gpc2-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd0_bus8: sd0-bus-width8 {
+       sd0_bus8: sd0-bus-width8-pins {
                samsung,pins = "gpc3-0", "gpc3-1", "gpc3-2", "gpc3-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
 };
 
 &pinctrl_1 {
-       gpj0: gpj0 {
+       gpj0: gpj0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpj1: gpj1 {
+       gpj1: gpj1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpj2: gpj2 {
+       gpj2: gpj2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpj3: gpj3 {
+       gpj3: gpj3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpj4: gpj4 {
+       gpj4: gpj4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpk0: gpk0 {
+       gpk0: gpk0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpk1: gpk1 {
+       gpk1: gpk1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpk2: gpk2 {
+       gpk2: gpk2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpk3: gpk3 {
+       gpk3: gpk3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       usb3_1_oc: usb3-1-oc {
+       usb3_1_oc: usb3-1-oc-pins {
                samsung,pins = "gpk2-4", "gpk2-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       usb3_1_vbusctrl: usb3-1-vbusctrl {
+       usb3_1_vbusctrl: usb3-1-vbusctrl-pins {
                samsung,pins = "gpk2-6", "gpk2-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       usb3_0_oc: usb3-0-oc {
+       usb3_0_oc: usb3-0-oc-pins {
                samsung,pins = "gpk3-0", "gpk3-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       usb3_0_vbusctrl: usb3-0-vbusctrl {
+       usb3_0_vbusctrl: usb3-0-vbusctrl-pins {
                samsung,pins = "gpk3-2", "gpk3-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
 };
 
 &pinctrl_2 {
-       gpv0: gpv0 {
+       gpv0: gpv0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpv1: gpv1 {
+       gpv1: gpv1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpv2: gpv2 {
+       gpv2: gpv2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpv3: gpv3 {
+       gpv3: gpv3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpv4: gpv4 {
+       gpv4: gpv4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
 };
 
 &pinctrl_3 {
-       gpz: gpz {
+       gpz: gpz-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       audi2s0_bus: audi2s0-bus {
+       audi2s0_bus: audi2s0-bus-pins {
                samsung,pins = "gpz-0", "gpz-1", "gpz-2", "gpz-3",
                                "gpz-4";
                samsung,pin-function = <2>;
index 2a3ade7..b8f953c 100644 (file)
                reg = <0x02037000 0x1000>;
        };
 
+       vdd10_usb3: voltage-regulator-0 {
+               compatible = "regulator-fixed";
+               regulator-name = "VDD10_USB3";
+               regulator-min-microvolt = <1000000>;
+               regulator-max-microvolt = <1000000>;
+       };
+
+       vdd33_usb3: voltage-regulator-0 {
+               compatible = "regulator-fixed";
+               regulator-name = "VDD33_USB3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+       };
 };
 
 &mmc_0 {
 };
 
 &pinctrl_0 {
-       srom_ctl: srom-ctl {
+       srom_ctl: srom-ctl-pins {
                samsung,pins = "gpy0-3", "gpy0-4", "gpy0-5",
                               "gpy1-0", "gpy1-1", "gpy1-2", "gpy1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       srom_ebi: srom-ebi {
+       srom_ebi: srom-ebi-pins {
                samsung,pins = "gpy3-0", "gpy3-1", "gpy3-2", "gpy3-3",
                               "gpy3-4", "gpy3-5", "gpy3-6", "gpy3-7",
                               "gpy5-0", "gpy5-1", "gpy5-2", "gpy5-3",
 &serial_2 {
        status = "okay";
 };
+
+&usbdrd3_0 {
+       vdd10-supply = <&vdd10_usb3>;
+       vdd33-supply = <&vdd33_usb3>;
+};
+
+&usbdrd3_1 {
+       vdd10-supply = <&vdd10_usb3>;
+       vdd33-supply = <&vdd33_usb3>;
+};
index 584ce62..4d797a9 100644 (file)
                        interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>;
                };
 
-               pdma0: pdma@121a0000 {
+               pdma0: dma-controller@121a0000 {
                        compatible = "arm,pl330", "arm,primecell";
                        reg = <0x121a0000 0x1000>;
                        interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
                        #dma-requests = <32>;
                };
 
-               pdma1: pdma@121b0000 {
+               pdma1: dma-controller@121b0000 {
                        compatible = "arm,pl330", "arm,primecell";
                        reg = <0x121b0000 0x1000>;
                        interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
index dfc7f14..946b791 100644 (file)
 };
 
 &pinctrl_0 {
-       s2mps11_irq: s2mps11-irq {
+       s2mps11_irq: s2mps11-irq-pins {
                samsung,pins = "gpx3-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
 &usbdrd_dwc3_1 {
        dr_mode = "host";
 };
+
+&usbdrd3_0 {
+       vdd10-supply = <&ldo11_reg>;
+       vdd33-supply = <&ldo9_reg>;
+};
+
+&usbdrd3_1 {
+       vdd10-supply = <&ldo11_reg>;
+       vdd33-supply = <&ldo9_reg>;
+};
diff --git a/arch/arm/boot/dts/exynos5420-chagall-wifi.dts b/arch/arm/boot/dts/exynos5420-chagall-wifi.dts
new file mode 100644 (file)
index 0000000..1319344
--- /dev/null
@@ -0,0 +1,75 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Samsung's Exynos5420 Chagall WiFi board device tree source
+ *
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ * Copyright (c) 2022 Henrik Grimler
+ */
+
+/dts-v1/;
+#include "exynos5420-galaxy-tab-common.dtsi"
+
+/ {
+       model = "Samsung Chagall WiFi based on Exynos5420";
+       compatible = "samsung,chagall-wifi", "samsung,exynos5420", \
+                    "samsung,exynos5";
+};
+
+&ldo15_reg {
+       /* Unused */
+       regulator-name = "VDD_LDO15";
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+};
+
+&ldo17_reg {
+       regulator-name = "VDD_IRLED_3V3";
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3350000>;
+       regulator-always-on;
+       regulator-boot-on;
+
+       regulator-state-mem {
+               regulator-off-in-suspend;
+       };
+};
+
+&ldo28_reg {
+       /* Unused */
+       regulator-name = "VDD_LDO28";
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+};
+
+&ldo29_reg {
+       regulator-name = "VDD_TCON_1V8";
+       regulator-min-microvolt = <1900000>;
+       regulator-max-microvolt = <1900000>;
+
+       regulator-state-mem {
+               regulator-off-in-suspend;
+       };
+};
+
+&ldo31_reg {
+       regulator-name = "VDD_GRIP_1V8";
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <1800000>;
+       regulator-always-on;
+       regulator-boot-on;
+
+       regulator-state-mem {
+               regulator-off-in-suspend;
+       };
+};
+
+&ldo32_reg {
+       regulator-name = "VDD_TSP_1V8";
+       regulator-min-microvolt = <1900000>;
+       regulator-max-microvolt = <1900000>;
+
+       regulator-state-mem {
+               regulator-off-in-suspend;
+       };
+};
diff --git a/arch/arm/boot/dts/exynos5420-galaxy-tab-common.dtsi b/arch/arm/boot/dts/exynos5420-galaxy-tab-common.dtsi
new file mode 100644 (file)
index 0000000..d19bc3d
--- /dev/null
@@ -0,0 +1,691 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Base DT for Samsung's family of tablets based on Exynos5420.
+ *
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ * Copyright (c) 2022 Henrik Grimler
+ */
+
+/dts-v1/;
+#include "exynos5420.dtsi"
+#include "exynos5420-cpus.dtsi"
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/clock/samsung,s2mps11.h>
+
+/ {
+       chassis-type = "tablet";
+
+       /*
+        * To successfully boot the mainline kernel with the stock
+        * bootloader (SBOOT), the tlb needs to be flushed after the
+        * page table pointer has been updated in __common_mmu_cache_on.
+        * The same hack is also needed to boot exynos4412-i9300 with
+        * stock bootloader, and probably other Samsung devices of
+        * similar age.  See
+        * https://lore.kernel.org/all/1355276466-18295-1-git-send-email-arve@android.com
+        * for more details.
+        */
+
+       chosen {
+               stdout-path = "serial2:115200n8";
+       };
+
+       memory@20000000 {
+               device_type = "memory";
+               reg = <0x20000000 0xc0000000>;
+       };
+
+       firmware@2073000 {
+               compatible = "samsung,secure-firmware";
+               reg = <0x02073000 0x1000>;
+       };
+
+       fixed-rate-clocks {
+               oscclk {
+                       compatible = "samsung,exynos5420-oscclk";
+                       clock-frequency = <24000000>;
+               };
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               pinctrl-names = "default";
+
+               key-power {
+                       debounce-interval = <10>;
+                       gpios = <&gpx2 2 GPIO_ACTIVE_LOW>;
+                       label = "Power";
+                       linux,code = <KEY_POWER>;
+                       wakeup-source;
+               };
+
+               key-home {
+                       debounce-interval = <10>;
+                       gpios = <&gpx0 5 GPIO_ACTIVE_LOW>;
+                       label = "Home";
+                       linux,code = <KEY_HOME>;
+                       wakeup-source;
+               };
+
+               key-volume-up {
+                       debounce-interval = <10>;
+                       gpios = <&gpx0 2 GPIO_ACTIVE_LOW>;
+                       label = "Volume Up";
+                       linux,code = <KEY_VOLUMEUP>;
+               };
+
+               key-volume-down {
+                       debounce-interval = <10>;
+                       gpios = <&gpx0 3 GPIO_ACTIVE_LOW>;
+                       label = "Volume Down";
+                       linux,code = <KEY_VOLUMEDOWN>;
+               };
+       };
+};
+
+&cci {
+       /* CCI is disabled in hardware */
+       status = "disabled";
+};
+
+&cpu0 {
+       cpu-supply = <&buck2_reg>;
+};
+
+&cpu4 {
+       cpu-supply = <&buck6_reg>;
+};
+
+&gpu {
+       status = "okay";
+       mali-supply = <&buck4_reg>;
+};
+
+&hsi2c_7 {
+       status = "okay";
+
+       pmic@66 {
+               compatible = "samsung,s2mps11-pmic";
+               reg = <0x66>;
+
+               interrupt-parent = <&gpx3>;
+               interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&s2mps11_irq>;
+
+               s2mps11_osc: clocks {
+                       compatible = "samsung,s2mps11-clk";
+                       #clock-cells = <1>;
+                       clock-output-names = "s2mps11_ap", "s2mps11_cp",
+                                            "s2mps11_bt";
+               };
+
+               regulators {
+                       buck1_reg: BUCK1 {
+                               regulator-name = "VDD_MIF_1V1";
+                               regulator-min-microvolt = <700000>;
+                               regulator-max-microvolt = <1300000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       buck2_reg: BUCK2 {
+                               regulator-name = "VDD_ARM_1V0";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1500000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       buck3_reg: BUCK3 {
+                               regulator-name = "VDD_INT_1V0";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1400000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       buck4_reg: BUCK4 {
+                               regulator-name = "VDD_G3D_1V0";
+                               regulator-min-microvolt = <700000>;
+                               regulator-max-microvolt = <1400000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       buck5_reg: BUCK5 {
+                               regulator-name = "VDD_MEM_1V2";
+                               regulator-min-microvolt = <1200000>;
+                               regulator-max-microvolt = <1200000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+
+                       };
+
+                       buck6_reg: BUCK6 {
+                               regulator-name = "VDD_KFC_1V0";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1500000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       buck7_reg: BUCK7 {
+                               regulator-name = "VIN_LLDO_1V4";
+                               regulator-min-microvolt = <1200000>;
+                               regulator-max-microvolt = <1500000>;
+                               regulator-always-on;
+                       };
+
+                       buck8_reg: BUCK8 {
+                               regulator-name = "VIN_MLDO_2V0";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <2100000>;
+                               regulator-always-on;
+                       };
+
+                       buck9_reg: BUCK9 {
+                               regulator-name = "VIN_HLDO_3V5";
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3500000>;
+                               regulator-always-on;
+                       };
+
+                       buck10_reg: BUCK10 {
+                               regulator-name = "VDD_CAM_ISP_1V0";
+                               regulator-min-microvolt = <750000>;
+                               regulator-max-microvolt = <3550000>;
+                       };
+
+                       ldo1_reg: LDO1 {
+                               regulator-name = "VDD_ALIVE_1.0V";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                       };
+
+                       ldo2_reg: LDO2 {
+                               regulator-name = "VDD_APIO_1V8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       ldo3_reg: LDO3 {
+                               regulator-name = "VDD_APIO_MMC01_1V8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       ldo4_reg: LDO4 {
+                               regulator-name = "VDD_ADC_1V8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       ldo5_reg: LDO5 {
+                               /* Unused */
+                               regulator-name = "VDD_LDO5";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                       };
+
+                       ldo6_reg: LDO6 {
+                               regulator-name = "VDD_MIPI_1V0";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       ldo7_reg: LDO7 {
+                               regulator-name = "VDD_MIPI_PLL_ABB1_18V";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       ldo8_reg: LDO8 {
+                               /* Unused */
+                               regulator-name = "VDD_LDO8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                       };
+
+                       ldo9_reg: LDO9 {
+                               regulator-name = "VDD_UOTG_3V0";
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3000000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       ldo10_reg: LDO10 {
+                               regulator-name = "VDDQ_PRE_1V8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       ldo11_reg: LDO11 {
+                               regulator-name = "VDD_HSIC_1V0";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       ldo12_reg: LDO12 {
+                               regulator-name = "VDD_HSIC_1V8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       ldo13_reg: LDO13 {
+                               regulator-name = "VDD_APIO_MMC2_2V8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <2800000>;
+                               regulator-boot-on;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       ldo14_reg: LDO14 {
+                               regulator-name = "VDD_MOTOR_3V0";
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3000000>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       ldo15_reg: LDO15 {
+                               regulator-name = "VDD_LDO15";
+                               /*
+                                * LDO15 varies between devices and is
+                                * specified in the device dts
+                                */
+                       };
+
+                       ldo16_reg: LDO16 {
+                               regulator-name = "VDD_AP_2V8";
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       ldo17_reg: LDO17 {
+                               regulator-name = "VDD_LDO17";
+                               /*
+                                * LDO17 varies between devices and is
+                                * specified in the device dts
+                                */
+                       };
+
+                       ldo18_reg: LDO18 {
+                               /* Unused */
+                               regulator-name = "VDD_LDO18";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                       };
+
+                       ldo19_reg: LDO19 {
+                               regulator-name = "VDD_VTF_2V8";
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       ldo20_reg: LDO20 {
+                               regulator-name = "VDD_CAM1_CAM_1V8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       ldo21_reg: LDO21 {
+                               regulator-name = "VDD_CAM_IO_1V8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       ldo22_reg: LDO22 {
+                               regulator-name = "VDD_CAM0_S_CORE_1V1";
+                               regulator-min-microvolt = <1050000>;
+                               regulator-max-microvolt = <1200000>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       ldo23_reg: LDO23 {
+                               regulator-name = "VDD_MIFS_1V1";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1100000>;
+                               regulator-always-on;
+
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       ldo24_reg: LDO24 {
+                               regulator-name = "VDD_TSP_3V3";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       ldo25_reg: LDO25 {
+                               /* Unused */
+                               regulator-name = "VDD_LDO25";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <3950000>;
+                       };
+
+                       ldo26_reg: LDO26 {
+                               regulator-name = "VDD_CAM0_AF_2V8";
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       ldo27_reg: LDO27 {
+                               regulator-name = "VDD_G3DS_1V0";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       ldo28_reg: LDO28 {
+                               regulator-name = "VDD_LDO28";
+                               /*
+                                * LDO28 varies between devices and is
+                                * specified in the device dts
+                                */
+                       };
+
+                       ldo29_reg: LDO29 {
+                               regulator-name = "VDD_LDO29";
+                               /*
+                                * LDO29 varies between devices and is
+                                * specified in the device dts
+                                */
+                       };
+
+                       ldo30_reg: LDO30 {
+                               regulator-name = "VDD_TOUCH_1V8";
+                               regulator-min-microvolt = <1900000>;
+                               regulator-max-microvolt = <1900000>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       ldo31_reg: LDO31 {
+                               regulator-name = "VDD_LDO31";
+                               /*
+                                * LDO31 varies between devices and is
+                                * specified in the device dts
+                                */
+                       };
+
+                       ldo32_reg: LDO32 {
+                               regulator-name = "VDD_LDO32";
+                               /*
+                                * LDO32 varies between devices and is
+                                * specified in the device dts
+                                */
+                       };
+
+                       ldo33_reg: LDO33 {
+                               regulator-name = "VDD_MHL_1V8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       ldo34_reg: LDO34 {
+                               regulator-name = "VDD_MHL_3V3";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       ldo35_reg: LDO35 {
+                               regulator-name = "VDD_SIL_1V2";
+                               regulator-min-microvolt = <1200000>;
+                               regulator-max-microvolt = <1200000>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       ldo36_reg: LDO36 {
+                               /* Unused */
+                               regulator-name = "VDD_LDO36";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <3950000>;
+                       };
+
+                       ldo37_reg: LDO37 {
+                               /* Unused */
+                               regulator-name = "VDD_LDO37";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <3950000>;
+                       };
+
+                       ldo38_reg: LDO38 {
+                               regulator-name = "VDD_KEY_LED_3V3";
+                               regulator-min-microvolt = <2500000>;
+                               regulator-max-microvolt = <3300000>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+               };
+       };
+};
+
+&mixer {
+       status = "okay";
+};
+
+/* Internal storage */
+&mmc_0 {
+       status = "okay";
+       bus-width = <8>;
+       cap-mmc-highspeed;
+       card-detect-delay = <200>;
+       mmc-hs200-1_8v;
+       non-removable;
+       pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus1 &sd0_bus4 &sd0_bus8>;
+       pinctrl-names = "default";
+       samsung,dw-mshc-ciu-div = <3>;
+       samsung,dw-mshc-ddr-timing = <0 2>;
+       samsung,dw-mshc-sdr-timing = <0 4>;
+       vqmmc-supply = <&ldo3_reg>;
+};
+
+/* External sdcard */
+&mmc_2 {
+       status = "okay";
+       bus-width = <4>;
+       cap-sd-highspeed;
+       card-detect-delay = <200>;
+       cd-gpios = <&gpx2 4 GPIO_ACTIVE_LOW>;
+       pinctrl-0 = <&sd2_clk &sd2_cmd &mmc2_cd &sd2_bus1 &sd2_bus4>;
+       pinctrl-names = "default";
+       samsung,dw-mshc-ciu-div = <3>;
+       samsung,dw-mshc-ddr-timing = <0 2>;
+       samsung,dw-mshc-sdr-timing = <0 4>;
+       sd-uhs-sdr50;
+       vmmc-supply = <&ldo19_reg>;
+       vqmmc-supply = <&ldo13_reg>;
+};
+
+&pinctrl_0 {
+       mmc2_cd: mmc2-cd-pins {
+               samsung,pins = "gpx2-4";
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+       };
+
+       s2mps11_irq: s2mps11-irq-pins {
+               samsung,pins = "gpx3-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+};
+
+&rtc {
+       status = "okay";
+       clocks = <&clock CLK_RTC>, <&s2mps11_osc S2MPS11_CLK_AP>;
+       clock-names = "rtc", "rtc_src";
+};
+
+&tmu_cpu0 {
+       vtmu-supply = <&ldo10_reg>;
+};
+
+&tmu_cpu1 {
+       vtmu-supply = <&ldo10_reg>;
+};
+
+&tmu_cpu2 {
+       vtmu-supply = <&ldo10_reg>;
+};
+
+&tmu_cpu3 {
+       vtmu-supply = <&ldo10_reg>;
+};
+
+&tmu_gpu {
+       vtmu-supply = <&ldo10_reg>;
+};
+
+&usbdrd_dwc3_0 {
+       dr_mode = "peripheral";
+};
+
+&usbdrd_dwc3_1 {
+       dr_mode = "peripheral";
+};
+
+&usbdrd3_0 {
+       vdd33-supply = <&ldo9_reg>;
+       vdd10-supply = <&ldo11_reg>;
+};
+
+&usbdrd3_1 {
+       vdd33-supply = <&ldo9_reg>;
+       vdd10-supply = <&ldo11_reg>;
+};
diff --git a/arch/arm/boot/dts/exynos5420-klimt-wifi.dts b/arch/arm/boot/dts/exynos5420-klimt-wifi.dts
new file mode 100644 (file)
index 0000000..011787b
--- /dev/null
@@ -0,0 +1,75 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Samsung's Exynos5420 Klimt WiFi board device tree source
+ *
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ * Copyright (c) 2022 Henrik Grimler
+ */
+
+/dts-v1/;
+#include "exynos5420-galaxy-tab-common.dtsi"
+
+/ {
+       model = "Samsung Klimt WiFi based on Exynos5420";
+       compatible = "samsung,klimt-wifi", "samsung,exynos5420", \
+                    "samsung,exynos5";
+};
+
+&ldo15_reg {
+       /* Unused */
+       regulator-name = "VDD_LDO15";
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+};
+
+&ldo17_reg {
+       regulator-name = "VDD_VCI_3V0";
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+
+       regulator-state-mem {
+               regulator-off-in-suspend;
+       };
+};
+
+&ldo28_reg {
+       regulator-name = "VDD3_1V8";
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <1800000>;
+
+       regulator-state-mem {
+               regulator-off-in-suspend;
+       };
+};
+
+&ldo29_reg {
+       regulator-name = "VDDR_1V6";
+       regulator-min-microvolt = <1600000>;
+       regulator-max-microvolt = <1600000>;
+
+       regulator-state-mem {
+               regulator-off-in-suspend;
+       };
+};
+
+&ldo31_reg {
+       /* Unused */
+       regulator-name = "VDD_LDO31";
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <1800000>;
+};
+
+&ldo32_reg {
+       regulator-name = "VDD_TSP_1V8";
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <1800000>;
+
+       regulator-state-mem {
+               regulator-off-in-suspend;
+       };
+};
+
+&mmc_2 {
+       sd-uhs-sdr104;
+};
index e76fb10..d6434ec 100644 (file)
                interrupts = <1 IRQ_TYPE_NONE>;
                pinctrl-names = "default";
                pinctrl-0 = <&max77802_irq>, <&pmic_selb>,
-                           <&pmic_dvs_1>, <&pmic_dvs_2>, <&pmic_dvs_3>;
+                           <&pmic_dvs_1>, <&pmic_dvs_2>;
                wakeup-source;
                reg = <0x9>;
                #clock-cells = <1>;
        pinctrl-names = "default";
        pinctrl-0 = <&mask_tpm_reset>;
 
-       wifi_en: wifi-en {
+       wifi_en: wifi-en-pins {
                samsung,pins = "gpx0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       max98090_irq: max98090-irq {
+       max98090_irq: max98090-irq-pins {
                samsung,pins = "gpx0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
        /* We need GPX0_6 to be low at sleep time; just keep it low always */
-       mask_tpm_reset: mask-tpm-reset {
+       mask_tpm_reset: mask-tpm-reset-pins {
                samsung,pins = "gpx0-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-val = <0>;
        };
 
-       tpm_irq: tpm-irq {
+       tpm_irq: tpm-irq-pins {
                samsung,pins = "gpx1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       trackpad_irq: trackpad-irq {
+       trackpad_irq: trackpad-irq-pins {
                samsung,pins = "gpx1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       power_key_irq: power-key-irq {
+       power_key_irq: power-key-irq-pins {
                samsung,pins = "gpx1-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       ec_irq: ec-irq {
+       ec_irq: ec-irq-pins {
                samsung,pins = "gpx1-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       tps65090_irq: tps65090-irq {
+       tps65090_irq: tps65090-irq-pins {
                samsung,pins = "gpx2-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       dp_hpd_gpio: dp_hpd_gpio {
+       dp_hpd_gpio: dp-hpd-gpio-pins {
                samsung,pins = "gpx2-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       max77802_irq: max77802-irq {
+       max77802_irq: max77802-irq-pins {
                samsung,pins = "gpx3-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       lid_irq: lid-irq {
+       lid_irq: lid-irq-pins {
                samsung,pins = "gpx3-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       hdmi_hpd_irq: hdmi-hpd-irq {
+       hdmi_hpd_irq: hdmi-hpd-irq-pins {
                samsung,pins = "gpx3-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       pmic_dvs_1: pmic-dvs-1 {
+       pmic_dvs_1: pmic-dvs-1-pins {
                samsung,pins = "gpy7-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 };
 
-&pinctrl_1 {
-       /* Adjust WiFi drive strengths lower for EMI */
-       sd1_clk: sd1-clk {
-               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
-       };
+/* pinctrl_1 */
+/* Adjust WiFi drive strengths lower for EMI */
+&sd1_bus1 {
+       samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+};
 
-       sd1_cmd: sd1-cmd {
-               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
-       };
+&sd1_bus4 {
+       samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+};
 
-       sd1_bus1: sd1-bus-width1 {
-               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
-       };
+&sd1_bus8 {
+       samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+};
 
-       sd1_bus4: sd1-bus-width4 {
-               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
-       };
+&sd1_clk {
+       samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+};
 
-       sd1_bus8: sd1-bus-width8 {
-               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
-       };
+&sd1_cmd {
+       samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
 };
 
 &pinctrl_2 {
-       pmic_dvs_2: pmic-dvs-2 {
-               samsung,pins = "gpj4-2";
+       pmic_dvs_2: pmic-dvs-2-pins {
+               samsung,pins = "gpj4-2", "gpj4-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
+};
 
-       pmic_dvs_3: pmic-dvs-3 {
-               samsung,pins = "gpj4-3";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
-               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
-               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
-       };
+/* pinctrl_3*/
+/* Drive SPI lines at x2 for better integrity */
+&spi2_bus {
+       samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
 };
 
 &pinctrl_3 {
-       /* Drive SPI lines at x2 for better integrity */
-       spi2-bus {
-               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
-       };
-
        /* Drive SPI chip select at x2 for better integrity */
-       ec_spi_cs: ec-spi-cs {
+       ec_spi_cs: ec-spi-cs-pins {
                samsung,pins = "gpb1-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
        };
 
-       usb300_vbus_en: usb300-vbus-en {
+       usb300_vbus_en: usb300-vbus-en-pins {
                samsung,pins = "gph0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       usb301_vbus_en: usb301-vbus-en {
+       usb301_vbus_en: usb301-vbus-en-pins {
                samsung,pins = "gph0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       pmic_selb: pmic-selb {
+       pmic_selb: pmic-selb-pins {
                samsung,pins = "gph0-2", "gph0-3", "gph0-4", "gph0-5",
                               "gph0-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
        vtmu-supply = <&ldo10_reg>;
 };
 
+&usbdrd3_0 {
+       vdd10-supply = <&ldo15_reg>;
+       vdd33-supply = <&ldo12_reg>;
+};
+
+&usbdrd3_1 {
+       vdd10-supply = <&ldo15_reg>;
+       vdd33-supply = <&ldo12_reg>;
+};
+
 &usbdrd_dwc3_0 {
        dr_mode = "host";
 };
index b82af7c..546ba27 100644 (file)
@@ -12,7 +12,7 @@
 #include <dt-bindings/pinctrl/samsung.h>
 
 &pinctrl_0 {
-       gpy7: gpy7 {
+       gpy7: gpy7-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -20,7 +20,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpx0: gpx0 {
+       gpx0: gpx0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -31,7 +31,7 @@
                             <26 0>, <26 1>, <27 0>, <27 1>;
        };
 
-       gpx1: gpx1 {
+       gpx1: gpx1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -42,7 +42,7 @@
                             <30 0>, <30 1>, <31 0>, <31 1>;
        };
 
-       gpx2: gpx2 {
+       gpx2: gpx2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -50,7 +50,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpx3: gpx3 {
+       gpx3: gpx3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       dp_hpd: dp_hpd {
+       dp_hpd: dp-hpd-pins {
                samsung,pins = "gpx0-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       hdmi_cec: hdmi-cec {
+       hdmi_cec: hdmi-cec-pins {
                samsung,pins = "gpx3-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
@@ -74,7 +74,7 @@
 };
 
 &pinctrl_1 {
-       gpc0: gpc0 {
+       gpc0: gpc0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -82,7 +82,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpc1: gpc1 {
+       gpc1: gpc1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -90,7 +90,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpc2: gpc2 {
+       gpc2: gpc2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -98,7 +98,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpc3: gpc3 {
+       gpc3: gpc3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpc4: gpc4 {
+       gpc4: gpc4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpd1: gpd1 {
+       gpd1: gpd1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpy0: gpy0 {
+       gpy0: gpy0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy1: gpy1 {
+       gpy1: gpy1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy2: gpy2 {
+       gpy2: gpy2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy3: gpy3 {
+       gpy3: gpy3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy4: gpy4 {
+       gpy4: gpy4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy5: gpy5 {
+       gpy5: gpy5-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpy6: gpy6 {
+       gpy6: gpy6-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       sd0_clk: sd0-clk {
+       sd0_clk: sd0-clk-pins {
                samsung,pins = "gpc0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd0_cmd: sd0-cmd {
+       sd0_cmd: sd0-cmd-pins {
                samsung,pins = "gpc0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd0_cd: sd0-cd {
+       sd0_cd: sd0-cd-pins {
                samsung,pins = "gpc0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd0_bus1: sd0-bus-width1 {
+       sd0_bus1: sd0-bus-width1-pins {
                samsung,pins = "gpc0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd0_bus4: sd0-bus-width4 {
+       sd0_bus4: sd0-bus-width4-pins {
                samsung,pins = "gpc0-4", "gpc0-5", "gpc0-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd0_bus8: sd0-bus-width8 {
+       sd0_bus8: sd0-bus-width8-pins {
                samsung,pins = "gpc3-0", "gpc3-1", "gpc3-2", "gpc3-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd0_rclk: sd0-rclk {
+       sd0_rclk: sd0-rclk-pins {
                samsung,pins = "gpc0-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd1_clk: sd1-clk {
+       sd1_clk: sd1-clk-pins {
                samsung,pins = "gpc1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd1_cmd: sd1-cmd {
+       sd1_cmd: sd1-cmd-pins {
                samsung,pins = "gpc1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd1_cd: sd1-cd {
+       sd1_cd: sd1-cd-pins {
                samsung,pins = "gpc1-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd1_int: sd1-int {
+       sd1_int: sd1-int-pins {
                samsung,pins = "gpd1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       sd1_bus1: sd1-bus-width1 {
+       sd1_bus1: sd1-bus-width1-pins {
                samsung,pins = "gpc1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd1_bus4: sd1-bus-width4 {
+       sd1_bus4: sd1-bus-width4-pins {
                samsung,pins = "gpc1-4", "gpc1-5", "gpc1-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd1_bus8: sd1-bus-width8 {
+       sd1_bus8: sd1-bus-width8-pins {
                samsung,pins = "gpd1-4", "gpd1-5", "gpd1-6", "gpd1-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd2_clk: sd2-clk {
+       sd2_clk: sd2-clk-pins {
                samsung,pins = "gpc2-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd2_cmd: sd2-cmd {
+       sd2_cmd: sd2-cmd-pins {
                samsung,pins = "gpc2-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd2_cd: sd2-cd {
+       sd2_cd: sd2-cd-pins {
                samsung,pins = "gpc2-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd2_bus1: sd2-bus-width1 {
+       sd2_bus1: sd2-bus-width1-pins {
                samsung,pins = "gpc2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd2_bus4: sd2-bus-width4 {
+       sd2_bus4: sd2-bus-width4-pins {
                samsung,pins = "gpc2-4", "gpc2-5", "gpc2-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
        };
 
-       sd2_wp: sd2-wp {
+       sd2_wp: sd2-wp-pins {
                samsung,pins = "gpc4-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
 };
 
 &pinctrl_2 {
-       gpe0: gpe0 {
+       gpe0: gpe0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpe1: gpe1 {
+       gpe1: gpe1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf0: gpf0 {
+       gpf0: gpf0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf1: gpf1 {
+       gpf1: gpf1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpg0: gpg0 {
+       gpg0: gpg0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpg1: gpg1 {
+       gpg1: gpg1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpg2: gpg2 {
+       gpg2: gpg2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpj4: gpj4 {
+       gpj4: gpj4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       cam_gpio_a: cam-gpio-a {
+       cam_gpio_a: cam-gpio-a-pins {
                samsung,pins = "gpe0-0", "gpe0-1", "gpe0-2", "gpe0-3",
                               "gpe0-4", "gpe0-5", "gpe0-6", "gpe0-7",
                               "gpe1-0", "gpe1-1";
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       cam_gpio_b: cam-gpio-b {
+       cam_gpio_b: cam-gpio-b-pins {
                samsung,pins = "gpf0-0", "gpf0-1", "gpf0-2", "gpf0-3",
                               "gpf1-0", "gpf1-1", "gpf1-2", "gpf1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       cam_i2c2_bus: cam-i2c2-bus {
+       cam_i2c2_bus: cam-i2c2-bus-pins {
                samsung,pins = "gpf0-4", "gpf0-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       cam_spi1_bus: cam-spi1-bus {
+       cam_spi1_bus: cam-spi1-bus-pins {
                samsung,pins = "gpe0-4", "gpe0-5", "gpf0-2", "gpf0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       cam_i2c1_bus: cam-i2c1-bus {
+       cam_i2c1_bus: cam-i2c1-bus-pins {
                samsung,pins = "gpf0-2", "gpf0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       cam_i2c0_bus: cam-i2c0-bus {
+       cam_i2c0_bus: cam-i2c0-bus-pins {
                samsung,pins = "gpf0-0", "gpf0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       cam_spi0_bus: cam-spi0-bus {
+       cam_spi0_bus: cam-spi0-bus-pins {
                samsung,pins = "gpf1-0", "gpf1-1", "gpf1-2", "gpf1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       cam_bayrgb_bus: cam-bayrgb-bus {
+       cam_bayrgb_bus: cam-bayrgb-bus-pins {
                samsung,pins = "gpg0-0", "gpg0-1", "gpg0-2", "gpg0-3",
                               "gpg0-4", "gpg0-5", "gpg0-6", "gpg0-7",
                               "gpg1-0", "gpg1-1", "gpg1-2", "gpg1-3",
 };
 
 &pinctrl_3 {
-       gpa0: gpa0 {
+       gpa0: gpa0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpa1: gpa1 {
+       gpa1: gpa1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpa2: gpa2 {
+       gpa2: gpa2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpb0: gpb0 {
+       gpb0: gpb0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpb1: gpb1 {
+       gpb1: gpb1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpb2: gpb2 {
+       gpb2: gpb2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpb3: gpb3 {
+       gpb3: gpb3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpb4: gpb4 {
+       gpb4: gpb4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gph0: gph0 {
+       gph0: gph0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       uart0_data: uart0-data {
+       uart0_data: uart0-data-pins {
                samsung,pins = "gpa0-0", "gpa0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       uart0_fctl: uart0-fctl {
+       uart0_fctl: uart0-fctl-pins {
                samsung,pins = "gpa0-2", "gpa0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       uart1_data: uart1-data {
+       uart1_data: uart1-data-pins {
                samsung,pins = "gpa0-4", "gpa0-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       uart1_fctl: uart1-fctl {
+       uart1_fctl: uart1-fctl-pins {
                samsung,pins = "gpa0-6", "gpa0-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       i2c2_bus: i2c2-bus {
+       i2c2_bus: i2c2-bus-pins {
                samsung,pins = "gpa0-6", "gpa0-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       uart2_data: uart2-data {
+       uart2_data: uart2-data-pins {
                samsung,pins = "gpa1-0", "gpa1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       uart2_fctl: uart2-fctl {
+       uart2_fctl: uart2-fctl-pins {
                samsung,pins = "gpa1-2", "gpa1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       i2c3_bus: i2c3-bus {
+       i2c3_bus: i2c3-bus-pins {
                samsung,pins = "gpa1-2", "gpa1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       uart3_data: uart3-data {
+       uart3_data: uart3-data-pins {
                samsung,pins = "gpa1-4", "gpa1-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       spi0_bus: spi0-bus {
+       spi0_bus: spi0-bus-pins {
                samsung,pins = "gpa2-0", "gpa2-1", "gpa2-2", "gpa2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       spi1_bus: spi1-bus {
+       spi1_bus: spi1-bus-pins {
                samsung,pins = "gpa2-4", "gpa2-6", "gpa2-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       i2c4_hs_bus: i2c4-hs-bus {
+       i2c4_hs_bus: i2c4-hs-bus-pins {
                samsung,pins = "gpa2-0", "gpa2-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       i2c5_hs_bus: i2c5-hs-bus {
+       i2c5_hs_bus: i2c5-hs-bus-pins {
                samsung,pins = "gpa2-2", "gpa2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       i2s1_bus: i2s1-bus {
+       i2s1_bus: i2s1-bus-pins {
                samsung,pins = "gpb0-0", "gpb0-1", "gpb0-2", "gpb0-3",
                               "gpb0-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       pcm1_bus: pcm1-bus {
+       pcm1_bus: pcm1-bus-pins {
                samsung,pins = "gpb0-0", "gpb0-1", "gpb0-2", "gpb0-3",
                               "gpb0-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       i2s2_bus: i2s2-bus {
+       i2s2_bus: i2s2-bus-pins {
                samsung,pins = "gpb1-0", "gpb1-1", "gpb1-2", "gpb1-3",
                               "gpb1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       pcm2_bus: pcm2-bus {
+       pcm2_bus: pcm2-bus-pins {
                samsung,pins = "gpb1-0", "gpb1-1", "gpb1-2", "gpb1-3",
                               "gpb1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       spdif_bus: spdif-bus {
+       spdif_bus: spdif-bus-pins {
                samsung,pins = "gpb1-0", "gpb1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       spi2_bus: spi2-bus {
+       spi2_bus: spi2-bus-pins {
                samsung,pins = "gpb1-1", "gpb1-3", "gpb1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_5>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       i2c6_hs_bus: i2c6-hs-bus {
+       i2c6_hs_bus: i2c6-hs-bus-pins {
                samsung,pins = "gpb1-3", "gpb1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       pwm0_out: pwm0-out {
+       pwm0_out: pwm0-out-pins {
                samsung,pins = "gpb2-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       pwm1_out: pwm1-out {
+       pwm1_out: pwm1-out-pins {
                samsung,pins = "gpb2-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       pwm2_out: pwm2-out {
+       pwm2_out: pwm2-out-pins {
                samsung,pins = "gpb2-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       pwm3_out: pwm3-out {
+       pwm3_out: pwm3-out-pins {
                samsung,pins = "gpb2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       i2c7_hs_bus: i2c7-hs-bus {
+       i2c7_hs_bus: i2c7-hs-bus-pins {
                samsung,pins = "gpb2-2", "gpb2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       i2c0_bus: i2c0-bus {
+       i2c0_bus: i2c0-bus-pins {
                samsung,pins = "gpb3-0", "gpb3-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       i2c1_bus: i2c1-bus {
+       i2c1_bus: i2c1-bus-pins {
                samsung,pins = "gpb3-2", "gpb3-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       i2c8_hs_bus: i2c8-hs-bus {
+       i2c8_hs_bus: i2c8-hs-bus-pins {
                samsung,pins = "gpb3-4", "gpb3-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       i2c9_hs_bus: i2c9-hs-bus {
+       i2c9_hs_bus: i2c9-hs-bus-pins {
                samsung,pins = "gpb3-6", "gpb3-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       i2c10_hs_bus: i2c10-hs-bus {
+       i2c10_hs_bus: i2c10-hs-bus-pins {
                samsung,pins = "gpb4-0", "gpb4-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
 };
 
 &pinctrl_4 {
-       gpz: gpz {
+       gpz: gpz-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       i2s0_bus: i2s0-bus {
+       i2s0_bus: i2s0-bus-pins {
                samsung,pins = "gpz-0", "gpz-1", "gpz-2", "gpz-3",
                                "gpz-4", "gpz-5", "gpz-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
index a4f0e3f..4d7b6d9 100644 (file)
        hpd-gpios = <&gpx3 7 GPIO_ACTIVE_HIGH>;
        pinctrl-names = "default";
        pinctrl-0 = <&hdmi_hpd_irq>;
+       vdd-supply = <&ldo6_reg>;
+       vdd_osc-supply = <&ldo7_reg>;
+       vdd_pll-supply = <&ldo6_reg>;
 };
 
 &hsi2c_4 {
 };
 
 &pinctrl_0 {
-       hdmi_hpd_irq: hdmi-hpd-irq {
+       hdmi_hpd_irq: hdmi-hpd-irq-pins {
                samsung,pins = "gpx3-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
 };
 
 &pinctrl_2 {
-       usb300_vbus_en: usb300-vbus-en {
+       usb300_vbus_en: usb300-vbus-en-pins {
                samsung,pins = "gpg0-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       usb301_vbus_en: usb301-vbus-en {
+       usb301_vbus_en: usb301-vbus-en-pins {
                samsung,pins = "gpg1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        clock-names = "rtc", "rtc_src";
 };
 
+&usbdrd3_0 {
+       vdd10-supply = <&ldo11_reg>;
+       vdd33-supply = <&ldo9_reg>;
+};
+
+&usbdrd3_1 {
+       vdd10-supply = <&ldo11_reg>;
+       vdd33-supply = <&ldo9_reg>;
+};
+
 &usbdrd_phy0 {
        vbus-supply = <&usb300_vbus_reg>;
 };
index e23e8ff..21b6087 100644 (file)
                        clocks = <&clock CLK_PCLK_PPMU_DREX0_0>;
                        clock-names = "ppmu";
                        events {
-                               ppmu_event3_dmc0_0: ppmu-event3-dmc0_0 {
-                                       event-name = "ppmu-event3-dmc0_0";
+                               ppmu_event3_dmc0_0: ppmu-event3-dmc0-0 {
+                                       event-name = "ppmu-event3-dmc0-0";
                                };
                        };
                };
                        clocks = <&clock CLK_PCLK_PPMU_DREX0_1>;
                        clock-names = "ppmu";
                        events {
-                               ppmu_event3_dmc0_1: ppmu-event3-dmc0_1 {
-                                       event-name = "ppmu-event3-dmc0_1";
+                               ppmu_event3_dmc0_1: ppmu-event3-dmc0-1 {
+                                       event-name = "ppmu-event3-dmc0-1";
                                };
                        };
                };
                        clocks = <&clock CLK_PCLK_PPMU_DREX1_0>;
                        clock-names = "ppmu";
                        events {
-                               ppmu_event3_dmc1_0: ppmu-event3-dmc1_0 {
-                                       event-name = "ppmu-event3-dmc1_0";
+                               ppmu_event3_dmc1_0: ppmu-event3-dmc1-0 {
+                                       event-name = "ppmu-event3-dmc1-0";
                                };
                        };
                };
                        clocks = <&clock CLK_PCLK_PPMU_DREX1_1>;
                        clock-names = "ppmu";
                        events {
-                               ppmu_event3_dmc1_1: ppmu-event3-dmc1_1 {
-                                       event-name = "ppmu-event3-dmc1_1";
+                               ppmu_event3_dmc1_1: ppmu-event3-dmc1-1 {
+                                       event-name = "ppmu-event3-dmc1-1";
                                };
                        };
                };
                        power-domains = <&mau_pd>;
                };
 
-               adma: adma@3880000 {
+               adma: dma-controller@3880000 {
                        compatible = "arm,pl330", "arm,primecell";
                        reg = <0x03880000 0x1000>;
                        interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>;
                        power-domains = <&mau_pd>;
                };
 
-               pdma0: pdma@121a0000 {
+               pdma0: dma-controller@121a0000 {
                        compatible = "arm,pl330", "arm,primecell";
                        reg = <0x121A0000 0x1000>;
                        interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
                        #dma-requests = <32>;
                };
 
-               pdma1: pdma@121b0000 {
+               pdma1: dma-controller@121b0000 {
                        compatible = "arm,pl330", "arm,primecell";
                        reg = <0x121B0000 0x1000>;
                        interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
                        #dma-requests = <32>;
                };
 
-               mdma0: mdma@10800000 {
+               mdma0: dma-controller@10800000 {
                        compatible = "arm,pl330", "arm,primecell";
                        reg = <0x10800000 0x1000>;
                        interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
                        #dma-requests = <1>;
                };
 
-               mdma1: mdma@11c10000 {
+               mdma1: dma-controller@11c10000 {
                        compatible = "arm,pl330", "arm,primecell";
                        reg = <0x11C10000 0x1000>;
                        interrupts = <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>;
index e7958db..2f65dcf 100644 (file)
                tCKESR-min-tck          = <2>;
                tMRD-min-tck            = <5>;
 
-               timings_samsung_K3QF2F20DB_800mhz: lpddr3-timings@800000000 {
+               timings_samsung_K3QF2F20DB_800mhz: timings@800000000 {
                        compatible      = "jedec,lpddr3-timings";
                        /* workaround: 'reg' shows max-freq */
                        reg             = <800000000>;
 };
 
 &pinctrl_0 {
-       s2mps11_irq: s2mps11-irq {
+       s2mps11_irq: s2mps11-irq-pins {
                samsung,pins = "gpx0-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
index e35af40..a6961ff 100644 (file)
 };
 
 &pinctrl_0 {
-       power_key: power-key {
+       power_key: power-key-pins {
                samsung,pins = "gpx0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       hdmi_hpd_irq: hdmi-hpd-irq {
+       hdmi_hpd_irq: hdmi-hpd-irq-pins {
                samsung,pins = "gpx3-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
 };
 
 &pinctrl_1 {
-       emmc_nrst_pin: emmc-nrst {
+       emmc_nrst_pin: emmc-nrst-pins {
                samsung,pins = "gpd1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
index 77013ee..4ee7628 100644 (file)
                interrupts = <1 IRQ_TYPE_NONE>;
                pinctrl-names = "default";
                pinctrl-0 = <&max77802_irq>, <&pmic_selb>,
-                           <&pmic_dvs_1>, <&pmic_dvs_2>, <&pmic_dvs_3>;
+                           <&pmic_dvs_1>, <&pmic_dvs_2>;
                wakeup-source;
                reg = <0x9>;
                #clock-cells = <1>;
        pinctrl-names = "default";
        pinctrl-0 = <&mask_tpm_reset>;
 
-       wifi_en: wifi-en {
+       wifi_en: wifi-en-pins {
                samsung,pins = "gpx0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       max98091_irq: max98091-irq {
+       max98091_irq: max98091-irq-pins {
                samsung,pins = "gpx0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
        /* We need GPX0_6 to be low at sleep time; just keep it low always */
-       mask_tpm_reset: mask-tpm-reset {
+       mask_tpm_reset: mask-tpm-reset-pins {
                samsung,pins = "gpx0-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-val = <0>;
        };
 
-       tpm_irq: tpm-irq {
+       tpm_irq: tpm-irq-pins {
                samsung,pins = "gpx1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       trackpad_irq: trackpad-irq {
+       trackpad_irq: trackpad-irq-pins {
                samsung,pins = "gpx1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       power_key_irq: power-key-irq {
+       power_key_irq: power-key-irq-pins {
                samsung,pins = "gpx1-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       ec_irq: ec-irq {
+       ec_irq: ec-irq-pins {
                samsung,pins = "gpx1-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       tps65090_irq: tps65090-irq {
+       tps65090_irq: tps65090-irq-pins {
                samsung,pins = "gpx2-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       dp_hpd_gpio: dp_hpd_gpio {
+       dp_hpd_gpio: dp-hpd-gpio-pins {
                samsung,pins = "gpx2-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       max77802_irq: max77802-irq {
+       max77802_irq: max77802-irq-pins {
                samsung,pins = "gpx3-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       lid_irq: lid-irq {
+       lid_irq: lid-irq-pins {
                samsung,pins = "gpx3-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       hdmi_hpd_irq: hdmi-hpd-irq {
+       hdmi_hpd_irq: hdmi-hpd-irq-pins {
                samsung,pins = "gpx3-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       pmic_dvs_1: pmic-dvs-1 {
+       pmic_dvs_1: pmic-dvs-1-pins {
                samsung,pins = "gpy7-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 };
 
-&pinctrl_1 {
-       /* Adjust WiFi drive strengths lower for EMI */
-       sd1_clk: sd1-clk {
-               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
-       };
+/* pinctrl_1 */
+/* Adjust WiFi drive strengths lower for EMI */
+&sd1_bus1 {
+       samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+};
 
-       sd1_cmd: sd1-cmd {
-               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
-       };
+&sd1_bus4 {
+       samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+};
 
-       sd1_bus1: sd1-bus-width1 {
-               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
-       };
+&sd1_bus8 {
+       samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+};
 
-       sd1_bus4: sd1-bus-width4 {
-               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
-       };
+&sd1_clk {
+       samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+};
 
-       sd1_bus8: sd1-bus-width8 {
-               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
-       };
+&sd1_cmd {
+       samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
 };
 
 &pinctrl_2 {
-       pmic_dvs_2: pmic-dvs-2 {
-               samsung,pins = "gpj4-2";
+       pmic_dvs_2: pmic-dvs-2-pins {
+               samsung,pins = "gpj4-2", "gpj4-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
+};
 
-       pmic_dvs_3: pmic-dvs-3 {
-               samsung,pins = "gpj4-3";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
-               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
-               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
-       };
+/* pinctrl_3*/
+/* Drive SPI lines at x2 for better integrity */
+&spi2_bus {
+       samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
 };
 
 &pinctrl_3 {
-       /* Drive SPI lines at x2 for better integrity */
-       spi2-bus {
-               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
-       };
-
        /* Drive SPI chip select at x2 for better integrity */
-       ec_spi_cs: ec-spi-cs {
+       ec_spi_cs: ec-spi-cs-pins {
                samsung,pins = "gpb1-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
        };
 
-       usb300_vbus_en: usb300-vbus-en {
+       usb300_vbus_en: usb300-vbus-en-pins {
                samsung,pins = "gph0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       usb301_vbus_en: usb301-vbus-en {
+       usb301_vbus_en: usb301-vbus-en-pins {
                samsung,pins = "gph0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
-       pmic_selb: pmic-selb {
+       pmic_selb: pmic-selb-pins {
                samsung,pins = "gph0-2", "gph0-3", "gph0-4", "gph0-5",
                               "gph0-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
        vtmu-supply = <&ldo10_reg>;
 };
 
+&usbdrd3_0 {
+       vdd10-supply = <&ldo15_reg>;
+       vdd33-supply = <&ldo12_reg>;
+};
+
+&usbdrd3_1 {
+       vdd10-supply = <&ldo15_reg>;
+       vdd33-supply = <&ldo12_reg>;
+};
+
 &usbdrd_dwc3_0 {
        dr_mode = "host";
 };
index 9e5651c..6d7b044 100644 (file)
        };
 
        ds1339: rtc@68 {
-               compatible = "mxim,ds1339";
+               compatible = "dallas,ds1339";
                reg = <0x68>;
                trickle-resistor-ohms = <250>;
                trickle-diode-disable;
index 84d0176..130b414 100644 (file)
                                interrupt-names = "bch";
                                clocks = <&clks 50>;
                                clock-names = "gpmi_io";
+                               assigned-clocks = <&clks 13>;
+                               assigned-clock-parents = <&clks 10>;
                                dmas = <&dma_apbh 4>;
                                dma-names = "rx-tx";
                                status = "disabled";
index 6ecb83e..85654d6 100644 (file)
        pinctrl-0 = <&pinctrl_i2c2>;
        status = "okay";
 
-       rtc: m41t00@68 {
+       rtc: rtc@68 {
                compatible = "st,m41t00";
                reg = <0x68>;
        };
index 4f88e96..d5c68d1 100644 (file)
                };
        };
 
+       lvds-decoder {
+               compatible = "ti,ds90cf364a", "lvds-decoder";
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+
+                               lvds_decoder_in: endpoint {
+                                       remote-endpoint = <&lvds0_out>;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+
+                               lvds_decoder_out: endpoint {
+                                       remote-endpoint = <&panel_in>;
+                               };
+                       };
+               };
+       };
+
        panel {
                compatible = "edt,etm0700g0dh6";
                pinctrl-0 = <&pinctrl_display_gpio>;
@@ -61,7 +86,7 @@
 
                port {
                        panel_in: endpoint {
-                               remote-endpoint = <&lvds0_out>;
+                               remote-endpoint = <&lvds_decoder_out>;
                        };
                };
        };
                        reg = <2>;
 
                        lvds0_out: endpoint {
-                               remote-endpoint = <&panel_in>;
+                               remote-endpoint = <&lvds_decoder_in>;
                        };
                };
        };
index 81c2726..8712e98 100644 (file)
        clock-frequency = <400000>;
        status = "okay";
 
-       rtc1: ds1339@68 {
+       rtc1: rtc@68 {
                compatible = "dallas,ds1339";
                reg = <0x68>;
                pinctrl-names = "default";
index 60fe5f1..c4ce23d 100644 (file)
                };
        };
 
+       iio-hwmon {
+               compatible = "iio-hwmon";
+               io-channels = <&vdiv_vaccu>;
+       };
+
        leds {
                compatible = "gpio-leds";
                pinctrl-names = "default";
                regulator-min-microvolt = <12000000>;
                regulator-max-microvolt = <12000000>;
        };
+
+       thermal-zones {
+               chassis-thermal {
+                       polling-delay = <20000>;
+                       polling-delay-passive = <0>;
+                       thermal-sensors = <&tsens0>;
+               };
+
+               touch-thermal0 {
+                       polling-delay = <20000>;
+                       polling-delay-passive = <0>;
+                       thermal-sensors = <&touch_temp0>;
+               };
+
+               touch-thermal1 {
+                       polling-delay = <20000>;
+                       polling-delay-passive = <0>;
+                       thermal-sensors = <&touch_temp1>;
+               };
+       };
+
+       touchscreen {
+               compatible = "resistive-adc-touch";
+               io-channels = <&adc_ts 1>, <&adc_ts 3>, <&adc_ts 4>,
+                              <&adc_ts 5>;
+               io-channel-names = "y", "z1", "z2", "x";
+               touchscreen-min-pressure = <64687>;
+               touchscreen-inverted-x;
+               touchscreen-inverted-y;
+               touchscreen-x-plate-ohms = <300>;
+               touchscreen-y-plate-ohms = <800>;
+       };
+
+       touch_temp0: touch-temperature-sensor0 {
+               compatible = "generic-adc-thermal";
+               #thermal-sensor-cells = <0>;
+               io-channels = <&adc_ts 0>;
+               io-channel-names = "sensor-channel";
+               temperature-lookup-table = <    (-40000) 736
+                                               85000 474>;
+       };
+
+       touch_temp1: touch-temperature-sensor1 {
+               compatible = "generic-adc-thermal";
+               #thermal-sensor-cells = <0>;
+               io-channels = <&adc_ts 7>;
+               io-channel-names = "sensor-channel";
+               temperature-lookup-table = <    (-40000) 826
+                                               85000 609>;
+       };
+
+       vdiv_vaccu: voltage-divider-vaccu {
+               compatible = "voltage-divider";
+               io-channels = <&adc_ts 2>;
+               output-ohms = <2500>;
+               full-ohms = <64000>;
+               #io-channel-cells = <0>;
+       };
 };
 
 &can1 {
        pinctrl-0 = <&pinctrl_ecspi2>;
        status = "okay";
 
-       touchscreen@0 {
-               compatible = "ti,tsc2046";
+       adc_ts: adc@0 {
+               compatible = "ti,tsc2046e-adc";
                reg = <0>;
                pinctrl-0 = <&pinctrl_tsc2046>;
                pinctrl-names ="default";
-               spi-max-frequency = <100000>;
-               interrupts-extended = <&gpio3 20 IRQ_TYPE_EDGE_FALLING>;
-               pendown-gpio = <&gpio3 20 GPIO_ACTIVE_LOW>;
+               spi-max-frequency = <1000000>;
+               interrupts-extended = <&gpio3 20 IRQ_TYPE_LEVEL_LOW>;
+               #io-channel-cells = <1>;
 
-               touchscreen-inverted-x;
-               touchscreen-inverted-y;
-               touchscreen-max-pressure = <4095>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               channel@0 {
+                       reg = <0>;
+                       settling-time-us = <300>;
+                       oversampling-ratio = <5>;
+               };
 
-               ti,vref-delay-usecs = /bits/ 16 <100>;
-               ti,x-plate-ohms = /bits/ 16 <800>;
-               ti,y-plate-ohms = /bits/ 16 <300>;
-               ti,debounce-max = /bits/ 16 <3>;
-               ti,debounce-tol = /bits/ 16 <70>;
-               ti,debounce-rep = /bits/ 16 <3>;
-               wakeup-source;
+               channel@1 {
+                       reg = <1>;
+                       settling-time-us = <700>;
+                       oversampling-ratio = <5>;
+               };
+
+               channel@2 {
+                       reg = <2>;
+                       settling-time-us = <300>;
+                       oversampling-ratio = <5>;
+               };
+
+               channel@3 {
+                       reg = <3>;
+                       settling-time-us = <700>;
+                       oversampling-ratio = <5>;
+               };
+
+               channel@4 {
+                       reg = <4>;
+                       settling-time-us = <700>;
+                       oversampling-ratio = <5>;
+               };
+
+               channel@5 {
+                       reg = <5>;
+                       settling-time-us = <700>;
+                       oversampling-ratio = <5>;
+               };
+
+               /* channel 6 is not connected */
+
+               channel@7 {
+                       reg = <7>;
+                       settling-time-us = <300>;
+                       oversampling-ratio = <5>;
+               };
        };
 };
 
        pinctrl-0 = <&pinctrl_i2c3>;
        status = "okay";
 
-       temperature-sensor@70 {
+       tsens0: temperature-sensor@70 {
                compatible = "ti,tmp103";
                reg = <0x70>;
+               #thermal-sensor-cells = <0>;
        };
 };
 
index 190d266..b86deeb 100644 (file)
@@ -6,6 +6,7 @@
 /dts-v1/;
 #include "imx6dl.dtsi"
 #include "imx6qdl-prti6q.dtsi"
+#include <dt-bindings/display/sdtv-standards.h>
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/leds/common.h>
 #include <dt-bindings/sound/fsl-imx-audmux.h>
                power-supply = <&reg_bl_12v0>;
        };
 
+       display {
+               compatible = "fsl,imx-parallel-display";
+               pinctrl-0 = <&pinctrl_ipu1_disp>;
+               pinctrl-names = "default";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               port@0 {
+                       reg = <0>;
+
+                       display_in: endpoint {
+                               remote-endpoint = <&ipu1_di0_disp0>;
+                       };
+               };
+
+               port@1 {
+                       reg = <1>;
+
+                       display_out: endpoint {
+                               remote-endpoint = <&panel_in>;
+                       };
+               };
+       };
+
+       iio-hwmon {
+               compatible = "iio-hwmon";
+               io-channels = <&vdiv_vaccu>;
+       };
+
        keys {
                compatible = "gpio-keys";
                autorepeat;
                };
        };
 
+       panel {
+               compatible = "innolux,g070y2-t02";
+               backlight = <&backlight_lcd>;
+               power-supply = <&reg_3v3>;
+
+               port {
+                       panel_in: endpoint {
+                               remote-endpoint = <&display_out>;
+                       };
+               };
+       };
+
+       connector {
+               compatible = "composite-video-connector";
+               label = "Composite0";
+               sdtv-standards = <SDTV_STD_PAL_B>;
+
+               port {
+                       comp0_out: endpoint {
+                               remote-endpoint = <&tvp5150_comp0_in>;
+                       };
+               };
+       };
+
        reg_bl_12v0: regulator-bl-12v0 {
                compatible = "regulator-fixed";
                pinctrl-names = "default";
                enable-active-high;
        };
 
+       reg_3v3: regulator-3v3 {
+               compatible = "regulator-fixed";
+               regulator-name = "3v3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+       };
+
        reg_1v8: regulator-1v8 {
                compatible = "regulator-fixed";
                regulator-name = "1v8";
                        frame-master;
                };
        };
+
+       thermal-zones {
+               chassis-thermal {
+                       polling-delay = <20000>;
+                       polling-delay-passive = <0>;
+                       thermal-sensors = <&tsens0>;
+               };
+
+               touch-thermal0 {
+                       polling-delay = <20000>;
+                       polling-delay-passive = <0>;
+                       thermal-sensors = <&touch_temp0>;
+               };
+
+               touch-thermal1 {
+                       polling-delay = <20000>;
+                       polling-delay-passive = <0>;
+                       thermal-sensors = <&touch_temp1>;
+               };
+       };
+
+       touchscreen {
+               compatible = "resistive-adc-touch";
+               io-channels = <&adc_ts 1>, <&adc_ts 3>, <&adc_ts 4>,
+                              <&adc_ts 5>;
+               io-channel-names = "y", "z1", "z2", "x";
+               touchscreen-min-pressure = <64687>;
+               touchscreen-inverted-x;
+               touchscreen-inverted-y;
+               touchscreen-x-plate-ohms = <300>;
+               touchscreen-y-plate-ohms = <800>;
+       };
+
+       touch_temp0: touch-temperature-sensor0 {
+               compatible = "generic-adc-thermal";
+               #thermal-sensor-cells = <0>;
+               io-channels = <&adc_ts 0>;
+               io-channel-names = "sensor-channel";
+               temperature-lookup-table = <    (-40000) 736
+                                               85000 474>;
+       };
+
+       touch_temp1: touch-temperature-sensor1 {
+               compatible = "generic-adc-thermal";
+               #thermal-sensor-cells = <0>;
+               io-channels = <&adc_ts 7>;
+               io-channel-names = "sensor-channel";
+               temperature-lookup-table = <    (-40000) 826
+                                               85000 609>;
+       };
+
+       vdiv_vaccu: voltage-divider-vaccu {
+               compatible = "voltage-divider";
+               io-channels = <&adc_ts 2>;
+               output-ohms = <2500>;
+               full-ohms = <64000>;
+               #io-channel-cells = <0>;
+       };
 };
 
 &audmux {
        pinctrl-0 = <&pinctrl_ecspi2>;
        status = "okay";
 
-       touchscreen@0 {
-               compatible = "ti,tsc2046";
+       adc_ts: adc@0 {
+               compatible = "ti,tsc2046e-adc";
                reg = <0>;
                pinctrl-0 = <&pinctrl_tsc>;
                pinctrl-names ="default";
-               spi-max-frequency = <100000>;
-               interrupts-extended = <&gpio3 20 IRQ_TYPE_EDGE_FALLING>;
-               pendown-gpio = <&gpio3 20 GPIO_ACTIVE_LOW>;
-               touchscreen-max-pressure = <4095>;
-               ti,vref-delay-usecs = /bits/ 16 <100>;
-               ti,x-plate-ohms = /bits/ 16 <800>;
-               ti,y-plate-ohms = /bits/ 16 <300>;
-               ti,debounce-max = /bits/ 16 <3>;
-               ti,debounce-tol = /bits/ 16 <70>;
-               ti,debounce-rep = /bits/ 16 <3>;
-               wakeup-source;
+               spi-max-frequency = <1000000>;
+               interrupts-extended = <&gpio3 20 IRQ_TYPE_LEVEL_LOW>;
+               #io-channel-cells = <1>;
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               channel@1 {
+                       reg = <1>;
+                       settling-time-us = <700>;
+                       oversampling-ratio = <5>;
+               };
+
+               channel@3 {
+                       reg = <3>;
+                       settling-time-us = <700>;
+                       oversampling-ratio = <5>;
+               };
+
+               channel@4 {
+                       reg = <4>;
+                       settling-time-us = <700>;
+                       oversampling-ratio = <5>;
+               };
+
+               channel@5 {
+                       reg = <5>;
+                       settling-time-us = <700>;
+                       oversampling-ratio = <5>;
+               };
        };
 };
 
                VDDIO-supply = <&reg_3v3>;
                VDDD-supply = <&reg_1v8>;
        };
+
+       video@5c {
+               compatible = "ti,tvp5150";
+               reg = <0x5c>;
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               port@0 {
+                       reg = <0>;
+
+                       tvp5150_comp0_in: endpoint {
+                               remote-endpoint = <&comp0_out>;
+                       };
+               };
+
+               /* Output port 2 is video output pad */
+               port@2 {
+                       reg = <2>;
+
+                       tvp5151_to_ipu1_csi0_mux: endpoint {
+                               remote-endpoint = <&ipu1_csi0_mux_from_parallel_sensor>;
+                       };
+               };
+       };
 };
 
 &i2c3 {
                reg = <0x51>;
        };
 
+       tsens0: temperature-sensor@70 {
+               compatible = "ti,tmp103";
+               reg = <0x70>;
+               #thermal-sensor-cells = <0>;
+       };
+
        gpio_pca: gpio@74 {
                compatible = "nxp,pca9539";
                reg = <0x74>;
        status = "okay";
 };
 
+&ipu1_di0_disp0 {
+       remote-endpoint = <&display_in>;
+};
+
+&ipu1_csi0_mux_from_parallel_sensor {
+       remote-endpoint = <&tvp5151_to_ipu1_csi0_mux>;
+};
+
 &pwm1 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_pwm1>;
index d37ba4e..227c952 100644 (file)
                };
        };
 
+       iio-hwmon {
+               compatible = "iio-hwmon";
+               io-channels = <&vdiv_vaccu>, <&vdiv_hitch_pos>;
+       };
+
        leds {
                compatible = "gpio-leds";
                pinctrl-names = "default";
                        frame-master;
                };
        };
+
+       thermal-zones {
+               chassis-thermal {
+                       polling-delay = <20000>;
+                       polling-delay-passive = <0>;
+                       thermal-sensors = <&tsens0>;
+               };
+
+               touch-thermal0 {
+                       polling-delay = <20000>;
+                       polling-delay-passive = <0>;
+                       thermal-sensors = <&touch_temp0>;
+               };
+
+               touch-thermal1 {
+                       polling-delay = <20000>;
+                       polling-delay-passive = <0>;
+                       thermal-sensors = <&touch_temp1>;
+               };
+       };
+
+       touchscreen {
+               compatible = "resistive-adc-touch";
+               io-channels = <&adc_ts 1>, <&adc_ts 3>, <&adc_ts 4>,
+                              <&adc_ts 5>;
+               io-channel-names = "y", "z1", "z2", "x";
+               touchscreen-min-pressure = <64687>;
+               touchscreen-inverted-x;
+               touchscreen-inverted-y;
+               touchscreen-x-plate-ohms = <300>;
+               touchscreen-y-plate-ohms = <800>;
+       };
+
+       touch_temp0: touch-temperature-sensor0 {
+               compatible = "generic-adc-thermal";
+               #thermal-sensor-cells = <0>;
+               io-channels = <&adc_ts 0>;
+               io-channel-names = "sensor-channel";
+               temperature-lookup-table = <    (-40000) 736
+                                               85000 474>;
+       };
+
+       touch_temp1: touch-temperature-sensor1 {
+               compatible = "generic-adc-thermal";
+               #thermal-sensor-cells = <0>;
+               io-channels = <&adc_ts 7>;
+               io-channel-names = "sensor-channel";
+               temperature-lookup-table = <    (-40000) 826
+                                               85000 609>;
+       };
+
+       vdiv_vaccu: voltage-divider-vaccu {
+               compatible = "voltage-divider";
+               io-channels = <&adc_ts 2>;
+               output-ohms = <2500>;
+               full-ohms = <64000>;
+               #io-channel-cells = <0>;
+       };
+
+       vdiv_hitch_pos: voltage-divider-hitch-pos {
+               compatible = "voltage-divider";
+               io-channels = <&adc_ts 6>;
+               output-ohms = <3300>;
+               full-ohms = <13300>;
+               #io-channel-cells = <0>;
+       };
 };
 
 &audmux {
        pinctrl-0 = <&pinctrl_ecspi2>;
        status = "okay";
 
-       touchscreen@0 {
-               compatible = "ti,tsc2046";
+       adc_ts: adc@0 {
+               compatible = "ti,tsc2046e-adc";
                reg = <0>;
-               pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_touchscreen>;
-               spi-max-frequency = <200000>;
-               interrupts-extended = <&gpio5 8 IRQ_TYPE_EDGE_FALLING>;
-               pendown-gpio = <&gpio5 8 GPIO_ACTIVE_LOW>;
-               touchscreen-size-x = <800>;
-               touchscreen-size-y = <480>;
-               touchscreen-inverted-y;
-               touchscreen-max-pressure = <4095>;
-               ti,vref-delay-usecs = /bits/ 16 <100>;
-               ti,x-plate-ohms = /bits/ 16 <800>;
-               ti,y-plate-ohms = /bits/ 16 <300>;
-               wakeup-source;
+               pinctrl-names ="default";
+               spi-max-frequency = <1000000>;
+               interrupts-extended = <&gpio5 8 IRQ_TYPE_LEVEL_LOW>;
+               #io-channel-cells = <1>;
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               channel@1 {
+                       reg = <1>;
+                       settling-time-us = <700>;
+                       oversampling-ratio = <5>;
+               };
+
+               channel@3 {
+                       reg = <3>;
+                       settling-time-us = <700>;
+                       oversampling-ratio = <5>;
+               };
+
+               channel@4 {
+                       reg = <4>;
+                       settling-time-us = <700>;
+                       oversampling-ratio = <5>;
+               };
+
+               channel@5 {
+                       reg = <5>;
+                       settling-time-us = <700>;
+                       oversampling-ratio = <5>;
+               };
        };
 };
 
                reg = <0x51>;
        };
 
-       temperature-sensor@70 {
+       tsens0: temperature-sensor@70 {
                compatible = "ti,tmp103";
                reg = <0x70>;
+               #thermal-sensor-cells = <0>;
        };
 };
 
index 343364d..8daef65 100644 (file)
        pinctrl-0 = <&pinctrl_i2c3>;
        status = "okay";
 
-       rtc: ds1307@68 {
+       rtc: rtc@68 {
                compatible = "dallas,ds1307";
                reg = <0x68>;
        };
index dc89b55..fe72650 100644 (file)
@@ -4,7 +4,10 @@
  * Copyright (C) 2018 Marek Vasut <marex@denx.de>
  */
 
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/leds/common.h>
+#include <dt-bindings/pwm/pwm.h>
 
 / {
        chosen {
index daf7634..f4dca20 100644 (file)
@@ -17,6 +17,7 @@
                mmc1 = &usdhc2;
                /delete-property/ mmc2;
                /delete-property/ mmc3;
+               rtc0 = &rtc0;
        };
 
        chosen {
                        label = "s6";
                        linux,code = <KEY_F6>;
                        gpios = <&gpio7 13 GPIO_ACTIVE_LOW>;
+                       wakeup-source;
                };
 
                button2 {
                        label = "s7";
                        linux,code = <KEY_F7>;
                        gpios = <&gpio7 12 GPIO_ACTIVE_LOW>;
+                       wakeup-source;
                };
 
                button3 {
                        label = "s8";
                        linux,code = <KEY_F8>;
                        gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
+                       wakeup-source;
                };
        };
 
@@ -82,6 +86,8 @@
 
        reg_pcie: regulator-pcie {
                compatible = "regulator-fixed";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_regpcie>;
                regulator-name = "supply-pcie";
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
 
        pinctrl_hog: hoggrp {
                fsl,pins = <
-                       /* LCD.CONTRAST -> Rev 0100 only, not used on Rev.0200*/
                        MX6QDL_PAD_DI0_PIN4__GPIO4_IO20 0x0001b099
 
                        MX6QDL_PAD_ENET_RXD1__GPIO1_IO26 0x0001b099
                        MX6QDL_PAD_SD4_DAT3__GPIO2_IO11 0x001b0f0 /* #PCIE.WAKE */
                        MX6QDL_PAD_NANDF_CLE__GPIO6_IO07 0x001b0f0 /* #PCIE.RST */
                        MX6QDL_PAD_NANDF_CS0__GPIO6_IO11 0x001b0f0 /* #PCIE.DIS */
-                       /* HYS = 1, DSE = 110, PUE+PKE, SPEED = HIGH (11)*/
-                       MX6QDL_PAD_NANDF_D0__GPIO2_IO00 0x00130f0 /* PCIE.PWR_EN */
                >;
        };
 
                >;
        };
 
+       pinctrl_regpcie: regpciegrp {
+               fsl,pins = <
+                       /* HYS = 1, DSE = 110, PUE+PKE, SPEED = HIGH (11)*/
+                       MX6QDL_PAD_NANDF_D0__GPIO2_IO00 0x00130f0 /* PCIE.PWR_EN */
+               >;
+       };
+
        pinctrl_uart2: uart2grp {
                fsl,pins = <
                        MX6QDL_PAD_SD4_DAT4__UART2_RX_DATA 0x1b099
index a61f270..df8fa16 100644 (file)
@@ -6,12 +6,6 @@
  * Author: Markus Niebel <Markus.Niebel@tq-group.com>
  */
 
-/ {
-       aliases {
-               rtc0 = &rtc0;
-       };
-};
-
 &fec {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_enet>, <&pinctrl_enet_fix>;
index 9f9f703..7d1cd74 100644 (file)
@@ -6,12 +6,6 @@
  * Author: Markus Niebel <Markus.Niebel@tq-group.com>
  */
 
-/ {
-       aliases {
-               rtc0 = &rtc0;
-       };
-};
-
 &fec {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_enet>;
 
 &i2c1 {
        clock-frequency = <100000>;
-       pinctrl-names = "default";
+       pinctrl-names = "default", "gpio";
        pinctrl-0 = <&pinctrl_i2c1>;
+       pinctrl-1 = <&pinctrl_i2c1_recovery>;
+       scl-gpios = <&gpio5 27 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+       sda-gpios = <&gpio5 26 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
        status = "okay";
 };
 
index f323620..1f2ba6f 100644 (file)
                                regulator-always-on;
                        };
                };
+
+               da9063_rtc: rtc {
+                       compatible = "dlg,da9063-rtc";
+               };
+
+               da9063_wdog: watchdog {
+                       compatible = "dlg,da9063-watchdog";
+               };
+
+               onkey {
+                       compatible = "dlg,da9063-onkey";
+                       status = "disabled";
+               };
        };
 };
 
index 94b254b..28a8053 100644 (file)
                        dlg,use-sw-pm;
                };
 
+               thermal {
+                       compatible = "dlg,da9062-thermal";
+                       status = "disabled";
+               };
+
+               gpio {
+                       compatible = "dlg,da9062-gpio";
+                       status = "disabled";
+               };
+
                regulators {
                        vdd_arm: buck1 {
                                regulator-name = "vdd_arm";
index 51a3a53..344ea93 100644 (file)
                >;
        };
 
+       pinctrl_i2c1_recovery: i2c1recoverygrp {
+               fsl,pins = <
+                       MX6QDL_PAD_CSI0_DAT8__GPIO5_IO26 0x4001b899
+                       MX6QDL_PAD_CSI0_DAT9__GPIO5_IO27 0x4001b899
+               >;
+       };
+
        pinctrl_i2c3: i2c3grp {
                fsl,pins = <
                        MX6QDL_PAD_GPIO_5__I2C3_SCL 0x4001b899
                >;
        };
 
+       pinctrl_i2c3_recovery: i2c3recoverygrp {
+               fsl,pins = <
+                       MX6QDL_PAD_GPIO_5__GPIO1_IO05 0x4001b899
+                       MX6QDL_PAD_GPIO_6__GPIO1_IO06 0x4001b899
+               >;
+       };
+
        pinctrl_pmic: pmicgrp {
                fsl,pins = <
                        MX6QDL_PAD_NANDF_RB0__GPIO6_IO10 0x1b099 /* PMIC irq */
index bfb67da..7dc3f00 100644 (file)
@@ -4,6 +4,8 @@
  * Copyright 2013-2017 Markus Niebel <Markus.Niebel@tq-group.com>
  */
 
+#include <dt-bindings/gpio/gpio.h>
+
 &fec {
        interrupts-extended = <&gpio1 6 IRQ_TYPE_LEVEL_HIGH>,
                              <&intc 0 119 IRQ_TYPE_LEVEL_HIGH>;
 };
 
 &i2c1 {
-       pinctrl-names = "default";
+       pinctrl-names = "default", "gpio";
        pinctrl-0 = <&pinctrl_i2c1>;
+       pinctrl-1 = <&pinctrl_i2c1_recovery>;
+       scl-gpios = <&gpio5 27 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+       sda-gpios = <&gpio5 26 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
        clock-frequency = <100000>;
        status = "okay";
 
index 49c4722..dd09257 100644 (file)
@@ -4,9 +4,14 @@
  * Copyright 2013-2017 Markus Niebel <Markus.Niebel@tq-group.com>
  */
 
+#include <dt-bindings/gpio/gpio.h>
+
 &i2c3 {
-       pinctrl-names = "default";
+       pinctrl-names = "default", "gpio";
        pinctrl-0 = <&pinctrl_i2c3>;
+       pinctrl-1 = <&pinctrl_i2c3_recovery>;
+       scl-gpios = <&gpio1 5 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+       sda-gpios = <&gpio1 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
        clock-frequency = <100000>;
        status = "okay";
 
index 410972e..99ec7a8 100644 (file)
@@ -85,7 +85,7 @@
 };
 
 &i2c3 {
-       rtc: mcp7940x@6f {
+       rtc: rtc@6f {
                compatible = "microchip,mcp7940x";
                reg = <0x6f>;
        };
index b9e3057..1ac7e13 100644 (file)
                regulator-max-microvolt = <3300000>;
        };
 
-       reg_h1_vbus: regulator-h1-vbus {
-               compatible = "regulator-fixed";
-               regulator-name = "h1-vbus";
-               regulator-min-microvolt = <5000000>;
-               regulator-max-microvolt = <5000000>;
-               gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>;
-               enable-active-high;
-       };
-
        reg_otg_vbus: regulator-otg-vbus {
                compatible = "regulator-fixed";
                regulator-name = "otg-vbus";
 &can1 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_can1>;
+       termination-gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
+       termination-ohms = <150>;
        status = "okay";
 };
 
 };
 
 &usbh1 {
-       vbus-supply = <&reg_h1_vbus>;
        pinctrl-names = "default";
        phy_type = "utmi";
        dr_mode = "host";
index 480e731..f69eec1 100644 (file)
        };
 };
 
+&vgen3_reg {
+       regulator-always-on;
+};
+
 &pcie {
-       status = "disabled";
+       status = "okay";
 };
 
 &sata {
index ee64565..35861bb 100644 (file)
        status = "okay";
 };
 
+&i2c3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c3>;
+       clock-frequency = <100000>;
+       status = "okay";
+
+       hdmi-transmitter@70 {
+               compatible = "nxp,tda998x";
+               reg = <0x70>;
+               interrupts-extended = <&gpio3 27 IRQ_TYPE_LEVEL_LOW>;
+
+               ports {
+                       port {
+                               hdmi: endpoint {
+                                       remote-endpoint = <&lcdc>;
+                               };
+                       };
+               };
+       };
+};
+
 &i2c4 { /* Onboard Motion sensors */
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_i2c4>;
        status = "disabled";
 };
 
+&lcdif1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_lcd>;
+       status = "okay";
+
+       port {
+               lcdc: endpoint {
+                       remote-endpoint = <&hdmi>;
+               };
+       };
+};
+
 &iomuxc {
        pinctrl_bt_reg: btreggrp {
                fsl,pins =
                        <MX6SX_PAD_GPIO1_IO02__I2C2_SCL         0x4001b8b1>;
        };
 
+       pinctrl_i2c3: i2c3grp {
+               fsl,pins =
+                       <MX6SX_PAD_KEY_ROW4__I2C3_SDA                   0x4001b8b1>,
+                       <MX6SX_PAD_KEY_COL4__I2C3_SCL                   0x4001b8b1>;
+       };
+
        pinctrl_i2c4: i2c4grp {
                fsl,pins =
                        <MX6SX_PAD_USB_H_DATA__I2C4_SDA         0x4001b8b1>,
                        <MX6SX_PAD_USB_H_STROBE__I2C4_SCL       0x4001b8b1>;
        };
 
+       pinctrl_lcd: lcdgrp {
+               fsl,pins = <
+                       MX6SX_PAD_LCD1_DATA00__LCDIF1_DATA_0            0x4001b0b0
+                       MX6SX_PAD_LCD1_DATA01__LCDIF1_DATA_1            0x4001b0b0
+                       MX6SX_PAD_LCD1_DATA02__LCDIF1_DATA_2            0x4001b0b0
+                       MX6SX_PAD_LCD1_DATA03__LCDIF1_DATA_3            0x4001b0b0
+                       MX6SX_PAD_LCD1_DATA04__LCDIF1_DATA_4            0x4001b0b0
+                       MX6SX_PAD_LCD1_DATA05__LCDIF1_DATA_5            0x4001b0b0
+                       MX6SX_PAD_LCD1_DATA06__LCDIF1_DATA_6            0x4001b0b0
+                       MX6SX_PAD_LCD1_DATA07__LCDIF1_DATA_7            0x4001b0b0
+                       MX6SX_PAD_LCD1_DATA08__LCDIF1_DATA_8            0x4001b0b0
+                       MX6SX_PAD_LCD1_DATA09__LCDIF1_DATA_9            0x4001b0b0
+                       MX6SX_PAD_LCD1_DATA10__LCDIF1_DATA_10           0x4001b0b0
+                       MX6SX_PAD_LCD1_DATA11__LCDIF1_DATA_11           0x4001b0b0
+                       MX6SX_PAD_LCD1_DATA12__LCDIF1_DATA_12           0x4001b0b0
+                       MX6SX_PAD_LCD1_DATA13__LCDIF1_DATA_13           0x4001b0b0
+                       MX6SX_PAD_LCD1_DATA14__LCDIF1_DATA_14           0x4001b0b0
+                       MX6SX_PAD_LCD1_DATA15__LCDIF1_DATA_15           0x4001b0b0
+                       MX6SX_PAD_LCD1_DATA16__LCDIF1_DATA_16           0x4001b0b0
+                       MX6SX_PAD_LCD1_DATA17__LCDIF1_DATA_17           0x4001b0b0
+                       MX6SX_PAD_LCD1_DATA18__LCDIF1_DATA_18           0x4001b0b0
+                       MX6SX_PAD_LCD1_DATA19__LCDIF1_DATA_19           0x4001b0b0
+                       MX6SX_PAD_LCD1_DATA20__LCDIF1_DATA_20           0x4001b0b0
+                       MX6SX_PAD_LCD1_DATA21__LCDIF1_DATA_21           0x4001b0b0
+                       MX6SX_PAD_LCD1_DATA22__LCDIF1_DATA_22           0x4001b0b0
+                       MX6SX_PAD_LCD1_DATA23__LCDIF1_DATA_23           0x4001b0b0
+                       MX6SX_PAD_LCD1_CLK__LCDIF1_CLK          0x4001b0b0
+                       MX6SX_PAD_LCD1_ENABLE__LCDIF1_ENABLE            0x4001b0b0
+                       MX6SX_PAD_LCD1_VSYNC__LCDIF1_VSYNC              0x4001b0b0
+                       MX6SX_PAD_LCD1_HSYNC__LCDIF1_HSYNC              0x4001b0b0
+                       MX6SX_PAD_LCD1_RESET__GPIO3_IO_27               0x4001b0b0
+               >;
+       };
+
+
        pinctrl_uart1: uart1grp {
                fsl,pins =
                        <MX6SX_PAD_GPIO1_IO04__UART1_DCE_TX     0x1b0b1>,
index 9768609..92ac0ed 100644 (file)
        /delete-node/ codec@a;
        /delete-node/ touchscreen@48;
 
-       rtc: mcp7940x@6f {
+       rtc: rtc@6f {
                compatible = "microchip,mcp7940x";
                reg = <0x6f>;
        };
index 139188e..b770fc9 100644 (file)
        };
 
        /* M41T0M6 real time clock on carrier board */
-       rtc: m41t0m6@68 {
+       rtc: rtc@68 {
                compatible = "st,m41t0";
                reg = <0x68>;
        };
index 3caf450..3b9df8c 100644 (file)
        };
 
        /* M41T0M6 real time clock on carrier board */
-       rtc: m41t0m6@68 {
+       rtc: rtc@68 {
                compatible = "st,m41t0";
                reg = <0x68>;
        };
index 62b771c..f1c60b0 100644 (file)
@@ -40,7 +40,7 @@
 
                dailink_master: simple-audio-card,codec {
                        sound-dai = <&codec>;
-                       clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>;
+                       clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
                };
        };
 };
                compatible = "fsl,sgtl5000";
                #sound-dai-cells = <0>;
                reg = <0x0a>;
-               clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>;
+               clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_sai1_mclk>;
                VDDA-supply = <&reg_module_3v3_avdd>;
index 49086c6..3df6dff 100644 (file)
        tlv320aic32x4: audio-codec@18 {
                compatible = "ti,tlv320aic32x4";
                reg = <0x18>;
-               clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>;
+               clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
                clock-names = "mclk";
                ldoin-supply = <&reg_audio_3v3>;
                iov-supply = <&reg_audio_3v3>;
index e0751e6..a31de90 100644 (file)
        codec: wm8960@1a {
                compatible = "wlf,wm8960";
                reg = <0x1a>;
-               clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>;
+               clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
                clock-names = "mclk";
                wlf,shared-lrclk;
        };
index 7b2198a..d917dc4 100644 (file)
@@ -31,7 +31,7 @@
 
                dailink_master: simple-audio-card,codec {
                        sound-dai = <&sgtl5000>;
-                       clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>;
+                       clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
                };
        };
 };
@@ -41,7 +41,7 @@
                #sound-dai-cells = <0>;
                reg = <0x0a>;
                compatible = "fsl,sgtl5000";
-               clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>;
+               clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
                VDDA-supply = <&reg_2p5v>;
                VDDIO-supply = <&reg_vref_1v8>;
        };
index 70bea95..f263e39 100644 (file)
@@ -31,7 +31,7 @@
 
                dailink_master: simple-audio-card,codec {
                        sound-dai = <&sgtl5000>;
-                       clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>;
+                       clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
                };
        };
 };
@@ -41,7 +41,7 @@
                #sound-dai-cells = <0>;
                reg = <0x0a>;
                compatible = "fsl,sgtl5000";
-               clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>;
+               clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
                VDDA-supply = <&reg_2p5v>;
                VDDIO-supply = <&reg_vref_1v8>;
        };
index 7813ef9..f053f51 100644 (file)
        codec: wm8960@1a {
                compatible = "wlf,wm8960";
                reg = <0x1a>;
-               clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>;
+               clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
                clock-names = "mclk";
                wlf,shared-lrclk;
                wlf,hp-cfg = <2 2 3>;
                wlf,gpio-cfg = <1 3>;
                assigned-clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_SRC>,
                                  <&clks IMX7D_PLL_AUDIO_POST_DIV>,
-                                 <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>;
+                                 <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
                assigned-clock-parents = <&clks IMX7D_PLL_AUDIO_POST_DIV>;
                assigned-clock-rates = <0>, <884736000>, <12288000>;
        };
index b773597..f8cba47 100644 (file)
                              <0x31004000 0x2000>,
                              <0x31006000 0x2000>;
                };
+
+               pcie: pcie@33800000 {
+                       compatible = "fsl,imx7d-pcie";
+                       reg = <0x33800000 0x4000>,
+                             <0x4ff00000 0x80000>;
+                       reg-names = "dbi", "config";
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+                       device_type = "pci";
+                       bus-range = <0x00 0xff>;
+                       ranges = <0x81000000 0 0          0x4ff80000 0 0x00010000>, /* downstream I/O */
+                                <0x82000000 0 0x40000000 0x40000000 0 0x0ff00000>; /* non-prefetchable memory */
+                       num-lanes = <1>;
+                       interrupts = <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "msi";
+                       #interrupt-cells = <1>;
+                       interrupt-map-mask = <0 0 0 0x7>;
+                       /*
+                        * Reference manual lists pci irqs incorrectly
+                        * Real hardware ordering is same as imx6: D+MSI, C, B, A
+                        */
+                       interrupt-map = <0 0 0 1 &intc GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
+                                       <0 0 0 2 &intc GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>,
+                                       <0 0 0 3 &intc GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
+                                       <0 0 0 4 &intc GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clks IMX7D_PCIE_CTRL_ROOT_CLK>,
+                                <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>,
+                                <&clks IMX7D_PCIE_PHY_ROOT_CLK>;
+                       clock-names = "pcie", "pcie_bus", "pcie_phy";
+                       assigned-clocks = <&clks IMX7D_PCIE_CTRL_ROOT_SRC>,
+                                         <&clks IMX7D_PCIE_PHY_ROOT_SRC>;
+                       assigned-clock-parents = <&clks IMX7D_PLL_ENET_MAIN_250M_CLK>,
+                                                <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>;
+
+                       fsl,max-link-speed = <2>;
+                       power-domains = <&pgc_pcie_phy>;
+                       resets = <&src IMX7_RESET_PCIEPHY>,
+                                <&src IMX7_RESET_PCIE_CTRL_APPS_EN>,
+                                <&src IMX7_RESET_PCIE_CTRL_APPS_TURNOFF>;
+                       reset-names = "pciephy", "apps", "turnoff";
+                       fsl,imx7d-pcie-phy = <&pcie_phy>;
+                       status = "disabled";
+               };
        };
 };
 
                fsl,stop-mode = <&gpr 0x10 4>;
                status = "disabled";
        };
-
-       pcie: pcie@33800000 {
-               compatible = "fsl,imx7d-pcie";
-               reg = <0x33800000 0x4000>,
-                     <0x4ff00000 0x80000>;
-               reg-names = "dbi", "config";
-               #address-cells = <3>;
-               #size-cells = <2>;
-               device_type = "pci";
-               bus-range = <0x00 0xff>;
-               ranges = <0x81000000 0 0          0x4ff80000 0 0x00010000>, /* downstream I/O */
-                        <0x82000000 0 0x40000000 0x40000000 0 0x0ff00000>; /* non-prefetchable memory */
-               num-lanes = <1>;
-               interrupts = <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>;
-               interrupt-names = "msi";
-               #interrupt-cells = <1>;
-               interrupt-map-mask = <0 0 0 0x7>;
-               /*
-                * Reference manual lists pci irqs incorrectly
-                * Real hardware ordering is same as imx6: D+MSI, C, B, A
-                */
-               interrupt-map = <0 0 0 1 &intc GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
-                               <0 0 0 2 &intc GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>,
-                               <0 0 0 3 &intc GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
-                               <0 0 0 4 &intc GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>;
-               clocks = <&clks IMX7D_PCIE_CTRL_ROOT_CLK>,
-                        <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>,
-                        <&clks IMX7D_PCIE_PHY_ROOT_CLK>;
-               clock-names = "pcie", "pcie_bus", "pcie_phy";
-               assigned-clocks = <&clks IMX7D_PCIE_CTRL_ROOT_SRC>,
-                                 <&clks IMX7D_PCIE_PHY_ROOT_SRC>;
-               assigned-clock-parents = <&clks IMX7D_PLL_ENET_MAIN_250M_CLK>,
-                                        <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>;
-
-               fsl,max-link-speed = <2>;
-               power-domains = <&pgc_pcie_phy>;
-               resets = <&src IMX7_RESET_PCIEPHY>,
-                        <&src IMX7_RESET_PCIE_CTRL_APPS_EN>,
-                        <&src IMX7_RESET_PCIE_CTRL_APPS_TURNOFF>;
-               reset-names = "pciephy", "apps", "turnoff";
-               fsl,imx7d-pcie-phy = <&pcie_phy>;
-               status = "disabled";
-       };
 };
 
 &ca_funnel_in_ports {
index 4f1edef..e8734d2 100644 (file)
@@ -75,7 +75,7 @@
 
                dailink_master: simple-audio-card,codec {
                        sound-dai = <&codec>;
-                       clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>;
+                       clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
                };
        };
 };
                #sound-dai-cells = <0>;
                reg = <0x0a>;
                compatible = "fsl,sgtl5000";
-               clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>;
+               clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_sai1_mclk>;
                VDDA-supply = <&vgen4_reg>;
diff --git a/arch/arm/boot/dts/imxrt1050-pinfunc.h b/arch/arm/boot/dts/imxrt1050-pinfunc.h
new file mode 100644 (file)
index 0000000..22c14a3
--- /dev/null
@@ -0,0 +1,993 @@
+/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
+/*
+ * Copyright (C) 2019
+ * Author(s): Giulio Benetti <giulio.benetti@benettiengineering.com>
+ */
+
+#ifndef _DT_BINDINGS_PINCTRL_IMXRT1050_PINFUNC_H
+#define _DT_BINDINGS_PINCTRL_IMXRT1050_PINFUNC_H
+
+#define IMX_PAD_SION   0x40000000
+
+/*
+ * The pin function ID is a tuple of
+ * <mux_reg conf_reg input_reg mux_mode input_val>
+ */
+
+#define MXRT1050_IOMUXC_GPIO_EMC_00_SEMC_DA00                          0x014 0x204 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_00_FLEXPWM4_PWM0_A                    0x014 0x204 0x494 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_00_LPSPI2_SCK                         0x014 0x204 0x500 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_EMC_00_XBAR_INOUT2                                0x014 0x204 0x60C 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_00_FLEXIO1_D00                                0x014 0x204 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_00_GPIO4_IO00                         0x014 0x204 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_01_SEMC_DA01                          0x018 0x208 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_01_FLEXPWM4_PWM0_B                    0x018 0x208 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_01_LPSPI2_PCS0                                0x018 0x208 0x4FC 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_EMC_01_XBAR_INOUT3                                0x018 0x208 0x610 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_01_FLEXIO1_D01                                0x018 0x208 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_01_GPIO4_IO01                         0x018 0x208 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_02_SEMC_DA02                          0x01C 0x20C 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_02_FLEXPWM4_PWM1_A                    0x01C 0x20C 0x498 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_02_LPSPI2_SDO                         0x01C 0x20C 0x508 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_EMC_02_XBAR_INOUT4                                0x01C 0x20C 0x614 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_02_FLEXIO1_D02                                0x01C 0x20C 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_02_GPIO4_IO02                         0x01C 0x20C 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_03_SEMC_DA03                          0x020 0x210 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_03_FLEXPWM4_PWM1_B                    0x020 0x210 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_03_LPSPI2_SDI                         0x020 0x210 0x504 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_EMC_03_XBAR_INOUT5                                0x020 0x210 0x618 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_03_FLEXIO1_D03                                0x020 0x210 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_03_GPIO4_IO03                         0x020 0x210 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_04_SEMC_DA04                          0x024 0x214 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_04_FLEXPWM4_PWM2_A                    0x024 0x214 0x49C 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_04_SAI2_TX_DATA                       0x024 0x214 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_04_XBAR_INOUT6                                0x024 0x214 0x61C 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_04_FLEXIO1_D04                                0x024 0x214 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_04_GPIO4_IO04                         0x024 0x214 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_05_SEMC_DA05                          0x028 0x218 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_05_FLEXPWM4_PWM2_B                    0x028 0x218 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_05_SAI2_TX_SYNC                       0x028 0x218 0x5C4 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_05_XBAR_INOUT7                                0x028 0x218 0x620 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_05_FLEXIO1_D05                                0x028 0x218 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_05_GPIO4_IO05                         0x028 0x218 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_06_SEMC_DA06                          0x02C 0x21C 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_06_FLEXPWM2_PWM0_A                    0x02C 0x21C 0x478 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_06_SAI2_TX_BCLK                       0x02C 0x21C 0x5C0 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_06_XBAR_INOUT8                                0x02C 0x21C 0x624 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_06_FLEXIO1_D06                                0x02C 0x21C 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_06_GPIO4_IO06                         0x02C 0x21C 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_07_SEMC_DA07                          0x030 0x220 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_07_FLEXPWM2_PWM0_B                    0x030 0x220 0x488 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_07_SAI2_MCLK                          0x030 0x220 0x5B0 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_07_XBAR_INOUT9                                0x030 0x220 0x628 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_07_FLEXIO1_D07                                0x030 0x220 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_07_GPIO4_IO07                         0x030 0x220 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_08_SEMC_DM00                          0x034 0x224 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_08_FLEXPWM2_PWM1_A                    0x034 0x224 0x47C 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_08_SAI2_RX_DATA                       0x034 0x224 0x5B8 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_08_XBAR_INOUT17                       0x034 0x224 0x62C 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_08_FLEXIO1_D08                                0x034 0x224 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_08_GPIO4_IO08                         0x034 0x224 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_09_SEMC_ADDR00                                0x038 0x228 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_09_FLEXPWM2_PWM1_B                    0x038 0x228 0x48C 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_09_SAI2_RX_SYNC                       0x038 0x228 0x5BC 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_09_FLEXCAN2_TX                                0x038 0x228 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_09_FLEXIO1_D09                                0x038 0x228 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_09_GPIO4_IO09                         0x038 0x228 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_10_SEMC_ADDR01                                0x03C 0x22C 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_10_FLEXPWM2_PWM2_A                    0x03C 0x22C 0x480 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_10_SAI2_RX_BCLK                       0x03C 0x22C 0x5B4 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_10_FLEXCAN2_RX                                0x03C 0x22C 0x450 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_10_FLEXIO1_D10                                0x03C 0x22C 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_10_GPIO4_IO10                         0x03C 0x22C 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_11_SEMC_ADDR02                                0x040 0x230 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_11_FLEXPWM2_PWM2_B                    0x040 0x230 0x490 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_11_LPI2C4_SDA                         0x040 0x230 0x4E8 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_11_USDHC2_RESET_B                     0x040 0x230 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_11_FLEXIO1_D11                                0x040 0x230 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_11_GPIO4_IO11                         0x040 0x230 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_12_SEMC_ADDR03                                0x044 0x234 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_12_XBAR_INOUT24                       0x044 0x234 0x640 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_12_LPI2C4_SCL                         0x044 0x234 0x4E4 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_12_USDHC2_WP                          0x044 0x234 0x5D8 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_12_FLEXPWM1_PWM3_A                    0x044 0x234 0x454 0x4 0x1
+#define MXRT1050_IOMUXC_GPIO_EMC_12_GPIO4_IO12                         0x044 0x234 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_13_SEMC_ADDR04                                0x048 0x238 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_13_XBAR_INOUT25                       0x048 0x238 0x650 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_EMC_13_LPUART3_TXD                                0x048 0x238 0x53C 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_13_MQS_RIGHT                          0x048 0x238 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_13_FLEXPWM1_PWM3_B                    0x048 0x238 0x464 0x4 0x1
+#define MXRT1050_IOMUXC_GPIO_EMC_13_GPIO4_IO13                         0x048 0x238 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_14_SEMC_ADDR05                                0x04C 0x23C 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_14_XBAR_INOUT19                       0x04C 0x23C 0x654 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_14_LPUART3_RXD                                0x04C 0x23C 0x538 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_14_MQS_LEFT                           0x04C 0x23C 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_14_LPSPI2_PCS1                                0x04C 0x23C 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_14_GPIO4_IO14                         0x04C 0x23C 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_15_SEMC_ADDR06                                0x050 0x240 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_15_XBAR_INOUT20                       0x050 0x240 0x634 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_15_LPUART3_CTS_B                      0x050 0x240 0x534 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_15_SPDIF_OUT                          0x050 0x240 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_15_TMR3_TIMER0                                0x050 0x240 0x57C 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_15_GPIO4_IO15                         0x050 0x240 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_16_SEMC_ADDR07                                0x054 0x244 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_16_XBAR_INOUT21                       0x054 0x244 0x658 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_16_LPUART3_RTS_B                      0x054 0x244 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_16_SPDIF_IN                           0x054 0x244 0x5C8 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_EMC_16_TMR3_TIMER1                                0x054 0x244 0x580 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_16_GPIO4_IO16                         0x054 0x244 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_17_SEMC_ADDR08                                0x058 0x248 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_17_FLEXPWM4_PWM3_A                    0x058 0x248 0x4A0 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_17_LPUART4_CTS_B                      0x058 0x248 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_17_FLEXCAN1_TX                                0x058 0x248 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_17_TMR3_TIMER2                                0x058 0x248 0x584 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_17_GPIO4_IO17                         0x058 0x248 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_18_SEMC_ADDR09                                0x05C 0x24C 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_18_FLEXPWM4_PWM3_B                    0x05C 0x24C 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_18_LPUART4_RTS_B                      0x05C 0x24C 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_18_FLEXCAN1_RX                                0x05C 0x24C 0x44C 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_EMC_18_TMR3_TIMER3                                0x05C 0x24C 0x588 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_18_GPIO4_IO18                         0x05C 0x24C 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_18_SNVS_VIO_5_CTL                     0x05C 0x24C 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_19_SEMC_ADDR11                                0x060 0x250 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_19_FLEXPWM2_PWM3_A                    0x060 0x250 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_19_LPUART4_TXD                                0x060 0x250 0x544 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_EMC_19_ENET_RX_DATA01                     0x060 0x250 0x438 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_19_TMR2_TIMER0                                0x060 0x250 0x56C 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_19_GPIO4_IO19                         0x060 0x250 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_19_SNVS_VIO_5                         0x060 0x250 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_20_SEMC_ADDR12                                0x064 0x254 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_20_FLEXPWM2_PWM3_B                    0x064 0x254 0x484 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_EMC_20_LPUART4_RXD                                0x064 0x254 0x540 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_EMC_20_ENET_RX_DATA00                     0x064 0x254 0x434 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_20_TMR2_TIMER0                                0x064 0x254 0x570 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_20_GPIO4_IO20                         0x064 0x254 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_21_SEMC_BA0                           0x068 0x258 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_21_FLEXPWM3_PWM3_A                    0x068 0x258 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_21_LPI2C3_SDA                         0x068 0x258 0x4E0 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_21_ENET_TX_DATA01                     0x068 0x258 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_21_TMR2_TIMER2                                0x068 0x258 0x574 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_21_GPIO4_IO21                         0x068 0x258 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_22_SEMC_BA1                           0x06C 0x25C 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_22_FLEXPWM3_PWM3_B                    0x06C 0x25C 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_22_LPI2C3_SCL                         0x06C 0x25C 0x4DC 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_22_ENET_TX_DATA00                     0x06C 0x25C 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_22_TMR2_TIMER3                                0x06C 0x25C 0x578 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_22_GPIO4_IO22                         0x06C 0x25C 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_23_SEMC_ADDR10                                0x070 0x260 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_23_FLEXPWM1_PWM0_A                    0x070 0x260 0x458 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_23_LPUART5_TXD                                0x070 0x260 0x54C 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_23_ENET_RX_EN                         0x070 0x260 0x43C 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_23_GPT1_CAPTURE2                      0x070 0x260 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_23_GPIO4_IO23                         0x070 0x260 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_24_SEMC_CAS                           0x074 0x264 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_24_FLEXPWM1_PWM0_B                    0x074 0x264 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_24_LPUART5_RXD                                0x074 0x264 0x548 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_24_ENET_TX_EN                         0x074 0x264 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_24_GPT1_CAPTURE1                      0x074 0x264 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_24_GPIO4_IO24                         0x074 0x264 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_25_SEMC_RAS                           0x078 0x268 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_25_FLEXPWM1_PWM1_A                    0x078 0x268 0x45C 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_25_LPUART6_TXD                                0x078 0x268 0x554 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_25_ENET_TX_CLK                                0x078 0x268 0x448 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_25_ENET_REF_CLK                       0x078 0x268 0x42C 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_25_GPIO4_IO25                         0x078 0x268 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_26_SEMC_CLK                           0x07C 0x26C 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_26_FLEXPWM1_PWM1_B                    0x07C 0x26C 0x46C 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_26_LPUART6_RXD                                0x07C 0x26C 0x550 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_26_ENET_RX_ER                         0x07C 0x26C 0x440 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_26_FLEXIO1_D12                                0x07C 0x26C 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_26_GPIO4_IO26                         0x07C 0x26C 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_27_SEMC_CKE                           0x080 0x270 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_27_FLEXPWM1_PWM2_A                    0x080 0x270 0x460 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_27_LPUART5_RTS_B                      0x080 0x270 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_27_LPSPI1_SCK                         0x080 0x270 0x4F0 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_27_FLEXIO1_D13                                0x080 0x270 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_27_GPIO4_IO27                         0x080 0x270 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_28_SEMC_WE                            0x084 0x274 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_28_FLEXPWM1_PWM2_B                    0x084 0x274 0x470 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_28_LPUART5_CTS_B                      0x084 0x274 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_28_LPSPI1_SDO                         0x084 0x274 0x4F8 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_28_FLEXIO1_D14                                0x084 0x274 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_28_GPIO4_IO28                         0x084 0x274 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_29_SEMC_CS0                           0x088 0x278 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_29_FLEXPWM3_PWM0_A                    0x088 0x278 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_29_LPUART6_RTS_B                      0x088 0x278 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_29_LPSPI1_SDI                         0x088 0x278 0x4F4 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_29_FLEXIO1_D15                                0x088 0x278 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_29_GPIO4_IO29                         0x088 0x278 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_30_SEMC_DA08                          0x08C 0x27C 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_30_FLEXPWM3_PWM0_B                    0x08C 0x27C 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_30_LPUART6_CTS_B                      0x08C 0x27C 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_30_LPSPI1_PCS0                                0x08C 0x27C 0x4EC 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_EMC_30_CSI_DATA23                         0x08C 0x27C 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_30_GPIO4_IO30                         0x08C 0x27C 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_31_SEMC_DA09                          0x090 0x280 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_31_FLEXPWM3_PWM1_A                    0x090 0x280 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_31_LPUART7_TXD                                0x090 0x280 0x55C 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_EMC_31_LPSPI1_PCS1                                0x090 0x280 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_31_CSI_DATA22                         0x090 0x280 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_31_GPIO4_IO31                         0x090 0x280 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_32_SEMC_DA10                          0x094 0x284 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_32_FLEXPWM3_PWM1_B                    0x094 0x284 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_32_LPUART7_RXD                                0x094 0x284 0x558 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_EMC_32_CCM_PMIC_READY                     0x094 0x284 0x3FC 0x3 0x4
+#define MXRT1050_IOMUXC_GPIO_EMC_32_CSI_DATA21                         0x094 0x284 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_32_GPIO3_IO18                         0x094 0x284 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_33_SEMC_DA11                          0x098 0x288 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_33_FLEXPWM3_PWM2_A                    0x098 0x288 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_33_USDHC1_RESET_B                     0x098 0x288 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_33_SAI3_RX_DATA                       0x098 0x288 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_33_CSI_DATA20                         0x098 0x288 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_33_GPIO3_IO19                         0x098 0x288 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_34_SEMC_DA12                          0x09C 0x28C 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_34_FLEXPWM3_PWM2_B                    0x09C 0x28C 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_34_USDHC1_VSELECT                     0x09C 0x28C 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_34_SAI3_RX_SYNC                       0x09C 0x28C 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_34_CSI_DATA19                         0x09C 0x28C 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_34_GPIO3_IO20                         0x09C 0x28C 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_35_SEMC_DA13                          0x0A0 0x290 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_35_XBAR_INOUT18                       0x0A0 0x290 0x630 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_35_GPT1_COMPARE1                      0x0A0 0x290 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_35_SAI3_RX_BCLK                       0x0A0 0x290 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_35_CSI_DATA18                         0x0A0 0x290 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_35_GPIO3_IO21                         0x0A0 0x290 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_35_USDHC1_CD_B                                0x0A0 0x290 0x5D4 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_36_SEMC_DA14                          0x0A4 0x294 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_36_XBAR_INOUT22                       0x0A4 0x294 0x638 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_36_GPT1_COMPARE2                      0x0A4 0x294 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_36_SAI3_TX_DATA                       0x0A4 0x294 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_36_CSI_DATA17                         0x0A4 0x294 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_36_GPIO3_IO22                         0x0A4 0x294 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_36_USDHC1_WP                          0x0A4 0x294 0x5D8 0x6 0x1
+
+#define MXRT1050_IOMUXC_GPIO_EMC_37_SEMC_DA15                          0x0A8 0x298 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_37_XBAR_INOUT23                       0x0A8 0x298 0x63C 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_37_GPT1_COMPARE3                      0x0A8 0x298 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_37_SAI3_MCLK                          0x0A8 0x298 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_37_CSI_DATA16                         0x0A8 0x298 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_37_GPIO3_IO23                         0x0A8 0x298 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_37_USDHC2_WP                          0x0A8 0x298 0x608 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_38_SEMC_DM01                          0x0AC 0x29C 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_38_FLEXPWM1_PWM3_A                    0x0AC 0x29C 0x454 0x1 0x2
+#define MXRT1050_IOMUXC_GPIO_EMC_38_LPUART8_TXD                                0x0AC 0x29C 0x564 0x2 0x2
+#define MXRT1050_IOMUXC_GPIO_EMC_38_SAI3_TX_BCLK                       0x0AC 0x29C 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_38_CSI_FIELD                          0x0AC 0x29C 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_38_GPIO3_IO24                         0x0AC 0x29C 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_38_USDHC2_VSELECT                     0x0AC 0x29C 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_39_SEMC_DQS                           0x0B0 0x2A0 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_39_FLEXPWM1_PWM3_B                    0x0B0 0x2A0 0x464 0x1 0x2
+#define MXRT1050_IOMUXC_GPIO_EMC_39_LPUART8_RXD                                0x0B0 0x2A0 0x560 0x2 0x2
+#define MXRT1050_IOMUXC_GPIO_EMC_39_SAI3_TX_SYNC                       0x0B0 0x2A0 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_39_WDOG1_B                            0x0B0 0x2A0 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_39_GPIO3_IO25                         0x0B0 0x2A0 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_39_USDHC2_CD_B                                0x0B0 0x2A0 0x5E0 0x6 0x1
+
+#define MXRT1050_IOMUXC_GPIO_EMC_40_SEMC_RDY                           0x0B4 0x2A4 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_40_GPT2_CAPTURE2                      0x0B4 0x2A4 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_40_LPSPI1_PCS2                                0x0B4 0x2A4 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_40_USB_OTG2_OC                                0x0B4 0x2A4 0x5CC 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_EMC_40_ENET_MDC                           0x0B4 0x2A4 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_40_GPIO3_IO26                         0x0B4 0x2A4 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_40_USDHC2_RESET_B                     0x0B4 0x2A4 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_EMC_41_SEMC_CSX0                          0x0B8 0x2A8 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_41_GPT2_CAPTURE1                      0x0B8 0x2A8 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_41_LPSPI1_PCS3                                0x0B8 0x2A8 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_41_USB_OTG2_PWR                       0x0B8 0x2A8 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_41_ENET_MDIO                          0x0B8 0x2A8 0x430 0x4 0x1
+#define MXRT1050_IOMUXC_GPIO_EMC_41_GPIO3_IO27                         0x0B8 0x2A8 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_EMC_41_USDHC2_VSELECT                     0x0B8 0x2A8 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B0_00_FLEXPWM2_PWM3_A                  0x0BC 0x2AC 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_00_XBAR_INOUT14                     0x0BC 0x2AC 0x644 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_00_REF_CLK_32K                      0x0BC 0x2AC 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_00_USB_OTG2_ID                      0x0BC 0x2AC 0x3F8 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_00_LPI2C1_SCLS                      0x0BC 0x2AC 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_00_GPIO1_IO00                       0x0BC 0x2AC 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_00_USDHC1_RESET_B                   0x0BC 0x2AC 0x000 0x6 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_00_LPSPI3_SCK                       0x0BC 0x2AC 0x510 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B0_01_FLEXPWM2_PWM3_B                  0x0C0 0x2B0 0x484 0x0 0x2
+#define MXRT1050_IOMUXC_GPIO_AD_B0_01_XBAR_INOUT15                     0x0C0 0x2B0 0x648 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_01_REF_CLK_24M                      0x0C0 0x2B0 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_01_USB_OTG1_ID                      0x0C0 0x2B0 0x3F4 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_01_LPI2C1_SDAS                      0x0C0 0x2B0 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_01_GPIO1_IO01                       0x0C0 0x2B0 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_01_EWM_OUT_B                                0x0C0 0x2B0 0x000 0x6 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_01_LPSPI3_SDO                       0x0C0 0x2B0 0x518 0x7 0x1
+
+#define MXRT1050_IOMUXC_GPIO_AD_B0_02_FLEXCAN2_TX                      0x0C4 0x2B4 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_02_XBAR_INOUT16                     0x0C4 0x2B4 0x64C 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_02_LPUART6_TXD                      0x0C4 0x2B4 0x554 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_02_USB_OTG1_PWR                     0x0C4 0x2B4 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_02_FLEXPWM1_PWM0_X                  0x0C4 0x2B4 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_02_GPIO1_IO02                       0x0C4 0x2B4 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_02_LPI2C1_HREQ                      0x0C4 0x2B4 0x000 0x6 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_02_LPSPI3_SDI                       0x0C4 0x2B4 0x514 0x7 0x1
+
+#define MXRT1050_IOMUXC_GPIO_AD_B0_03_FLEXCAN2_RX                      0x0C8 0x2B8 0x450 0x0 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_03_XBAR_INOUT17                     0x0C8 0x2B8 0x62C 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_03_LPUART6_RXD                      0x0C8 0x2B8 0x550 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_03_USB_OTG1_OC                      0x0C8 0x2B8 0x5D0 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_03_FLEXPWM1_PWM1_X                  0x0C8 0x2B8 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_03_GPIO1_IO03                       0x0C8 0x2B8 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_03_REF_CLK_24M                      0x0C8 0x2B8 0x000 0x6 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_03_LPSPI3_PCS0                      0x0C8 0x2B8 0x50C 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B0_04_SRC_BOOT_MODE00                  0x0CC 0x2BC 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_04_MQS_RIGHT                                0x0CC 0x2BC 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_04_ENET_TX_DATA03                   0x0CC 0x2BC 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_04_SAI2_TX_SYNC                     0x0CC 0x2BC 0x5C4 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_04_CSI_DATA09                       0x0CC 0x2BC 0x41C 0x4 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_04_GPIO1_IO04                       0x0CC 0x2BC 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_04_PIT_TRIGGER00                    0x0CC 0x2BC 0x000 0x6 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_04_LPSPI3_PCS1                      0x0CC 0x2BC 0x000 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B0_05_SRC_BOOT_MODE01                  0x0D0 0x2C0 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_05_MQS_LEFT                         0x0D0 0x2C0 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_05_ENET_TX_DATA02                   0x0D0 0x2C0 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_05_SAI2_TX_BCLK                     0x0D0 0x2C0 0x5C0 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_05_CSI_DATA08                       0x0D0 0x2C0 0x418 0x4 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_05_GPIO1_IO05                       0x0D0 0x2C0 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_05_XBAR_INOUT17                     0x0D0 0x2C0 0x62C 0x6 0x2
+#define MXRT1050_IOMUXC_GPIO_AD_B0_05_LPSPI3_PCS2                      0x0D0 0x2C0 0x000 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B0_06_JTAG_TMS                         0x0D4 0x2C4 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_06_GPT2_COMPARE1                    0x0D4 0x2C4 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_06_ENET_RX_CLK                      0x0D4 0x2C4 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_06_SAI2_RX_BCLK                     0x0D4 0x2C4 0x5B4 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_06_CSI_DATA07                       0x0D4 0x2C4 0x414 0x4 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_06_GPIO1_IO06                       0x0D4 0x2C4 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_06_XBAR_INOUT18                     0x0D4 0x2C4 0x630 0x6 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_06_LPSPI3_PCS3                      0x0D4 0x2C4 0x000 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B0_07_JTAG_TCK                         0x0D8 0x2C8 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_07_GPT2_COMPARE2                    0x0D8 0x2C8 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_07_ENET_TX_ER                       0x0D8 0x2C8 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_07_SAI2_RX_SYNC                     0x0D8 0x2C8 0x5BC 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_07_CSI_DATA06                       0x0D8 0x2C8 0x410 0x4 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_07_GPIO1_IO07                       0x0D8 0x2C8 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_07_XBAR_INOUT19                     0x0D8 0x2C8 0x654 0x6 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_07_ENET_1588_EVENT3_OUT             0x0D8 0x2C8 0x000 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B0_08_JTAG_MOD                         0x0DC 0x2CC 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_08_GPT2_COMPARE3                    0x0DC 0x2CC 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_08_ENET_RX_DATA03                   0x0DC 0x2CC 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_08_SAI2_RX_DATA                     0x0DC 0x2CC 0x5B8 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_08_CSI_DATA05                       0x0DC 0x2CC 0x40C 0x4 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_08_GPIO1_IO08                       0x0DC 0x2CC 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_08_XBAR_INOUT20                     0x0DC 0x2CC 0x634 0x6 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_08_ENET_1588_EVENT3_IN              0x0DC 0x2CC 0x000 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B0_09_JTAG_TDI                         0x0E0 0x2D0 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_09_FLEXPWM2_PWM3_A                  0x0E0 0x2D0 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_09_ENET_RX_DATA02                   0x0E0 0x2D0 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_09_SAI2_TX_DATA                     0x0E0 0x2D0 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_09_CSI_DATA04                       0x0E0 0x2D0 0x408 0x4 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_09_GPIO1_IO09                       0x0E0 0x2D0 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_09_XBAR_INOUT21                     0x0E0 0x2D0 0x658 0x6 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_09_GPT2_CLK                         0x0E0 0x2D0 0x000 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B0_10_JTAG_TDO                         0x0E4 0x2D4 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_10_FLEXPWM1_PWM3_A                  0x0E4 0x2D4 0x454 0x1 0x3
+#define MXRT1050_IOMUXC_GPIO_AD_B0_10_ENET_CRS                         0x0E4 0x2D4 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_10_SAI2_MCLK                                0x0E4 0x2D4 0x5B0 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_10_CSI_DATA03                       0x0E4 0x2D4 0x404 0x4 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_10_GPIO1_IO10                       0x0E4 0x2D4 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_10_XBAR_INOUT22                     0x0E4 0x2D4 0x638 0x6 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_10_ENET_1588_EVENT0_OUT             0x0E4 0x2D4 0x000 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B0_11_JTAG_TRSTB                       0x0E8 0x2D8 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_11_FLEXPWM1_PWM3_B                  0x0E8 0x2D8 0x464 0x1 0x3
+#define MXRT1050_IOMUXC_GPIO_AD_B0_11_ENET_COL                         0x0E8 0x2D8 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_11_WDOG1_B                          0x0E8 0x2D8 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_11_CSI_DATA02                       0x0E8 0x2D8 0x400 0x4 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_11_GPIO1_IO11                       0x0E8 0x2D8 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_11_XBAR_INOUT23                     0x0E8 0x2D8 0x63C 0x6 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_11_ENET_1588_EVENT0_IN              0x0E8 0x2D8 0x444 0x7 0x1
+
+#define MXRT1050_IOMUXC_GPIO_AD_B0_12_LPI2C4_SCL                       0x0EC 0x2DC 0x4E4 0x0 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_12_CCM_PMIC_READY                   0x0EC 0x2DC 0x3FC 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_12_LPUART1_TXD                      0x0EC 0x2DC 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_12_WDOG2_B                          0x0EC 0x2DC 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_12_FLEXPWM1_PWM2_X                  0x0EC 0x2DC 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_12_GPIO1_IO12                       0x0EC 0x2DC 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_12_ENET_1588_EVENT1_OUT             0x0EC 0x2DC 0x000 0x6 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_12_NMI                              0x0EC 0x2DC 0x568 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B0_13_LPI2C4_SDA                       0x0F0 0x2E0 0x4E8 0x0 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_13_GPT1_CLK                         0x0F0 0x2E0 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_13_LPUART1_RXD                      0x0F0 0x2E0 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_13_EWM_OUT_B                                0x0F0 0x2E0 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_13_FLEXPWM1_PWM3_X                  0x0F0 0x2E0 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_13_GPIO1_IO13                       0x0F0 0x2E0 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_13_ENET_1588_EVENT1_IN              0x0F0 0x2E0 0x000 0x6 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_13_REF_CLK_24M                      0x0F0 0x2E0 0x000 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B0_14_USB_OTG2_OC                      0x0F4 0x2E4 0x5CC 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_14_XBAR_INOUT24                     0x0F4 0x2E4 0x640 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B0_14_LPUART1_CTS_B                    0x0F4 0x2E4 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_14_ENET_1588_EVENT0_OUT             0x0F4 0x2E4 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_14_CSI_VSYNC                                0x0F4 0x2E4 0x428 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_14_GPIO1_IO14                       0x0F4 0x2E4 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_14_FLEXCAN2_TX                      0x0F4 0x2E4 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B0_15_USB_OTG2_PWR                     0x0F8 0x2E8 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_15_XBAR_INOUT25                     0x0F8 0x2E8 0x650 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_15_LPUART1_RTS_B                    0x0F8 0x2E8 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_15_ENET_1588_EVENT0_IN              0x0F8 0x2E8 0x444 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_15_CSI_HSYNC                                0x0F8 0x2E8 0x420 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_15_GPIO1_IO15                       0x0F8 0x2E8 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B0_15_FLEXCAN2_RX                      0x0F8 0x2E8 0x450 0x6 0x2
+#define MXRT1050_IOMUXC_GPIO_AD_B0_15_WDOG1_WDOG_RST_B_DEB             0x0F8 0x2E8 0x000 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B1_00_USB_OTG2_ID                      0x0FC 0x2EC 0x3F8 0x0 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_00_TMR3_TIMER0                      0x0FC 0x2EC 0x57C 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_00_LPUART2_CTS_B                    0x0FC 0x2EC 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_00_LPI2C1_SCL                       0x0FC 0x2EC 0x4CC 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_00_WDOG1_B                          0x0FC 0x2EC 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_00_GPIO1_IO16                       0x0FC 0x2EC 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_00_USDHC1_WP                                0x0FC 0x2EC 0x5D8 0x6 0x2
+#define MXRT1050_IOMUXC_GPIO_AD_B1_00_KPP_ROW07                                0x0FC 0x2EC 0x000 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B1_01_USB_OTG1_PWR                     0x100 0x2F0 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_01_TMR3_TIMER1                      0x100 0x2F0 0x580 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_01_LPUART2_RTS_B                    0x100 0x2F0 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_01_LPI2C1_SDA                       0x100 0x2F0 0x4D0 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_01_CCM_PMIC_READY                   0x100 0x2F0 0x3FC 0x4 0x2
+#define MXRT1050_IOMUXC_GPIO_AD_B1_01_GPIO1_IO17                       0x100 0x2F0 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_01_USDHC1_VSELECT                   0x100 0x2F0 0x000 0x6 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_01_KPP_COL07                                0x100 0x2F0 0x000 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B1_02_USB_OTG1_ID                      0x104 0x2F4 0x3F4 0x0 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_02_TMR3_TIMER2                      0x104 0x2F4 0x584 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_02_LPUART2_TXD                      0x104 0x2F4 0x530 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_02_SPDIF_OUT                                0x104 0x2F4 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_02_ENET_1588_EVENT2_OUT             0x104 0x2F4 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_02_GPIO1_IO18                       0x104 0x2F4 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_02_USDHC1_CD_B                      0x104 0x2F4 0x5D4 0x6 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_02_KPP_ROW06                                0x104 0x2F4 0x000 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B1_03_USB_OTG1_OC                      0x108 0x2F8 0x5D0 0x0 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_03_TMR3_TIMER3                      0x108 0x2F8 0x588 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_03_LPUART2_RXD                      0x108 0x2F8 0x52C 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_03_SPDIF_IN                         0x108 0x2F8 0x5C8 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_03_ENET_1588_EVENT2_IN              0x108 0x2F8 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_03_GPIO1_IO19                       0x108 0x2F8 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_03_USDHC2_CD_B                      0x108 0x2F8 0x5E0 0x6 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_03_KPP_COL06                                0x108 0x2F8 0x000 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B1_04_FLEXSPI_B_DATA3                  0x10C 0x2FC 0x4C4 0x0 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_04_ENET_MDC                         0x10C 0x2FC 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_04_LPUART3_CTS_B                    0x10C 0x2FC 0x534 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_04_SPDIF_SR_CLK                     0x10C 0x2FC 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_04_CSI_PIXCLK                       0x10C 0x2FC 0x424 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_04_GPIO1_IO20                       0x10C 0x2FC 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_04_USDHC2_DATA0                     0x10C 0x2FC 0x5E8 0x6 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_04_KPP_ROW05                                0x10C 0x2FC 0x000 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B1_05_FLEXSPI_B_DATA2                  0x110 0x300 0x4C0 0x0 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_05_ENET_MDIO                                0x110 0x300 0x430 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_05_LPUART3_RTS_B                    0x110 0x300 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_05_SPDIF_OUT                                0x110 0x300 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_05_CSI_MCLK                         0x110 0x300 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_05_GPIO1_IO21                       0x110 0x300 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_05_USDHC2_DATA1                     0x110 0x300 0x5EC 0x6 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_05_KPP_COL05                                0x110 0x300 0x000 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B1_06_FLEXSPI_B_DATA1                  0x114 0x304 0x4BC 0x0 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_06_LPI2C3_SDA                       0x114 0x304 0x4E0 0x1 0x2
+#define MXRT1050_IOMUXC_GPIO_AD_B1_06_LPUART3_TXD                      0x114 0x304 0x53C 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_06_SPDIF_LOCK                       0x114 0x304 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_06_CSI_VSYNC                                0x114 0x304 0x428 0x4 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_06_GPIO1_IO22                       0x114 0x304 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_06_USDHC2_DATA2                     0x114 0x304 0x5F0 0x6 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_06_KPP_ROW04                                0x114 0x304 0x000 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B1_07_FLEXSPI_B_DATA0                  0x118 0x308 0x4B8 0x0 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_07_LPI2C3_SCL                       0x118 0x308 0x4DC 0x1 0x2
+#define MXRT1050_IOMUXC_GPIO_AD_B1_07_LPUART3_RXD                      0x118 0x308 0x538 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_07_SPDIF_EXT_CLK                    0x118 0x308 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_07_CSI_HSYNC                                0x118 0x308 0x420 0x4 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_07_GPIO1_IO23                       0x118 0x308 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_07_USDHC2_DATA3                     0x118 0x308 0x5F4 0x6 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_07_KPP_COL04                                0x118 0x308 0x000 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B1_08_FLEXSPI_A_SS1_B                  0x11C 0x30C 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_08_FLEXPWM4_PWM0_A                  0x11C 0x30C 0x494 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_08_FLEXCAN1_TX                      0x11C 0x30C 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_08_CCM_PMIC_READY                   0x11C 0x30C 0x3FC 0x3 0x3
+#define MXRT1050_IOMUXC_GPIO_AD_B1_08_CSI_DATA09                       0x11C 0x30C 0x41C 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_08_GPIO1_IO24                       0x11C 0x30C 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_08_USDHC2_CMD                       0x11C 0x30C 0x5E4 0x6 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_08_KPP_ROW03                                0x11C 0x30C 0x000 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B1_09_FLEXSPI_A_DQS                    0x120 0x310 0x4A4 0x0 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_09_FLEXPWM4_PWM1_A                  0x120 0x310 0x498 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_09_FLEXCAN1_RX                      0x120 0x310 0x44C 0x2 0x2
+#define MXRT1050_IOMUXC_GPIO_AD_B1_09_SAI1_MCLK                                0x120 0x310 0x58C 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_09_CSI_DATA08                       0x120 0x310 0x418 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_09_GPIO1_IO25                       0x120 0x310 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_09_USDHC2_CLK                       0x120 0x310 0x5DC 0x6 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_09_KPP_COL03                                0x120 0x310 0x000 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B1_10_FLEXSPI_A_DATA3                  0x124 0x314 0x4B4 0x0 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_10_WDOG1_B                          0x124 0x314 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_10_LPUART8_TXD                      0x124 0x314 0x564 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_10_SAI1_RX_SYNC                     0x124 0x314 0x5A4 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_10_CSI_DATA07                       0x124 0x314 0x414 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_10_GPIO1_IO26                       0x124 0x314 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_10_USDHC2_WP                                0x124 0x314 0x608 0x6 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_10_KPP_ROW02                                0x124 0x314 0x000 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B1_11_FLEXSPI_A_DATA2                  0x128 0x318 0x4B0 0x0 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_11_EWM_OUT_B                                0x128 0x318 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_11_LPUART8_RXD                      0x128 0x318 0x560 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_11_SAI1_RX_BCLK                     0x128 0x318 0x590 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_11_CSI_DATA06                       0x128 0x318 0x410 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_11_GPIO1_IO27                       0x128 0x318 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_11_USDHC2_RESET_B                   0x128 0x318 0x000 0x6 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_11_KPP_COL02                                0x128 0x318 0x000 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B1_12_FLEXSPI_A_DATA1                  0x12C 0x31C 0x4AC 0x0 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_12_ACMP1_OUT                                0x12C 0x31C 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_12_LPSPI3_PCS0                      0x12C 0x31C 0x50C 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_12_SAI1_RX_DATA00                   0x12C 0x31C 0x594 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_12_CSI_DATA05                       0x12C 0x31C 0x40C 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_12_GPIO1_IO28                       0x12C 0x31C 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_12_USDHC2_DATA4                     0x12C 0x31C 0x5F8 0x6 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_12_KPP_ROW01                                0x12C 0x31C 0x000 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B1_13_FLEXSPI_A_DATA0                  0x130 0x320 0x4A8 0x0 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_13_ACMP2_OUT                                0x130 0x320 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_13_LPSPI3_SDI                       0x130 0x320 0x514 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_13_SAI1_TX_DATA00                   0x130 0x320 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_13_CSI_DATA04                       0x130 0x320 0x408 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_13_GPIO1_IO29                       0x130 0x320 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_13_USDHC2_DATA5                     0x130 0x320 0x5FC 0x6 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_13_KPP_COL01                                0x130 0x320 0x000 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B1_14_FLEXSPI_A_SCLK                   0x134 0x324 0x4C8 0x0 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_14_ACMP3_OUT                                0x134 0x324 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_14_LPSPI3_SDO                       0x134 0x324 0x518 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_14_SAI1_TX_BCLK                     0x134 0x324 0x5A8 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_14_CSI_DATA03                       0x134 0x324 0x404 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_14_GPIO1_IO30                       0x134 0x324 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_14_USDHC2_DATA6                     0x134 0x324 0x600 0x6 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_14_KPP_ROW00                                0x134 0x324 0x000 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_AD_B1_15_FLEXSPI_A_SS0_B                  0x138 0x328 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_15_ACMP4_OUT                                0x138 0x328 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_15_LPSPI3_SCK                       0x138 0x328 0x510 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_15_SAI1_TX_SYNC                     0x138 0x328 0x5AC 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_15_CSI_DATA02                       0x138 0x328 0x400 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_15_GPIO1_IO31                       0x138 0x328 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_AD_B1_15_USDHC2_DATA7                     0x138 0x328 0x604 0x6 0x1
+#define MXRT1050_IOMUXC_GPIO_AD_B1_15_KPP_COL00                                0x138 0x328 0x000 0x7 0x0
+
+#define MXRT1050_IOMUXC_GPIO_B0_00_LCD_CLK                             0x13C 0x32C 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_00_TMR1_TIMER0                         0x13C 0x32C 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_00_MQS_RIGHT                           0x13C 0x32C 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_00_LPSPI4_PCS0                         0x13C 0x32C 0x51C 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_00_FLEXIO2_D00                         0x13C 0x32C 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_00_GPIO2_IO00                          0x13C 0x32C 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_00_SEMC_CSX1                           0x13C 0x32C 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_B0_01_LCD_ENABLE                          0x140 0x330 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_01_TMR1_TIMER1                         0x140 0x330 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_01_MQS_LEFT                            0x140 0x330 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_01_LPSPI4_SDI                          0x140 0x330 0x524 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_01_FLEXIO2_D01                         0x140 0x330 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_01_GPIO2_IO01                          0x140 0x330 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_01_SEMC_CSX2                           0x140 0x330 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_B0_02_LCD_HSYNC                           0x144 0x334 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_02_TMR1_TIMER2                         0x144 0x334 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_02_FLEXCAN1_TX                         0x144 0x334 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_02_LPSPI4_SDO                          0x144 0x334 0x528 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_02_FLEXIO2_D02                         0x144 0x334 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_02_GPIO2_IO02                          0x144 0x334 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_02_SEMC_CSX3                           0x144 0x334 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_B0_03_LCD_VSYNC                           0x148 0x338 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_03_TMR2_TIMER0                         0x148 0x338 0x56C 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_B0_03_FLEXCAN1_RX                         0x148 0x338 0x44C 0x2 0x3
+#define MXRT1050_IOMUXC_GPIO_B0_03_LPSPI4_SCK                          0x148 0x338 0x520 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_03_FLEXIO2_D03                         0x148 0x338 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_03_GPIO2_IO03                          0x148 0x338 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_03_WDOG2_RESET_B_DEB                   0x148 0x338 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_B0_04_LCD_DATA00                          0x14C 0x33C 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_04_TMR2_TIMER1                         0x14C 0x33C 0x570 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_B0_04_LPI2C2_SCL                          0x14C 0x33C 0x4D4 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_B0_04_ARM_TRACE00                         0x14C 0x33C 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_04_FLEXIO2_D04                         0x14C 0x33C 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_04_GPIO2_IO04                          0x14C 0x33C 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_04_SRC_BT_CFG00                                0x14C 0x33C 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_B0_05_LCD_DATA01                          0x150 0x340 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_05_TMR2_TIMER2                         0x150 0x340 0x574 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_B0_05_LPI2C2_SDA                          0x150 0x340 0x4D8 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_B0_05_ARM_TRACE01                         0x150 0x340 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_05_FLEXIO2_D05                         0x150 0x340 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_05_GPIO2_IO05                          0x150 0x340 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_05_SRC_BT_CFG01                                0x150 0x340 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_B0_06_LCD_DATA02                          0x154 0x344 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_06_TMR3_TIMER0                         0x154 0x344 0x57C 0x1 0x2
+#define MXRT1050_IOMUXC_GPIO_B0_06_FLEXPWM2_PWM0_A                     0x154 0x344 0x478 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_B0_06_ARM_TRACE02                         0x154 0x344 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_06_FLEXIO2_D06                         0x154 0x344 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_06_GPIO2_IO06                          0x154 0x344 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_06_SRC_BT_CFG02                                0x154 0x344 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_B0_07_LCD_DATA03                          0x158 0x348 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_07_TMR3_TIMER1                         0x158 0x348 0x580 0x1 0x2
+#define MXRT1050_IOMUXC_GPIO_B0_07_FLEXPWM2_PWM0_B                     0x158 0x348 0x488 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_B0_07_ARM_TRACE03                         0x158 0x348 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_07_FLEXIO2_D07                         0x158 0x348 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_07_GPIO2_IO07                          0x158 0x348 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_07_SRC_BT_CFG03                                0x158 0x348 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_B0_08_LCD_DATA04                          0x15C 0x34C 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_08_TMR3_TIMER2                         0x15C 0x34C 0x584 0x1 0x2
+#define MXRT1050_IOMUXC_GPIO_B0_08_FLEXPWM2_PWM1_A                     0x15C 0x34C 0x47C 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_B0_08_LPUART3_TXD                         0x15C 0x34C 0x53C 0x3 0x2
+#define MXRT1050_IOMUXC_GPIO_B0_08_FLEXIO2_D08                         0x15C 0x34C 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_08_GPIO2_IO08                          0x15C 0x34C 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_08_SRC_BT_CFG04                                0x15C 0x34C 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_B0_09_LCD_DATA05                          0x160 0x350 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_09_TMR4_TIMER0                         0x160 0x350 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_09_FLEXPWM2_PWM1_B                     0x160 0x350 0x48C 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_B0_09_LPUART3_RXD                         0x160 0x350 0x538 0x3 0x2
+#define MXRT1050_IOMUXC_GPIO_B0_09_FLEXIO2_D09                         0x160 0x350 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_09_GPIO2_IO09                          0x160 0x350 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_09_SRC_BT_CFG05                                0x160 0x350 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_B0_10_LCD_DATA06                          0x164 0x354 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_10_TMR4_TIMER1                         0x164 0x354 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_10_FLEXPWM2_PWM2_A                     0x164 0x354 0x480 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_B0_10_SAI1_TX_DATA03                      0x164 0x354 0x598 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_B0_10_FLEXIO2_D10                         0x164 0x354 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_10_GPIO2_IO10                          0x164 0x354 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_10_SRC_BT_CFG06                                0x164 0x354 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_B0_11_LCD_DATA07                          0x168 0x358 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_11_TMR4_TIMER2                         0x168 0x358 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_11_FLEXPWM2_PWM2_B                     0x168 0x358 0x490 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_B0_11_SAI1_TX_DATA02                      0x168 0x358 0x59C 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_B0_11_FLEXIO2_D11                         0x168 0x358 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_11_GPIO2_IO11                          0x168 0x358 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_11_SRC_BT_CFG07                                0x168 0x358 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_B0_12_LCD_DATA08                          0x16C 0x35C 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_12_XBAR_INOUT10                                0x16C 0x35C 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_12_ARM_TRACE_CLK                       0x16C 0x35C 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_12_SAI1_TX_DATA01                      0x16C 0x35C 0x5A0 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_B0_12_FLEXIO2_D12                         0x16C 0x35C 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_12_GPIO2_IO12                          0x16C 0x35C 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_12_SRC_BT_CFG08                                0x16C 0x35C 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_B0_13_LCD_DATA09                          0x170 0x360 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_13_XBAR_INOUT11                                0x170 0x360 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_13_ARM_TRACE_SWO                       0x170 0x360 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_13_SAI1_MCLK                           0x170 0x360 0x58C 0x3 0x2
+#define MXRT1050_IOMUXC_GPIO_B0_13_FLEXIO2_D13                         0x170 0x360 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_13_GPIO2_IO13                          0x170 0x360 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_13_SRC_BT_CFG09                                0x170 0x360 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_B0_14_LCD_DATA10                          0x174 0x364 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_14_XBAR_INOUT12                                0x174 0x364 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_14_ARM_CM7_TXEV                                0x174 0x364 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_14_SAI1_RX_SYNC                                0x174 0x364 0x5A4 0x3 0x2
+#define MXRT1050_IOMUXC_GPIO_B0_14_FLEXIO2_D14                         0x174 0x364 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_14_GPIO2_IO14                          0x174 0x364 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_14_SRC_BT_CFG10                                0x174 0x364 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_B0_15_LCD_DATA11                          0x178 0x368 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_15_XBAR_INOUT13                                0x178 0x368 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_15_ARM_CM7_RXEV                                0x178 0x368 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_15_SAI1_RX_BCLK                                0x178 0x368 0x590 0x3 0x2
+#define MXRT1050_IOMUXC_GPIO_B0_15_FLEXIO2_D15                         0x178 0x368 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_15_GPIO2_IO15                          0x178 0x368 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B0_15_SRC_BT_CFG11                                0x178 0x368 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_B1_00_LCD_DATA12                          0x17C 0x36C 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_00_XBAR_INOUT14                                0x17C 0x36C 0x644 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_B1_00_LPUART4_TXD                         0x17C 0x36C 0x544 0x2 0x2
+#define MXRT1050_IOMUXC_GPIO_B1_00_SAI1_RX_DATA00                      0x17C 0x36C 0x594 0x3 0x2
+#define MXRT1050_IOMUXC_GPIO_B1_00_FLEXIO2_D16                         0x17C 0x36C 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_00_GPIO2_IO16                          0x17C 0x36C 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_00_FLEXPWM1_PWM3_A                     0x17C 0x36C 0x454 0x6 0x4
+
+#define MXRT1050_IOMUXC_GPIO_B1_01_LCD_DATA13                          0x180 0x370 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_01_XBAR_INOUT15                                0x180 0x370 0x648 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_B1_01_LPUART4_RXD                         0x180 0x370 0x540 0x2 0x2
+#define MXRT1050_IOMUXC_GPIO_B1_01_SAI1_TX_DATA00                      0x180 0x370 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_01_FLEXIO2_D17                         0x180 0x370 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_01_GPIO2_IO17                          0x180 0x370 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_01_FLEXPWM1_PWM3_B                     0x180 0x370 0x464 0x6 0x4
+
+#define MXRT1050_IOMUXC_GPIO_B1_02_LCD_DATA14                          0x184 0x374 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_02_XBAR_INOUT16                                0x184 0x374 0x64C 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_B1_02_LPSPI4_PCS2                         0x184 0x374 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_02_SAI1_TX_BCLK                                0x184 0x374 0x5A8 0x3 0x2
+#define MXRT1050_IOMUXC_GPIO_B1_02_FLEXIO2_D18                         0x184 0x374 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_02_GPIO2_IO18                          0x184 0x374 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_02_FLEXPWM2_PWM3_A                     0x184 0x374 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_B1_03_LCD_DATA15                          0x188 0x378 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_03_XBAR_INOUT17                                0x188 0x378 0x62C 0x1 0x3
+#define MXRT1050_IOMUXC_GPIO_B1_03_LPSPI4_PCS1                         0x188 0x378 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_03_SAI1_TX_SYNC                                0x188 0x378 0x5AC 0x3 0x2
+#define MXRT1050_IOMUXC_GPIO_B1_03_FLEXIO2_D19                         0x188 0x378 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_03_GPIO2_IO19                          0x188 0x378 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_03_FLEXPWM2_PWM3_B                     0x188 0x378 0x484 0x6 0x3
+
+#define MXRT1050_IOMUXC_GPIO_B1_04_LCD_DATA16                          0x18C 0x37C 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_04_LPSPI4_PCS0                         0x18C 0x37C 0x51C 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_B1_04_CSI_DATA15                          0x18C 0x37C 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_04_ENET_RX_DATA00                      0x18C 0x37C 0x434 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_B1_04_FLEXIO2_D20                         0x18C 0x37C 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_04_GPIO2_IO20                          0x18C 0x37C 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_B1_05_LCD_DATA17                          0x190 0x380 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_05_LPSPI4_SDI                          0x190 0x380 0x524 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_B1_05_CSI_DATA14                          0x190 0x380 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_05_ENET_RX_DATA01                      0x190 0x380 0x438 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_B1_05_FLEXIO2_D21                         0x190 0x380 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_05_GPIO2_IO21                          0x190 0x380 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_B1_06_LCD_DATA18                          0x194 0x384 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_06_LPSPI4_SDO                          0x194 0x384 0x528 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_B1_06_CSI_DATA13                          0x194 0x384 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_06_ENET_RX_EN                          0x194 0x384 0x43C 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_B1_06_FLEXIO2_D22                         0x194 0x384 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_06_GPIO2_IO22                          0x194 0x384 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_B1_07_LCD_DATA19                          0x198 0x388 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_07_LPSPI4_SCK                          0x198 0x388 0x520 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_B1_07_CSI_DATA12                          0x198 0x388 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_07_ENET_TX_DATA00                      0x198 0x388 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_07_FLEXIO2_D23                         0x198 0x388 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_07_GPIO2_IO23                          0x198 0x388 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_B1_08_LCD_DATA20                          0x19C 0x38C 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_08_TMR1_TIMER3                         0x19C 0x38C 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_08_CSI_DATA11                          0x19C 0x38C 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_08_ENET_TX_DATA01                      0x19C 0x38C 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_08_FLEXIO2_D24                         0x19C 0x38C 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_08_GPIO2_IO24                          0x19C 0x38C 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_08_FLEXCAN2_TX                         0x19C 0x38C 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_B1_09_LCD_DATA21                          0x1A0 0x390 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_09_TMR2_TIMER3                         0x1A0 0x390 0x578 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_B1_09_CSI_DATA10                          0x1A0 0x390 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_09_ENET_TX_EN                          0x1A0 0x390 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_09_FLEXIO2_D25                         0x1A0 0x390 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_09_GPIO2_IO25                          0x1A0 0x390 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_09_FLEXCAN2_RX                         0x1A0 0x390 0x450 0x6 0x3
+
+#define MXRT1050_IOMUXC_GPIO_B1_10_LCD_DATA22                          0x1A4 0x394 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_10_TMR3_TIMER3                         0x1A4 0x394 0x588 0x1 0x2
+#define MXRT1050_IOMUXC_GPIO_B1_10_CSI_DATA00                          0x1A4 0x394 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_10_ENET_TX_CLK                         0x1A4 0x394 0x448 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_B1_10_FLEXIO2_D26                         0x1A4 0x394 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_10_GPIO2_IO26                          0x1A4 0x394 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_10_ENET_REF_CLK                                0x1A4 0x394 0x42C 0x6 0x1
+
+#define MXRT1050_IOMUXC_GPIO_B1_11_LCD_DATA23                          0x1A8 0x398 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_11_TMR4_TIMER3                         0x1A8 0x398 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_11_CSI_DATA01                          0x1A8 0x398 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_11_ENET_RX_ER                          0x1A8 0x398 0x440 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_B1_11_FLEXIO2_D27                         0x1A8 0x398 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_11_GPIO2_IO27                          0x1A8 0x398 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_11_LPSPI4_PCS3                         0x1A8 0x398 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_B1_12_LPUART5_TXD                         0x1AC 0x39C 0x54C 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_B1_12_CSI_PIXCLK                          0x1AC 0x39C 0x424 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_B1_12_ENET_1588_EVENT0_IN                 0x1AC 0x39C 0x444 0x3 0x2
+#define MXRT1050_IOMUXC_GPIO_B1_12_FLEXIO2_D28                         0x1AC 0x39C 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_12_GPIO2_IO28                          0x1AC 0x39C 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_12_USDHC1_CD_B                         0x1AC 0x39C 0x5D4 0x6 0x2
+
+#define MXRT1050_IOMUXC_GPIO_B1_13_WDOG1_B                             0x1B0 0x3A0 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_13_LPUART5_RXD                         0x1B0 0x3A0 0x548 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_B1_13_CSI_VSYNC                           0x1B0 0x3A0 0x428 0x2 0x2
+#define MXRT1050_IOMUXC_GPIO_B1_13_ENET_1588_EVENT0_OUT                        0x1B0 0x3A0 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_13_FLEXIO2_D29                         0x1B0 0x3A0 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_13_GPIO2_IO29                          0x1B0 0x3A0 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_13_USDHC1_WP                           0x1B0 0x3A0 0x5D8 0x6 0x3
+
+#define MXRT1050_IOMUXC_GPIO_B1_14_ENET_MDC                            0x1B4 0x3A4 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_14_FLEXPWM4_PWM2_A                     0x1B4 0x3A4 0x49C 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_B1_14_CSI_HSYNC                           0x1B4 0x3A4 0x420 0x2 0x2
+#define MXRT1050_IOMUXC_GPIO_B1_14_XBAR_INOUT02                                0x1B4 0x3A4 0x60C 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_B1_14_FLEXIO2_D30                         0x1B4 0x3A4 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_14_GPIO2_IO30                          0x1B4 0x3A4 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_14_USDHC1_VSELECT                      0x1B4 0x3A4 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_B1_15_ENET_MDIO                           0x1B8 0x3A8 0x430 0x0 0x2
+#define MXRT1050_IOMUXC_GPIO_B1_15_FLEXPWM4_PWM3_A                     0x1B8 0x3A8 0x4A0 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_B1_15_CSI_MCLK                            0x1B8 0x3A8 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_15_XBAR_INOUT03                                0x1B8 0x3A8 0x610 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_B1_15_FLEXIO2_D31                         0x1B8 0x3A8 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_15_GPIO2_IO31                          0x1B8 0x3A8 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_B1_15_USDHC1_RESET_B                      0x1B8 0x3A8 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_SD_B0_00_USDHC1_CMD                       0x1BC 0x3AC 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B0_00_FLEXPWM1_PWM0_A                  0x1BC 0x3AC 0x458 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_SD_B0_00_LPI2C3_SCL                       0x1BC 0x3AC 0x4DC 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_SD_B0_00_XBAR_INOUT04                     0x1BC 0x3AC 0x614 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_SD_B0_00_LPSPI1_SCK                       0x1BC 0x3AC 0x4F0 0x4 0x1
+#define MXRT1050_IOMUXC_GPIO_SD_B0_00_GPIO3_IO12                       0x1BC 0x3AC 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B0_00_FLEXSPI_A_SS1_B                  0x1BC 0x3AC 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_SD_B0_01_USDHC1_CLK                       0x1C0 0x3B0 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B0_01_FLEXPWM1_PWM0_B                  0x1C0 0x3B0 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B0_01_LPI2C3_SDA                       0x1C0 0x3B0 0x4E0 0x2 0x1
+#define MXRT1050_IOMUXC_GPIO_SD_B0_01_XBAR_INOUT05                     0x1C0 0x3B0 0x618 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_SD_B0_01_LPSPI1_PCS0                      0x1C0 0x3B0 0x4EC 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B0_01_GPIO3_IO13                       0x1C0 0x3B0 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B0_01_FLEXSPI_B_SS1_B                  0x1C0 0x3B0 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_SD_B0_02_USDHC1_DATA0                     0x1C4 0x3B4 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B0_02_FLEXPWM1_PWM1_A                  0x1C4 0x3B4 0x45C 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_SD_B0_02_LPUART8_CTS_B                    0x1C4 0x3B4 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B0_02_XBAR_INOUT06                     0x1C4 0x3B4 0x61C 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_SD_B0_02_LPSPI1_SDO                       0x1C4 0x3B4 0x4F8 0x4 0x1
+#define MXRT1050_IOMUXC_GPIO_SD_B0_02_GPIO3_IO14                       0x1C4 0x3B4 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_SD_B0_03_USDHC1_DATA1                     0x1C8 0x3B8 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B0_03_FLEXPWM1_PWM1_B                  0x1C8 0x3B8 0x46C 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_SD_B0_03_LPUART8_RTS_B                    0x1C8 0x3B8 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B0_03_XBAR_INOUT07                     0x1C8 0x3B8 0x620 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_SD_B0_03_LPSPI1_SDI                       0x1C8 0x3B8 0x4F4 0x4 0x1
+#define MXRT1050_IOMUXC_GPIO_SD_B0_03_GPIO3_IO15                       0x1C8 0x3B8 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_SD_B0_04_USDHC1_DATA2                     0x1CC 0x3BC 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B0_04_FLEXPWM1_PWM2_A                  0x1CC 0x3BC 0x460 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_SD_B0_04_LPUART8_TXD                      0x1CC 0x3BC 0x564 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B0_04_XBAR_INOUT08                     0x1CC 0x3BC 0x624 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_SD_B0_04_FLEXSPI_B_SS0_B                  0x1CC 0x3BC 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B0_04_GPIO3_IO16                       0x1CC 0x3BC 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B0_04_CCM_CLKO1                                0x1CC 0x3BC 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_SD_B0_05_USDHC1_DATA3                     0x1D0 0x3C0 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B0_05_FLEXPWM1_PWM2_B                  0x1D0 0x3C0 0x470 0x1 0x1
+#define MXRT1050_IOMUXC_GPIO_SD_B0_05_LPUART8_RXD                      0x1D0 0x3C0 0x560 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B0_05_XBAR_INOUT09                     0x1D0 0x3C0 0x628 0x3 0x1
+#define MXRT1050_IOMUXC_GPIO_SD_B0_05_FLEXSPI_B_DQS                    0x1D0 0x3C0 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B0_05_GPIO3_IO17                       0x1D0 0x3C0 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B0_05_CCM_CLKO2                                0x1D0 0x3C0 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_SD_B1_00_USDHC2_DATA3                     0x1D4 0x3C4 0x5F4 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_00_FLEXSPI_B_DATA3                  0x1D4 0x3C4 0x4C4 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_00_FLEXPWM1_PWM3_A                  0x1D4 0x3C4 0x454 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_00_SAI1_TX_DATA03                   0x1D4 0x3C4 0x598 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_00_LPUART4_TXD                      0x1D4 0x3C4 0x544 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_00_GPIO3_IO00                       0x1D4 0x3C4 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_SD_B1_01_USDHC2_DATA2                     0x1D8 0x3C8 0x5F0 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_01_FLEXSPI_B_DATA2                  0x1D8 0x3C8 0x4C0 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_01_FLEXPWM1_PWM3_B                  0x1D8 0x3C8 0x464 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_01_SAI1_TX_DATA02                   0x1D8 0x3C8 0x59C 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_01_LPUART4_RXD                      0x1D8 0x3C8 0x540 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_01_GPIO3_IO01                       0x1D8 0x3C8 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_SD_B1_02_USDHC2_DATA1                     0x1DC 0x3CC 0x5EC 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_02_FLEXSPI_B_DATA1                  0x1DC 0x3CC 0x4BC 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_02_FLEXPWM2_PWM3_A                  0x1DC 0x3CC 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_02_SAI1_TX_DATA01                   0x1DC 0x3CC 0x5A0 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_02_FLEXCAN1_TX                      0x1DC 0x3CC 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_02_GPIO3_IO02                       0x1DC 0x3CC 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_02_CCM_WAIT                         0x1DC 0x3CC 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_SD_B1_03_USDHC2_DATA0                     0x1E0 0x3D0 0x5E8 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_03_FLEXSPI_B_DATA0                  0x1E0 0x3D0 0x4B8 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_03_FLEXPWM2_PWM3_B                  0x1E0 0x3D0 0x484 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_03_SAI1_MCLK                                0x1E0 0x3D0 0x58C 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_03_FLEXCAN1_RX                      0x1E0 0x3D0 0x44C 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_03_GPIO3_IO03                       0x1E0 0x3D0 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_03_CCM_PMIC_READY                   0x1E0 0x3D0 0x3FC 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_SD_B1_04_USDHC2_CLK                       0x1E4 0x3D4 0x5DC 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_04_FLEXSPI_B_SCLK                   0x1E4 0x3D4 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_04_LPI2C1_SCL                       0x1E4 0x3D4 0x4CC 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_04_SAI1_RX_SYNC                     0x1E4 0x3D4 0x5A4 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_04_FLEXCAN1_A_SS1_B                 0x1E4 0x3D4 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_04_GPIO3_IO04                       0x1E4 0x3D4 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_04_CCM_STOP                         0x1E4 0x3D4 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_SD_B1_05_USDHC2_CMD                       0x1E8 0x3D8 0x5E4 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_05_FLEXSPI_A_DQS                    0x1E8 0x3D8 0x4A4 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_05_LPI2C1_SDA                       0x1E8 0x3D8 0x4D0 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_05_SAI1_RX_BCLK                     0x1E8 0x3D8 0x590 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_05_FLEXCAN1_B_SS0_B                 0x1E8 0x3D8 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_05_GPIO3_IO05                       0x1E8 0x3D8 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_SD_B1_06_USDHC2_RESET_B                   0x1EC 0x3DC 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_06_FLEXSPI_A_SS0_B                  0x1EC 0x3DC 0x000 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_06_LPUART7_CTS_B                    0x1EC 0x3DC 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_06_SAI1_RX_DATA00                   0x1EC 0x3DC 0x594 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_06_LPSPI2_PCS0                      0x1EC 0x3DC 0x4FC 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_06_GPIO3_IO06                       0x1EC 0x3DC 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_SD_B1_07_SEMC_CSX1                                0x1F0 0x3E0 0x000 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_07_FLEXSPI_A_SCLK                   0x1F0 0x3E0 0x4C8 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_07_LPUART7_RTS_B                    0x1F0 0x3E0 0x000 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_07_SAI1_TX_DATA00                   0x1F0 0x3E0 0x000 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_07_LPSPI2_SCK                       0x1F0 0x3E0 0x500 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_07_GPIO3_IO07                       0x1F0 0x3E0 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_07_CCM_REF_EN_B                     0x1F0 0x3E0 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_SD_B1_08_USDHC2_DATA4                     0x1F4 0x3E4 0x5F8 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_08_FLEXSPI_A_DATA0                  0x1F4 0x3E4 0x4A8 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_08_LPUART7_TXD                      0x1F4 0x3E4 0x55C 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_08_SAI1_TX_BLCK                     0x1F4 0x3E4 0x5A8 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_08_LPSPI2_SDO                       0x1F4 0x3E4 0x508 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_08_GPIO3_IO08                       0x1F4 0x3E4 0x000 0x5 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_08_SEMC_CSX2                                0x1F4 0x3E4 0x000 0x6 0x0
+
+#define MXRT1050_IOMUXC_GPIO_SD_B1_09_USDHC2_DATA5                     0x1F8 0x3E8 0x5FC 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_09_FLEXSPI_A_DATA1                  0x1F8 0x3E8 0x4AC 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_09_LPUART7_RXD                      0x1F8 0x3E8 0x558 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_09_SAI1_TX_SYNC                     0x1F8 0x3E8 0x5AC 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_09_LPSPI2_SDI                       0x1F8 0x3E8 0x504 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_09_GPIO3_IO09                       0x1F8 0x3E8 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_SD_B1_10_USDHC2_DATA6                     0x1FC 0x3EC 0x600 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_10_FLEXSPI_A_DATA2                  0x1FC 0x3EC 0x4B0 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_10_LPUART2_RXD                      0x1FC 0x3EC 0x52C 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_10_LPI2C2_SDA                       0x1FC 0x3EC 0x4D8 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_10_LPSPI2_PCS2                      0x1FC 0x3EC 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_10_GPIO3_IO10                       0x1FC 0x3EC 0x000 0x5 0x0
+
+#define MXRT1050_IOMUXC_GPIO_SD_B1_11_USDHC2_DATA7                     0x200 0x3F0 0x604 0x0 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_11_FLEXSPI_A_DATA3                  0x200 0x3F0 0x4B4 0x1 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_11_LPUART2_TXD                      0x200 0x3F0 0x530 0x2 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_11_LPI2C2_SCL                       0x200 0x3F0 0x4D4 0x3 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_11_LPSPI2_PCS3                      0x200 0x3F0 0x000 0x4 0x0
+#define MXRT1050_IOMUXC_GPIO_SD_B1_11_GPIO3_IO11                       0x200 0x3F0 0x000 0x5 0x0
+
+#endif /* _DT_BINDINGS_PINCTRL_IMXRT1050_PINFUNC_H */
index a1c03c9..b7cbc90 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: ISC
 /*
- * Device Tree file for Gateway 7001 AP
+ * Device Tree file for Gateway 7001 AP based on IXP422
  * Derived from boardfiles written by Imre Kaloz
  */
 
@@ -29,7 +29,6 @@
        aliases {
                /* second UART is the primary console */
                serial0 = &uart1;
-               serial1 = &uart0;
        };
 
        soc {
 #include <dt-bindings/input/input.h>
 
 / {
-       model = "Netgear WG302 v2";
-       compatible = "netgear,wg302v2", "intel,ixp42x";
+       model = "Netgear WG302 v1";
+       compatible = "netgear,wg302v1", "intel,ixp42x";
        #address-cells = <1>;
        #size-cells = <1>;
 
        memory@0 {
-               /* 16 MB SDRAM according to OpenWrt database */
+               /* 32 MB SDRAM according to boot arguments */
                device_type = "memory";
-               reg = <0x00000000 0x01000000>;
+               reg = <0x00000000 0x02000000>;
        };
 
        chosen {
-               bootargs = "console=ttyS0,115200n8 root=/dev/sda1 rw rootwait";
-               stdout-path = "uart1:115200n8";
+               /* The RedBoot comes up in 9600 baud so let's keep this */
+               bootargs = "console=ttyS0,9600n8";
+               stdout-path = "uart1:9600n8";
        };
 
        aliases {
                /* These are switched around */
                serial0 = &uart1;
-               serial1 = &uart0;
        };
 
        soc {
                                compatible = "intel,ixp4xx-flash", "cfi-flash";
                                bank-width = <2>;
                                /*
-                                * 32 MB of Flash in 128 0x20000 sized blocks
-                                * mapped in at CS0 and CS1
+                                * 8 MB of Flash in 64 0x20000 sized blocks
+                                * mapped in at CS0.
                                 */
-                               reg = <0 0x00000000 0x2000000>;
+                               reg = <0 0x00000000 0x800000>;
 
                                /* Configure expansion bus to allow writes */
                                intel,ixp4xx-eb-write-enable = <1>;
 
                                partitions {
                                        compatible = "redboot-fis";
-                                       /* CHECKME: guess this is Redboot FIS */
-                                       fis-index-block = <0xff>;
+                                       fis-index-block = <0x3f>;
                                };
                        };
                };
                        queue-rx = <&qmgr 3>;
                        queue-txready = <&qmgr 20>;
                        phy-mode = "rgmii";
-                       phy-handle = <&phy8>;
+                       phy-handle = <&phy30>;
 
                        mdio {
                                #address-cells = <1>;
                                #size-cells = <0>;
 
-                               phy8: ethernet-phy@8 {
-                                       reg = <8>;
+                               phy30: ethernet-phy@30 {
+                                       reg = <30>;
                                };
                        };
                };
index d0e0f8a..84cee8e 100644 (file)
@@ -9,7 +9,7 @@
        soc {
                bus@c4000000 {
                        compatible = "intel,ixp42x-expansion-bus-controller", "syscon";
-                       reg = <0xc4000000 0x28>;
+                       reg = <0xc4000000 0x30>;
                };
 
                pci@c0000000 {
index 849034a..03caea6 100644 (file)
 };
 
 &gpio2 {
-       touch-interrupt {
+       touch-interrupt-hog {
                gpio-hog;
                gpios = <12 GPIO_ACTIVE_LOW>;
                input;
diff --git a/arch/arm/boot/dts/lan966x-pcb8291.dts b/arch/arm/boot/dts/lan966x-pcb8291.dts
new file mode 100644 (file)
index 0000000..3281af9
--- /dev/null
@@ -0,0 +1,64 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * lan966x_pcb8291.dts - Device Tree file for PCB8291
+ */
+/dts-v1/;
+#include "lan966x.dtsi"
+
+/ {
+       model = "Microchip EVB - LAN9662";
+       compatible = "microchip,lan9662-pcb8291", "microchip,lan9662", "microchip,lan966";
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       aliases {
+               serial0 = &usart3;
+       };
+};
+
+&gpio {
+       fc_shrd7_pins: fc_shrd7-pins {
+               pins = "GPIO_49";
+               function = "fc_shrd7";
+       };
+
+       fc_shrd8_pins: fc_shrd8-pins {
+               pins = "GPIO_54";
+               function = "fc_shrd8";
+       };
+
+       fc3_b_pins: fcb3-spi-pins {
+               /* SCK, RXD, TXD */
+               pins = "GPIO_51", "GPIO_52", "GPIO_53";
+               function = "fc3_b";
+       };
+
+       can0_b_pins:  can0_b_pins {
+               /* RX, TX */
+               pins = "GPIO_35", "GPIO_36";
+               function = "can0_b";
+       };
+};
+
+&can0 {
+       pinctrl-0 = <&can0_b_pins>;
+       pinctrl-names = "default";
+       status = "okay";
+};
+
+&flx3 {
+       atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_USART>;
+       status = "okay";
+
+       usart3: serial@200 {
+               pinctrl-0 = <&fc3_b_pins>, <&fc_shrd7_pins>, <&fc_shrd8_pins>;
+               pinctrl-names = "default";
+               status = "okay";
+       };
+};
+
+&watchdog {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/lan966x.dtsi b/arch/arm/boot/dts/lan966x.dtsi
new file mode 100644 (file)
index 0000000..7d28696
--- /dev/null
@@ -0,0 +1,237 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * lan966x.dtsi - Device Tree Include file for Microchip LAN966 family SoC
+ *
+ * Copyright (C) 2021 Microchip Technology, Inc. and its subsidiaries
+ *
+ * Author: Kavyasree Kotagiri <kavyasree.kotagiri@microchip.com>
+ *
+ */
+
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/mfd/atmel-flexcom.h>
+#include <dt-bindings/dma/at91.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/clock/microchip,lan966x.h>
+
+/ {
+       model = "Microchip LAN966 family SoC";
+       compatible = "microchip,lan966";
+       interrupt-parent = <&gic>;
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a7";
+                       clock-frequency = <600000000>;
+                       reg = <0x0>;
+               };
+       };
+
+       clocks {
+               sys_clk: sys_clk {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <162500000>;
+               };
+
+               cpu_clk: cpu_clk {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <600000000>;
+               };
+
+               ddr_clk: ddr_clk {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <300000000>;
+               };
+
+               nic_clk: nic_clk {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <200000000>;
+               };
+       };
+
+       clks: clock-controller@e00c00a8 {
+               compatible = "microchip,lan966x-gck";
+               #clock-cells = <1>;
+               clocks = <&cpu_clk>, <&ddr_clk>, <&sys_clk>;
+               clock-names = "cpu", "ddr", "sys";
+               reg = <0xe00c00a8 0x38>;
+       };
+
+       timer {
+               compatible = "arm,armv7-timer";
+               interrupt-parent = <&gic>;
+               interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>;
+               clock-frequency = <37500000>;
+       };
+
+       soc {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               flx0: flexcom@e0040000 {
+                       compatible = "atmel,sama5d2-flexcom";
+                       reg = <0xe0040000 0x100>;
+                       clocks = <&clks GCK_ID_FLEXCOM0>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0x0 0xe0040000 0x800>;
+                       status = "disabled";
+               };
+
+               flx1: flexcom@e0044000 {
+                       compatible = "atmel,sama5d2-flexcom";
+                       reg = <0xe0044000 0x100>;
+                       clocks = <&clks GCK_ID_FLEXCOM1>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0x0 0xe0044000 0x800>;
+                       status = "disabled";
+               };
+
+               trng: rng@e0048000 {
+                       compatible = "atmel,at91sam9g45-trng";
+                       reg = <0xe0048000 0x100>;
+                       clocks = <&nic_clk>;
+               };
+
+               aes: crypto@e004c000 {
+                       compatible = "atmel,at91sam9g46-aes";
+                       reg = <0xe004c000 0x100>;
+                       interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>;
+                       dmas = <&dma0 AT91_XDMAC_DT_PERID(13)>,
+                              <&dma0 AT91_XDMAC_DT_PERID(12)>;
+                       dma-names = "rx", "tx";
+                       clocks = <&nic_clk>;
+                       clock-names = "aes_clk";
+               };
+
+               flx2: flexcom@e0060000 {
+                       compatible = "atmel,sama5d2-flexcom";
+                       reg = <0xe0060000 0x100>;
+                       clocks = <&clks GCK_ID_FLEXCOM2>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0x0 0xe0060000 0x800>;
+                       status = "disabled";
+               };
+
+               flx3: flexcom@e0064000 {
+                       compatible = "atmel,sama5d2-flexcom";
+                       reg = <0xe0064000 0x100>;
+                       clocks = <&clks GCK_ID_FLEXCOM3>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0x0 0xe0064000 0x800>;
+                       status = "disabled";
+
+                       usart3: serial@200 {
+                               compatible = "atmel,at91sam9260-usart";
+                               reg = <0x200 0x200>;
+                               interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&nic_clk>;
+                               clock-names = "usart";
+                               atmel,fifo-size = <32>;
+                               status = "disabled";
+                       };
+               };
+
+               dma0: dma-controller@e0068000 {
+                       compatible = "microchip,sama7g5-dma";
+                       reg = <0xe0068000 0x1000>;
+                       interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>;
+                       #dma-cells = <1>;
+                       clocks = <&nic_clk>;
+                       clock-names = "dma_clk";
+               };
+
+               sha: crypto@e006c000 {
+                       compatible = "atmel,at91sam9g46-sha";
+                       reg = <0xe006c000 0xec>;
+                       interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>;
+                       dmas = <&dma0 AT91_XDMAC_DT_PERID(14)>;
+                       dma-names = "tx";
+                       clocks = <&nic_clk>;
+                       clock-names = "sha_clk";
+               };
+
+               flx4: flexcom@e0070000 {
+                       compatible = "atmel,sama5d2-flexcom";
+                       reg = <0xe0070000 0x100>;
+                       clocks = <&clks GCK_ID_FLEXCOM4>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0x0 0xe0070000 0x800>;
+                       status = "disabled";
+               };
+
+               timer0: timer@e008c000 {
+                       compatible = "snps,dw-apb-timer";
+                       reg = <0xe008c000 0x400>;
+                       clocks = <&nic_clk>;
+                       clock-names = "timer";
+                       interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
+               };
+
+               watchdog: watchdog@e0090000 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xe0090000 0x1000>;
+                       interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&nic_clk>;
+                       status = "disabled";
+               };
+
+               can0: can@e081c000 {
+                       compatible = "bosch,m_can";
+                       reg = <0xe081c000 0xfc>, <0x00100000 0x4000>;
+                       reg-names = "m_can", "message_ram";
+                       interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "int0", "int1";
+                       clocks = <&clks GCK_ID_MCAN0>, <&clks GCK_ID_MCAN0>;
+                       clock-names = "hclk", "cclk";
+                       assigned-clocks = <&clks GCK_ID_MCAN0>;
+                       assigned-clock-rates = <40000000>;
+                       bosch,mram-cfg = <0x0 0 0 64 0 0 32 32>;
+                       status = "disabled";
+               };
+
+               gpio: pinctrl@e2004064 {
+                       compatible = "microchip,lan966x-pinctrl";
+                       reg = <0xe2004064 0xb4>,
+                           <0xe2010024 0x138>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       gpio-ranges = <&gpio 0 0 78>;
+                       interrupt-controller;
+                       interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
+                       #interrupt-cells = <2>;
+               };
+
+               gic: interrupt-controller@e8c11000 {
+                       compatible = "arm,gic-400", "arm,cortex-a7-gic";
+                       #interrupt-cells = <3>;
+                       interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-controller;
+                       reg = <0xe8c11000 0x1000>,
+                             <0xe8c12000 0x2000>,
+                             <0xe8c14000 0x2000>,
+                             <0xe8c16000 0x2000>;
+               };
+       };
+};
index 57bae2a..cb08aa6 100644 (file)
        model = "LogicPD Zoom OMAP35xx Torpedo Development Kit";
        compatible = "logicpd,dm3730-torpedo-devkit", "ti,omap3430", "ti,omap3";
 };
+
+&omap3_pmx_core {
+       isp1763_pins: pinmux_isp1763_pins {
+               pinctrl-single,pins = <
+                       OMAP3_CORE1_IOPAD(0x2154,  PIN_INPUT_PULLUP | MUX_MODE4)        /* sdmmc1_dat6.gpio_128 */
+               >;
+       };
+};
index 5532db0..07ea822 100644 (file)
                >;
        };
 };
+
+/* The gpio muxing between omap3530 and dm3730 is different for GPIO_128 */
+&omap3_pmx_wkup {
+       isp1763_pins: pinmux_isp1763_pins {
+               pinctrl-single,pins = <
+                       OMAP3_WKUP_IOPAD(0x2a58, PIN_INPUT_PULLUP | MUX_MODE4)  /* reserved.gpio_128 */
+               >;
+       };
+};
index 533a47b..b4664ab 100644 (file)
@@ -93,7 +93,8 @@
 
 &gpmc {
        ranges = <0 0 0x30000000 0x1000000      /* CS0: 16MB for NAND */
-                 1 0 0x2c000000 0x1000000>;    /* CS1: 16MB for LAN9221 */
+                 1 0 0x2c000000 0x1000000      /* CS1: 16MB for LAN9221 */
+                 6 0 0x28000000 0x1000000>;    /* CS6: 16MB for ISP1763 */
 
        ethernet@gpmc {
                pinctrl-names = "default";
                interrupts = <1 IRQ_TYPE_LEVEL_LOW>;            /* gpio129 */
                reg = <1 0 0xff>;
        };
+
+       usb@6,0 {
+               pinctrl-names = "default";
+               pinctrl-0 = <&isp1763_pins>;
+               compatible = "nxp,usb-isp1763";
+               reg = <0x6 0x0 0xff>;
+               interrupt-parent = <&gpio5>;
+               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+               interrupt-names = "host";
+               bus-width = <16>;
+               dr_mode = "host";
+               gpmc,mux-add-data = <0>;
+               gpmc,device-width = <2>;
+               gpmc,wait-pin = <0>;
+               gpmc,burst-length = <4>;
+               gpmc,cycle2cycle-samecsen = <1>;
+               gpmc,cycle2cycle-diffcsen = <1>;
+               gpmc,cs-on-ns = <0>;
+               gpmc,cs-rd-off-ns = <45>;
+               gpmc,cs-wr-off-ns = <45>;
+               gpmc,adv-on-ns = <0>;
+               gpmc,adv-rd-off-ns = <0>;
+               gpmc,adv-wr-off-ns = <0>;
+               gpmc,oe-on-ns = <0>;
+               gpmc,oe-off-ns = <45>;
+               gpmc,we-on-ns = <0>;
+               gpmc,we-off-ns = <25>;
+               gpmc,rd-cycle-ns = <60>;
+               gpmc,wr-cycle-ns = <45>;
+               gpmc,access-ns = <35>;
+               gpmc,page-burst-access-ns = <0>;
+               gpmc,bus-turnaround-ns = <0>;
+               gpmc,cycle2cycle-delay-ns = <60>;
+               gpmc,wait-monitoring-ns = <0>;
+               gpmc,clk-activation-ns = <0>;
+               gpmc,wr-data-mux-bus-ns = <5>;
+               gpmc,wr-access-ns = <20>;
+       };
 };
 
 &hdqw1w {
index 0bee517..441a917 100644 (file)
@@ -8,6 +8,40 @@
 
 #include <dt-bindings/gpio/msc313-gpio.h>
 
+/ {
+       cpu0_opp_table: opp_table0 {
+               compatible = "operating-points-v2";
+               opp-shared;
+
+               opp-240000000 {
+                       opp-hz = /bits/ 64 <240000000>;
+                       opp-microvolt = <1000000>;
+                       clock-latency-ns = <300000>;
+               };
+
+               opp-400000000 {
+                       opp-hz = /bits/ 64 <400000000>;
+                       opp-microvolt = <1000000>;
+                       clock-latency-ns = <300000>;
+               };
+               opp-600000000 {
+                       opp-hz = /bits/ 64 <600000000>;
+                       opp-microvolt = <1000000>;
+                       clock-latency-ns = <300000>;
+               };
+
+               opp-800000000 {
+                       opp-hz = /bits/ 64 <800000000>;
+                       opp-microvolt = <1000000>;
+                       clock-latency-ns = <300000>;
+               };
+       };
+};
+
+&cpu0 {
+       operating-points-v2 = <&cpu0_opp_table>;
+};
+
 &imi {
        reg = <0xa0000000 0x16000>;
 };
diff --git a/arch/arm/boot/dts/mstar-infinity2m-ssd201-som2d01.dtsi b/arch/arm/boot/dts/mstar-infinity2m-ssd201-som2d01.dtsi
new file mode 100644 (file)
index 0000000..34df472
--- /dev/null
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright (c) 2021 thingy.jp.
+ * Author: Daniel Palmer <daniel@thingy.jp>
+ * Author: Romain Perier <romain.perier@gmail.com>
+ */
+
+/ {
+       reg_vcc_dram: regulator-vcc-dram {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc_dram";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               regulator-boot-on;
+       };
+};
+
+&pm_uart {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/mstar-infinity2m-ssd202d-100ask-dongshanpione.dts b/arch/arm/boot/dts/mstar-infinity2m-ssd202d-100ask-dongshanpione.dts
new file mode 100644 (file)
index 0000000..f25a04c
--- /dev/null
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2021 thingy.jp.
+ * Author: Daniel Palmer <daniel@thingy.jp>
+ */
+
+/dts-v1/;
+#include "mstar-infinity2m-ssd202d.dtsi"
+
+/ {
+       model = "DongShanPi One";
+       compatible = "100ask,dongshanpione", "mstar,infinity2m";
+
+       aliases {
+               serial0 = &pm_uart;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+};
+
+&pm_uart {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/mstar-infinity2m-ssd202d-miyoo-mini.dts b/arch/arm/boot/dts/mstar-infinity2m-ssd202d-miyoo-mini.dts
new file mode 100644 (file)
index 0000000..1bbbf47
--- /dev/null
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2021 thingy.jp.
+ * Author: Daniel Palmer <daniel@thingy.jp>
+ */
+
+/dts-v1/;
+#include "mstar-infinity2m-ssd202d.dtsi"
+
+/ {
+       model = "Miyoo Mini";
+       compatible = "miyoo,miyoo-mini", "mstar,infinity2m";
+
+       aliases {
+               serial0 = &pm_uart;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+};
+
+&pm_uart {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/mstar-infinity2m-ssd202d-wirelesstag-ido-sbc2d06-v1b-22w.dts b/arch/arm/boot/dts/mstar-infinity2m-ssd202d-wirelesstag-ido-sbc2d06-v1b-22w.dts
new file mode 100644 (file)
index 0000000..b15c407
--- /dev/null
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright (c) 2021 thingy.jp.
+ * Author: Daniel Palmer <daniel@thingy.jp>
+ * Author: Romain Perier <romain.perier@gmail.com>
+ */
+
+/dts-v1/;
+#include "mstar-infinity2m-ssd202d-wirelesstag-ido-som2d01.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+       model = "Wireless Tag IDO-SBC2D06-1VB-22W";
+       compatible = "wirelesstag,ido-sbc2d06-v1b-22w", "mstar,infinity2m";
+
+       leds {
+               compatible = "gpio-leds";
+               sys_led {
+                       gpios = <&gpio SSD20XD_GPIO_GPIO85 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "heartbeat";
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/mstar-infinity2m-ssd202d-wirelesstag-ido-som2d01.dtsi b/arch/arm/boot/dts/mstar-infinity2m-ssd202d-wirelesstag-ido-som2d01.dtsi
new file mode 100644 (file)
index 0000000..d877aff
--- /dev/null
@@ -0,0 +1,28 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright (c) 2021 thingy.jp.
+ * Author: Daniel Palmer <daniel@thingy.jp>
+ * Author: Romain Perier <romain.perier@gmail.com>
+ */
+
+/dts-v1/;
+#include "mstar-infinity2m-ssd202d.dtsi"
+#include "mstar-infinity2m-ssd201-som2d01.dtsi"
+
+/ {
+       model = "Wireless Tag IDO-SOM2D01 (SSD202D)";
+       compatible = "wirelesstag,ido-som2d01", "mstar,infinity2m";
+
+       aliases {
+               serial0 = &pm_uart;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+};
+
+&reg_vcc_dram {
+       regulator-min-microvolt = <1500000>;
+       regulator-max-microvolt = <1500000>;
+};
index 7a5e28b..6f067da 100644 (file)
@@ -6,6 +6,11 @@
 
 #include "mstar-infinity2m.dtsi"
 
+&gpio {
+       compatible = "sstar,ssd20xd-gpio";
+       status = "okay";
+};
+
 &smpctrl {
        compatible = "sstar,ssd201-smpctrl", "mstar,smpctrl";
        status = "okay";
index 6d4d1d2..1b485ef 100644 (file)
@@ -6,11 +6,28 @@
 
 #include "mstar-infinity.dtsi"
 
+&cpu0_opp_table {
+               opp-1000000000 {
+                       opp-hz = /bits/ 64 <1000000000>;
+                       opp-microvolt = <1000000>;
+                       clock-latency-ns = <300000>;
+               };
+
+               opp-1200000000 {
+                       opp-hz = /bits/ 64 <1200000000>;
+                       opp-microvolt = <1000000>;
+                       clock-latency-ns = <300000>;
+               };
+};
+
 &cpus {
        cpu1: cpu@1 {
                device_type = "cpu";
                compatible = "arm,cortex-a7";
+               operating-points-v2 = <&cpu0_opp_table>;
                reg = <0x1>;
+               clocks = <&cpupll>;
+               clock-names = "cpuclk";
        };
 };
 
index 9857e2a..a56cf29 100644 (file)
@@ -6,6 +6,64 @@
 
 #include "mstar-infinity.dtsi"
 
+&cpu0_opp_table {
+       opp-1008000000 {
+               opp-hz = /bits/ 64 <1008000000>;
+               opp-microvolt = <1000000>;
+               clock-latency-ns = <300000>;
+       };
+
+       // overclock frequencies below, shown to work fine up to 1.3 GHz
+       opp-108000000 {
+               opp-hz = /bits/ 64 <1080000000>;
+               opp-microvolt = <1000000>;
+               clock-latency-ns = <300000>;
+               turbo-mode;
+       };
+
+       opp-1188000000 {
+               opp-hz = /bits/ 64 <1188000000>;
+               opp-microvolt = <1000000>;
+               clock-latency-ns = <300000>;
+               turbo-mode;
+       };
+
+       opp-1296000000 {
+               opp-hz = /bits/ 64 <1296000000>;
+               opp-microvolt = <1000000>;
+               clock-latency-ns = <300000>;
+               turbo-mode;
+       };
+
+       opp-1350000000 {
+               opp-hz = /bits/ 64 <1350000000>;
+               opp-microvolt = <1000000>;
+               clock-latency-ns = <300000>;
+               turbo-mode;
+       };
+
+       opp-1404000000 {
+               opp-hz = /bits/ 64 <1404000000>;
+               opp-microvolt = <1000000>;
+               clock-latency-ns = <300000>;
+               turbo-mode;
+       };
+
+       opp-1458000000 {
+               opp-hz = /bits/ 64 <1458000000>;
+               opp-microvolt = <1000000>;
+               clock-latency-ns = <300000>;
+               turbo-mode;
+       };
+
+       opp-1512000000 {
+               opp-hz = /bits/ 64 <1512000000>;
+               opp-microvolt = <1000000>;
+               clock-latency-ns = <300000>;
+               turbo-mode;
+       };
+};
+
 &imi {
        reg = <0xa0000000 0x20000>;
 };
index 89ebfe4..c26ba9b 100644 (file)
@@ -21,6 +21,8 @@
                        device_type = "cpu";
                        compatible = "arm,cortex-a7";
                        reg = <0x0>;
+                       clocks = <&cpupll>;
+                       clock-names = "cpuclk";
                };
        };
 
                                clocks = <&xtal>;
                        };
 
+                       cpupll: cpupll@206400 {
+                               compatible = "mstar,msc313-cpupll";
+                               reg = <0x206400 0x200>;
+                               #clock-cells = <0>;
+                               clocks = <&mpll MSTAR_MSC313_MPLL_DIV2>;
+                       };
+
                        gpio: gpio@207800 {
                                #gpio-cells = <2>;
                                reg = <0x207800 0x200>;
diff --git a/arch/arm/boot/dts/mt6582-prestigio-pmt5008-3g.dts b/arch/arm/boot/dts/mt6582-prestigio-pmt5008-3g.dts
new file mode 100644 (file)
index 0000000..b057e03
--- /dev/null
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (c) 2021 Maxim Kutnij <gtk3@inbox.ru>
+ */
+
+/dts-v1/;
+#include "mt6582.dtsi"
+
+/ {
+       model = "Prestigio PMT5008 3G";
+       compatible = "prestigio,pmt5008-3g", "mediatek,mt6582";
+
+       aliases {
+               bootargs = "console=ttyS0,921600n8 earlyprintk";
+               serial0 = &uart0;
+               serial3 = &uart3;
+       };
+
+       chosen {
+               stdout-path = "serial0:921600n8";
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0x80000000 0x40000000>;
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
+
+&uart1 {
+       status = "okay";
+};
+
+&uart2 {
+       status = "okay";
+};
+
+&uart3 {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/mt6582.dtsi b/arch/arm/boot/dts/mt6582.dtsi
new file mode 100644 (file)
index 0000000..4263371
--- /dev/null
@@ -0,0 +1,128 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (c) 2021 Maxim Kutnij <gtk3@inbox.ru>
+ */
+
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+       #address-cells = <1>;
+       #size-cells = <1>;
+       compatible = "mediatek,mt6582";
+       interrupt-parent = <&sysirq>;
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a7";
+                       reg = <0x0>;
+               };
+               cpu@1 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a7";
+                       reg = <0x1>;
+               };
+               cpu@2 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a7";
+                       reg = <0x2>;
+               };
+               cpu@3 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a7";
+                       reg = <0x3>;
+               };
+       };
+
+       system_clk: dummy13m {
+               compatible = "fixed-clock";
+               clock-frequency = <13000000>;
+               #clock-cells = <0>;
+       };
+
+       rtc_clk: dummy32k {
+               compatible = "fixed-clock";
+               clock-frequency = <32000>;
+               #clock-cells = <0>;
+       };
+
+       uart_clk: dummy26m {
+               compatible = "fixed-clock";
+               clock-frequency = <26000000>;
+               #clock-cells = <0>;
+       };
+
+       timer: timer@11008000 {
+               compatible = "mediatek,mt6577-timer";
+               reg = <0x10008000 0x80>;
+               interrupts = <GIC_SPI 112 IRQ_TYPE_LEVEL_LOW>;
+               clocks = <&system_clk>, <&rtc_clk>;
+               clock-names = "system-clk", "rtc-clk";
+       };
+
+       sysirq: interrupt-controller@10200100 {
+               compatible = "mediatek,mt6582-sysirq",
+                            "mediatek,mt6577-sysirq";
+               interrupt-controller;
+               #interrupt-cells = <3>;
+               interrupt-parent = <&gic>;
+               reg = <0x10200100 0x1c>;
+       };
+
+       gic: interrupt-controller@10211000 {
+               compatible = "arm,cortex-a7-gic";
+               interrupt-controller;
+               #interrupt-cells = <3>;
+               interrupt-parent = <&gic>;
+               reg = <0x10211000 0x1000>,
+                     <0x10212000 0x2000>,
+                     <0x10214000 0x2000>,
+                     <0x10216000 0x2000>;
+       };
+
+       uart0: serial@11002000 {
+               compatible = "mediatek,mt6582-uart",
+                            "mediatek,mt6577-uart";
+               reg = <0x11002000 0x400>;
+               interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_LOW>;
+               clocks = <&uart_clk>;
+               status = "disabled";
+       };
+
+       uart1: serial@11003000 {
+               compatible = "mediatek,mt6582-uart",
+                            "mediatek,mt6577-uart";
+               reg = <0x11003000 0x400>;
+               interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_LOW>;
+               clocks = <&uart_clk>;
+               status = "disabled";
+       };
+
+       uart2: serial@11004000 {
+               compatible = "mediatek,mt6582-uart",
+                            "mediatek,mt6577-uart";
+               reg = <0x11004000 0x400>;
+               interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_LOW>;
+               clocks = <&uart_clk>;
+               status = "disabled";
+       };
+
+       uart3: serial@11005000 {
+               compatible = "mediatek,mt6582-uart",
+                            "mediatek,mt6577-uart";
+               reg = <0x11005000 0x400>;
+               interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_LOW>;
+               clocks = <&uart_clk>;
+               status = "disabled";
+       };
+
+       watchdog: watchdog@10007000 {
+               compatible = "mediatek,mt6582-wdt",
+                            "mediatek,mt6589-wdt";
+               reg = <0x10007000 0x100>;
+       };
+};
index 83f27fb..3ee6125 100644 (file)
@@ -8,6 +8,9 @@
 
 #include "nuvoton-wpcm450.dtsi"
 
+#include <dt-bindings/input/linux-event-codes.h>
+#include <dt-bindings/gpio/gpio.h>
+
 / {
        model = "Supermicro X9SCi-LN4F BMC";
        compatible = "supermicro,x9sci-ln4f-bmc", "nuvoton,wpcm450";
                device_type = "memory";
                reg = <0 0x08000000>; /* 128 MiB */
        };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               pinctrl-names = "default";
+               pinctrl-0 = <&key_pins>;
+
+               uid {
+                       label = "UID button";
+                       linux,code = <KEY_HOME>;
+                       gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pins>;
+
+               uid {
+                       label = "UID";
+                       gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
+               };
+
+               heartbeat {
+                       label = "heartbeat";
+                       gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
+               };
+       };
+};
+
+&pinctrl {
+       key_pins: mux-keys {
+               groups = "gspi", "sspi";
+               function = "gpio";
+       };
+
+       led_pins: mux-leds {
+               groups = "hg3", "hg0", "pwm4";
+               function = "gpio";
+       };
 };
 
 &serial0 {
index d7cbeb1..9359585 100644 (file)
@@ -8,6 +8,17 @@
        #address-cells = <1>;
        #size-cells = <1>;
 
+       aliases {
+               gpio0 = &gpio0;
+               gpio1 = &gpio1;
+               gpio2 = &gpio2;
+               gpio3 = &gpio3;
+               gpio4 = &gpio4;
+               gpio5 = &gpio5;
+               gpio6 = &gpio6;
+               gpio7 = &gpio7;
+       };
+
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
                interrupt-parent = <&aic>;
                ranges;
 
+               gcr: syscon@b0000000 {
+                       compatible = "nuvoton,wpcm450-gcr", "syscon", "simple-mfd";
+                       reg = <0xb0000000 0x200>;
+               };
+
                serial0: serial@b8000000 {
                        compatible = "nuvoton,wpcm450-uart";
                        reg = <0xb8000000 0x20>;
                        reg-shift = <2>;
                        interrupts = <7 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&clk24m>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&bsp_pins>;
                        status = "disabled";
                };
 
                        interrupt-controller;
                        #interrupt-cells = <2>;
                };
+
+               pinctrl: pinctrl@b8003000 {
+                       compatible = "nuvoton,wpcm450-pinctrl";
+                       reg = <0xb8003000 0x1000>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       gpio0: gpio@0 {
+                               reg = <0>;
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               interrupts = <2 IRQ_TYPE_LEVEL_HIGH>,
+                                            <3 IRQ_TYPE_LEVEL_HIGH>,
+                                            <4 IRQ_TYPE_LEVEL_HIGH>;
+                               interrupt-controller;
+                       };
+
+                       gpio1: gpio@1 {
+                               reg = <1>;
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
+                               interrupt-controller;
+                       };
+
+                       gpio2: gpio@2 {
+                               reg = <2>;
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                       };
+
+                       gpio3: gpio@3 {
+                               reg = <3>;
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                       };
+
+                       gpio4: gpio@4 {
+                               reg = <4>;
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                       };
+
+                       gpio5: gpio@5 {
+                               reg = <5>;
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                       };
+
+                       gpio6: gpio@6 {
+                               reg = <6>;
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                       };
+
+                       gpio7: gpio@7 {
+                               reg = <7>;
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                       };
+
+                       smb3_pins: mux-smb3 {
+                               groups = "smb3";
+                               function = "smb3";
+                       };
+
+                       smb4_pins: mux-smb4 {
+                               groups = "smb4";
+                               function = "smb4";
+                       };
+
+                       smb5_pins: mux-smb5 {
+                               groups = "smb5";
+                               function = "smb5";
+                       };
+
+                       scs1_pins: mux-scs1 {
+                               groups = "scs1";
+                               function = "scs1";
+                       };
+
+                       scs2_pins: mux-scs2 {
+                               groups = "scs2";
+                               function = "scs2";
+                       };
+
+                       scs3_pins: mux-scs3 {
+                               groups = "scs3";
+                               function = "scs3";
+                       };
+
+                       smb0_pins: mux-smb0 {
+                               groups = "smb0";
+                               function = "smb0";
+                       };
+
+                       smb1_pins: mux-smb1 {
+                               groups = "smb1";
+                               function = "smb1";
+                       };
+
+                       smb2_pins: mux-smb2 {
+                               groups = "smb2";
+                               function = "smb2";
+                       };
+
+                       bsp_pins: mux-bsp {
+                               groups = "bsp";
+                               function = "bsp";
+                       };
+
+                       hsp1_pins: mux-hsp1 {
+                               groups = "hsp1";
+                               function = "hsp1";
+                       };
+
+                       hsp2_pins: mux-hsp2 {
+                               groups = "hsp2";
+                               function = "hsp2";
+                       };
+
+                       r1err_pins: mux-r1err {
+                               groups = "r1err";
+                               function = "r1err";
+                       };
+
+                       r1md_pins: mux-r1md {
+                               groups = "r1md";
+                               function = "r1md";
+                       };
+
+                       rmii2_pins: mux-rmii2 {
+                               groups = "rmii2";
+                               function = "rmii2";
+                       };
+
+                       r2err_pins: mux-r2err {
+                               groups = "r2err";
+                               function = "r2err";
+                       };
+
+                       r2md_pins: mux-r2md {
+                               groups = "r2md";
+                               function = "r2md";
+                       };
+
+                       kbcc_pins: mux-kbcc {
+                               groups = "kbcc";
+                               function = "kbcc";
+                       };
+
+                       dvo0_pins: mux-dvo0 {
+                               groups = "dvo";
+                               function = "dvo0";
+                       };
+
+                       dvo3_pins: mux-dvo3 {
+                               groups = "dvo";
+                               function = "dvo3";
+                       };
+
+                       clko_pins: mux-clko {
+                               groups = "clko";
+                               function = "clko";
+                       };
+
+                       smi_pins: mux-smi {
+                               groups = "smi";
+                               function = "smi";
+                       };
+
+                       uinc_pins: mux-uinc {
+                               groups = "uinc";
+                               function = "uinc";
+                       };
+
+                       gspi_pins: mux-gspi {
+                               groups = "gspi";
+                               function = "gspi";
+                       };
+
+                       mben_pins: mux-mben {
+                               groups = "mben";
+                               function = "mben";
+                       };
+
+                       xcs2_pins: mux-xcs2 {
+                               groups = "xcs2";
+                               function = "xcs2";
+                       };
+
+                       xcs1_pins: mux-xcs1 {
+                               groups = "xcs1";
+                               function = "xcs1";
+                       };
+
+                       sdio_pins: mux-sdio {
+                               groups = "sdio";
+                               function = "sdio";
+                       };
+
+                       sspi_pins: mux-sspi {
+                               groups = "sspi";
+                               function = "sspi";
+                       };
+
+                       fi0_pins: mux-fi0 {
+                               groups = "fi0";
+                               function = "fi0";
+                       };
+
+                       fi1_pins: mux-fi1 {
+                               groups = "fi1";
+                               function = "fi1";
+                       };
+
+                       fi2_pins: mux-fi2 {
+                               groups = "fi2";
+                               function = "fi2";
+                       };
+
+                       fi3_pins: mux-fi3 {
+                               groups = "fi3";
+                               function = "fi3";
+                       };
+
+                       fi4_pins: mux-fi4 {
+                               groups = "fi4";
+                               function = "fi4";
+                       };
+
+                       fi5_pins: mux-fi5 {
+                               groups = "fi5";
+                               function = "fi5";
+                       };
+
+                       fi6_pins: mux-fi6 {
+                               groups = "fi6";
+                               function = "fi6";
+                       };
+
+                       fi7_pins: mux-fi7 {
+                               groups = "fi7";
+                               function = "fi7";
+                       };
+
+                       fi8_pins: mux-fi8 {
+                               groups = "fi8";
+                               function = "fi8";
+                       };
+
+                       fi9_pins: mux-fi9 {
+                               groups = "fi9";
+                               function = "fi9";
+                       };
+
+                       fi10_pins: mux-fi10 {
+                               groups = "fi10";
+                               function = "fi10";
+                       };
+
+                       fi11_pins: mux-fi11 {
+                               groups = "fi11";
+                               function = "fi11";
+                       };
+
+                       fi12_pins: mux-fi12 {
+                               groups = "fi12";
+                               function = "fi12";
+                       };
+
+                       fi13_pins: mux-fi13 {
+                               groups = "fi13";
+                               function = "fi13";
+                       };
+
+                       fi14_pins: mux-fi14 {
+                               groups = "fi14";
+                               function = "fi14";
+                       };
+
+                       fi15_pins: mux-fi15 {
+                               groups = "fi15";
+                               function = "fi15";
+                       };
+
+                       pwm0_pins: mux-pwm0 {
+                               groups = "pwm0";
+                               function = "pwm0";
+                       };
+
+                       pwm1_pins: mux-pwm1 {
+                               groups = "pwm1";
+                               function = "pwm1";
+                       };
+
+                       pwm2_pins: mux-pwm2 {
+                               groups = "pwm2";
+                               function = "pwm2";
+                       };
+
+                       pwm3_pins: mux-pwm3 {
+                               groups = "pwm3";
+                               function = "pwm3";
+                       };
+
+                       pwm4_pins: mux-pwm4 {
+                               groups = "pwm4";
+                               function = "pwm4";
+                       };
+
+                       pwm5_pins: mux-pwm5 {
+                               groups = "pwm5";
+                               function = "pwm5";
+                       };
+
+                       pwm6_pins: mux-pwm6 {
+                               groups = "pwm6";
+                               function = "pwm6";
+                       };
+
+                       pwm7_pins: mux-pwm7 {
+                               groups = "pwm7";
+                               function = "pwm7";
+                       };
+
+                       hg0_pins: mux-hg0 {
+                               groups = "hg0";
+                               function = "hg0";
+                       };
+
+                       hg1_pins: mux-hg1 {
+                               groups = "hg1";
+                               function = "hg1";
+                       };
+
+                       hg2_pins: mux-hg2 {
+                               groups = "hg2";
+                               function = "hg2";
+                       };
+
+                       hg3_pins: mux-hg3 {
+                               groups = "hg3";
+                               function = "hg3";
+                       };
+
+                       hg4_pins: mux-hg4 {
+                               groups = "hg4";
+                               function = "hg4";
+                       };
+
+                       hg5_pins: mux-hg5 {
+                               groups = "hg5";
+                               function = "hg5";
+                       };
+
+                       hg6_pins: mux-hg6 {
+                               groups = "hg6";
+                               function = "hg6";
+                       };
+
+                       hg7_pins: mux-hg7 {
+                               groups = "hg7";
+                               function = "hg7";
+                       };
+               };
        };
 };
index 31f59de..7af4136 100644 (file)
@@ -28,7 +28,7 @@ partitions {
                label = "rofs";
        };
 
-       rwfs@6000000 {
+       rwfs@2a00000 {
                reg = <0x2a00000 0x1600000>; // 22MB
                label = "rwfs";
        };
index 6c26524..b47e140 100644 (file)
@@ -20,7 +20,7 @@ partitions {
                label = "kernel";
        };
 
-       rofs@c0000 {
+       rofs@4c0000 {
                reg = <0x4c0000 0x1740000>;
                label = "rofs";
        };
index 7e2fcb2..c59e06f 100644 (file)
        };
 };
 
+&etha {
+       status = "okay";
+};
+
 &uart1 {
        status = "okay";
 
index 0755e58..96c0745 100644 (file)
                ranges;
                interrupt-parent = <&intc>;
 
+               etha: ethernet@40400000 {
+                       compatible = "oxsemi,ox810se-dwmac", "snps,dwmac";
+                       reg = <0x40400000 0x2000>;
+                       interrupts = <8>;
+                       interrupt-names = "macirq";
+                       mac-address = [000000000000]; /* Filled in by U-Boot */
+                       phy-mode = "rgmii";
+
+                       clocks = <&stdclk 6>, <&gmacclk>;
+                       clock-names = "gmac", "stmmaceth";
+                       resets = <&reset 6>;
+
+                       /* Regmap for sys registers */
+                       oxsemi,sys-ctrl = <&sys>;
+
+                       status = "disabled";
+               };
+
                apb-bridge@44000000 {
                        #address-cells = <1>;
                        #size-cells = <1>;
index f350c4e..2b7e52f 100644 (file)
 
        aliases {
                serial0 = &blsp1_uart3;
+               serial1 = &blsp1_uart4;
        };
 
        chosen {
                stdout-path = "serial0:115200n8";
        };
+
+       vreg_wlan: wlan-regulator {
+               compatible = "regulator-fixed";
+
+               regulator-name = "wl-reg";
+               regulator-min-microvolt = <2950000>;
+               regulator-max-microvolt = <2950000>;
+
+               gpio = <&tlmm 46 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&wlan_regulator_default_state>;
+       };
+};
+
+&blsp1_i2c1 {
+       status = "okay";
+
+       fuel-gauge@55 {
+               compatible = "ti,bq27421";
+               reg = <0x55>;
+       };
 };
 
 &blsp1_i2c5 {
        status = "okay";
 };
 
+&blsp1_uart4 {
+       status = "okay";
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&blsp1_uart4_default_state>;
+
+       bluetooth {
+               compatible = "brcm,bcm43430a0-bt";
+
+               max-speed = <3000000>;
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&bluetooth_default_state>;
+
+               host-wakeup-gpios = <&tlmm 48 GPIO_ACTIVE_HIGH>;
+               device-wakeup-gpios = <&tlmm 47 GPIO_ACTIVE_HIGH>;
+               shutdown-gpios = <&tlmm 45 GPIO_ACTIVE_HIGH>;
+       };
+};
+
 &rpm_requests {
        pm8226-regulators {
                compatible = "qcom,rpm-pm8226-regulators";
 
-               pm8226_s1: s1 {
-                       regulator-min-microvolt = <500000>;
-                       regulator-max-microvolt = <1275000>;
-               };
                pm8226_s3: s3 {
                        regulator-min-microvolt = <1200000>;
                        regulator-max-microvolt = <1350000>;
 
        bus-width = <8>;
        non-removable;
+};
 
-       pinctrl-names = "default";
-       pinctrl-0 = <&sdhc1_pin_a>;
+&sdhc_3 {
+       status = "okay";
+
+       max-frequency = <100000000>;
+       non-removable;
+
+       vmmc-supply = <&vreg_wlan>;
+       vqmmc-supply = <&pm8226_l6>;
+
+       #address-cells = <1>;
+       #size-cells = <0>;
+
+       wifi@1 {
+               compatible = "brcm,bcm43430a0-fmac", "brcm,bcm4329-fmac";
+               reg = <1>;
+
+               interrupts-extended = <&tlmm 37 IRQ_TYPE_EDGE_FALLING>;
+               interrupt-names = "host-wake";
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&wlan_hostwake_default_state>;
+       };
+};
+
+&smbb {
+       qcom,fast-charge-safe-current = <450000>;
+       qcom,fast-charge-current-limit = <400000>;
+       qcom,fast-charge-safe-voltage = <4350000>;
+       qcom,fast-charge-high-threshold-voltage = <4350000>;
+       qcom,auto-recharge-threshold-voltage = <4240000>;
+       qcom,minimum-input-voltage = <4450000>;
 };
 
 &tlmm {
-       sdhc1_pin_a: sdhc1-pin-active {
-               clk {
-                       pins = "sdc1_clk";
-                       drive-strength = <10>;
-                       bias-disable;
-               };
+       blsp1_uart4_default_state: blsp1-uart4-default-state {
+               pins = "gpio12", "gpio13", "gpio14", "gpio15";
+               function = "blsp_uart4";
+               drive-strength = <8>;
+               bias-disable;
+       };
 
-               cmd-data {
-                       pins = "sdc1_cmd", "sdc1_data";
-                       drive-strength = <10>;
-                       bias-pull-up;
-               };
+       bluetooth_default_state: bluetooth-default-state {
+               pins = "gpio47", "gpio48";
+               function = "gpio";
+               drive-strength = <2>;
+               bias-disable;
+               input-enable;
        };
 
        touch_pins: touch {
                        output-high;
                };
        };
+
+       wlan_hostwake_default_state: wlan-hostwake-default-state {
+               pins = "gpio37";
+               function = "gpio";
+               drive-strength = <2>;
+               bias-disable;
+               input-enable;
+       };
+
+       wlan_regulator_default_state: wlan-regulator-default-state {
+               pins = "gpio46";
+               function = "gpio";
+               drive-strength = <2>;
+               bias-pull-up;
+       };
+};
+
+&usb {
+       status = "okay";
+       extcon = <&smbb>;
+       dr_mode = "peripheral";
+};
+
+&usb_hs_phy {
+       extcon = <&smbb>;
+       v1p8-supply = <&pm8226_l10>;
+       v3p3-supply = <&pm8226_l20>;
 };
index d664ccd..138d647 100644 (file)
@@ -83,7 +83,7 @@
 
        soc {
                pinctrl@800000 {
-                       /* eMMMC pins, all 8 data lines connected */
+                       /* eMMC pins, all 8 data lines connected */
                        dragon_sdcc1_pins: sdcc1 {
                                mux {
                                        pins = "gpio159", "gpio160", "gpio161",
                                        bias-pull-down;
                                };
 
-                               /* LVS0 thru 3 and mvs0 are just switches */
+                               /* LVS0 thru 3 and mvs are just switches */
                                lvs0 {
                                        regulator-always-on;
                                };
                                lvs1 { };
                                lvs2 { };
                                lvs3 { };
-                               mvs0 {};
+                               mvs { };
 
                        };
 
index 9a83533..ca9f735 100644 (file)
                        };
                };
 
-               dsi0: mdss_dsi@4700000 {
+               dsi0: dsi@4700000 {
                        status = "okay";
                        vdda-supply = <&pm8921_l2>;/*VDD_MIPI1 to 4*/
                        vdd-supply = <&pm8921_l8>;
                        vddio-supply = <&pm8921_lvs7>;
                        avdd-supply = <&pm8921_l11>;
-                       vcss-supply = <&ext_3p3v>;
 
                        panel@0 {
                                reg = <0>;
index 4d562c9..a1c8ae5 100644 (file)
                        nvmem-cells = <&tsens_calib>, <&tsens_backup>;
                        nvmem-cell-names = "calib", "calib_backup";
                        #clock-cells = <1>;
+                       #power-domain-cells = <1>;
                        #reset-cells = <1>;
                        #thermal-sensor-cells = <1>;
                };
                        compatible = "qcom,mmcc-apq8064";
                        reg = <0x4000000 0x1000>;
                        #clock-cells = <1>;
+                       #power-domain-cells = <1>;
                        #reset-cells = <1>;
                };
 
                l2cc: clock-controller@2011000 {
-                       compatible      = "syscon";
+                       compatible      = "qcom,kpss-gcc", "syscon";
                        reg             = <0x2011000 0x1000>;
                };
 
                        reg = <0x5700000 0x70>;
                };
 
-               dsi0: mdss_dsi@4700000 {
+               dsi0: dsi@4700000 {
                        compatible = "qcom,mdss-dsi-ctrl";
                        label = "MDSS DSI CTRL->0";
                        #address-cells = <1>;
                                                <&dsi0_phy 1>;
                        syscon-sfpb = <&mmss_sfpb>;
                        phys = <&dsi0_phy>;
+                       phy-names = "dsi";
                        ports {
                                #address-cells = <1>;
                                #size-cells = <0>;
 
                pcie: pci@1b500000 {
                        compatible = "qcom,pcie-apq8064", "snps,dw-pcie";
-                       reg = <0x1b500000 0x1000
-                              0x1b502000 0x80
-                              0x1b600000 0x100
-                              0x0ff00000 0x100000>;
+                       reg = <0x1b500000 0x1000>,
+                             <0x1b502000 0x80>,
+                             <0x1b600000 0x100>,
+                             <0x0ff00000 0x100000>;
                        reg-names = "dbi", "elbi", "parf", "config";
                        device_type = "pci";
                        linux,pci-domain = <0>;
                        num-lanes = <1>;
                        #address-cells = <3>;
                        #size-cells = <2>;
-                       ranges = <0x81000000 0 0 0x0fe00000 0 0x00100000   /* I/O */
-                                 0x82000000 0 0x08000000 0x08000000 0 0x07e00000>; /* memory */
+                       ranges = <0x81000000 0 0          0x0fe00000 0 0x00100000>, /* I/O */
+                                <0x82000000 0 0x08000000 0x08000000 0 0x07e00000>; /* mem */
                        interrupts = <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "msi";
                        #interrupt-cells = <1>;
index 7dec055..a9d0566 100644 (file)
        clocks {
                sleep_clk: sleep_clk {
                        compatible = "fixed-clock";
-                       clock-frequency = <32768>;
+                       clock-frequency = <32000>;
+                       clock-output-names = "gcc_sleep_clk_src";
                        #clock-cells = <0>;
                };
 
                gcc: clock-controller@1800000 {
                        compatible = "qcom,gcc-ipq4019";
                        #clock-cells = <1>;
+                       #power-domain-cells = <1>;
                        #reset-cells = <1>;
                        reg = <0x1800000 0x60000>;
                };
index c32415f..4d4f37c 100644 (file)
                gcc: clock-controller@900000 {
                        compatible = "qcom,gcc-mdm9615";
                        #clock-cells = <1>;
+                       #power-domain-cells = <1>;
                        #reset-cells = <1>;
                        reg = <0x900000 0x4000>;
                };
                };
 
                l2cc: clock-controller@2011000 {
-                       compatible = "syscon";
+                       compatible = "qcom,kpss-gcc", "syscon";
                        reg = <0x02011000 0x1000>;
                };
 
index 7d48599..85e5699 100644 (file)
@@ -8,6 +8,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/clock/qcom,gcc-msm8974.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/reset/qcom,gcc-msm8974.h>
 
 / {
        #address-cells = <1>;
                        rpm_requests: rpm-requests {
                                compatible = "qcom,rpm-msm8226";
                                qcom,smd-channels = "rpm_requests";
+
+                               rpmpd: power-controller {
+                                       compatible = "qcom,msm8226-rpmpd";
+                                       #power-domain-cells = <1>;
+                                       operating-points-v2 = <&rpmpd_opp_table>;
+
+                                       rpmpd_opp_table: opp-table {
+                                               compatible = "operating-points-v2";
+
+                                               rpmpd_opp_ret: opp1 {
+                                                       opp-level = <1>;
+                                               };
+                                               rpmpd_opp_svs_krait: opp2 {
+                                                       opp-level = <2>;
+                                               };
+                                               rpmpd_opp_svs_soc: opp3 {
+                                                       opp-level = <3>;
+                                               };
+                                               rpmpd_opp_nom: opp4 {
+                                                       opp-level = <4>;
+                                               };
+                                               rpmpd_opp_turbo: opp5 {
+                                                       opp-level = <5>;
+                                               };
+                                               rpmpd_opp_super_turbo: opp6 {
+                                                       opp-level = <6>;
+                                               };
+                                       };
+                               };
                        };
                };
        };
                                 <&gcc GCC_SDCC1_AHB_CLK>,
                                 <&xo_board>;
                        clock-names = "core", "iface", "xo";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&sdhc1_default_state>;
                        status = "disabled";
                };
 
                                 <&gcc GCC_SDCC2_AHB_CLK>,
                                 <&xo_board>;
                        clock-names = "core", "iface", "xo";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&sdhc2_default_state>;
                        status = "disabled";
                };
 
                                 <&gcc GCC_SDCC3_AHB_CLK>,
                                 <&xo_board>;
                        clock-names = "core", "iface", "xo";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&sdhc3_default_state>;
                        status = "disabled";
                };
 
                        #size-cells = <0>;
                };
 
+               usb: usb@f9a55000 {
+                       compatible = "qcom,ci-hdrc";
+                       reg = <0xf9a55000 0x200>,
+                             <0xf9a55200 0x200>;
+                       interrupts = <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&gcc GCC_USB_HS_AHB_CLK>,
+                                <&gcc GCC_USB_HS_SYSTEM_CLK>;
+                       clock-names = "iface", "core";
+                       assigned-clocks = <&gcc GCC_USB_HS_SYSTEM_CLK>;
+                       assigned-clock-rates = <75000000>;
+                       resets = <&gcc GCC_USB_HS_BCR>;
+                       reset-names = "core";
+                       phy_type = "ulpi";
+                       dr_mode = "otg";
+                       hnp-disable;
+                       srp-disable;
+                       adp-disable;
+                       ahb-burst-config = <0>;
+                       phy-names = "usb-phy";
+                       phys = <&usb_hs_phy>;
+                       status = "disabled";
+                       #reset-cells = <1>;
+
+                       ulpi {
+                               usb_hs_phy: phy {
+                                       compatible = "qcom,usb-hs-phy-msm8226",
+                                                    "qcom,usb-hs-phy";
+                                       #phy-cells = <0>;
+                                       clocks = <&xo_board>, <&gcc GCC_USB2A_PHY_SLEEP_CLK>;
+                                       clock-names = "ref", "sleep";
+                                       resets = <&gcc GCC_USB2A_PHY_BCR>, <&usb 0>;
+                                       reset-names = "phy", "por";
+                                       qcom,init-seq = /bits/ 8 <0x0 0x44
+                                               0x1 0x68 0x2 0x24 0x3 0x13>;
+                               };
+                       };
+               };
+
                gcc: clock-controller@fc400000 {
                        compatible = "qcom,gcc-msm8226";
                        reg = <0xfc400000 0x4000>;
                                drive-strength = <2>;
                                bias-disable;
                        };
+
+                       sdhc1_default_state: sdhc1-default-state {
+                               clk {
+                                       pins = "sdc1_clk";
+                                       drive-strength = <10>;
+                                       bias-disable;
+                               };
+
+                               cmd-data {
+                                       pins = "sdc1_cmd", "sdc1_data";
+                                       drive-strength = <10>;
+                                       bias-pull-up;
+                               };
+                       };
+
+                       sdhc2_default_state: sdhc2-default-state {
+                               clk {
+                                       pins = "sdc2_clk";
+                                       drive-strength = <10>;
+                                       bias-disable;
+                               };
+
+                               cmd-data {
+                                       pins = "sdc2_cmd", "sdc2_data";
+                                       drive-strength = <10>;
+                                       bias-pull-up;
+                               };
+                       };
+
+                       sdhc3_default_state: sdhc3-default-state {
+                               clk {
+                                       pins = "gpio44";
+                                       function = "sdc3";
+                                       drive-strength = <8>;
+                                       bias-disable;
+                               };
+
+                               cmd {
+                                       pins = "gpio43";
+                                       function = "sdc3";
+                                       drive-strength = <8>;
+                                       bias-pull-up;
+                               };
+
+                               data {
+                                       pins = "gpio39", "gpio40", "gpio41", "gpio42";
+                                       function = "sdc3";
+                                       drive-strength = <8>;
+                                       bias-pull-up;
+                               };
+                       };
                };
 
                restart@fc4ab000 {
index 1e8aab3..a258abb 100644 (file)
                gcc: clock-controller@900000 {
                        compatible = "qcom,gcc-msm8660";
                        #clock-cells = <1>;
+                       #power-domain-cells = <1>;
                        #reset-cells = <1>;
                        reg = <0x900000 0x4000>;
                };
                };
 
                l2cc: clock-controller@2082000 {
-                       compatible      = "syscon";
+                       compatible      = "qcom,kpss-gcc", "syscon";
                        reg             = <0x02082000 0x1000>;
                };
 
index 4af0103..d1fd0fe 100644 (file)
                        pinctrl-0 = <&spi1_default>;
                        spi@16080000 {
                                status = "okay";
-                               eth@0 {
+                               ethernet@0 {
                                        compatible = "micrel,ks8851";
                                        reg = <0>;
                                        interrupt-parent = <&msmgpio>;
index 2a0ec97..4a2d74c 100644 (file)
                };
        };
 
+       /* Temporary fixed regulator */
+       vsdcc_fixed: vsdcc-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "SDCC Power";
+               regulator-min-microvolt = <2700000>;
+               regulator-max-microvolt = <2700000>;
+               regulator-always-on;
+       };
+
        soc: soc {
                #address-cells = <1>;
                #size-cells = <1>;
                gcc: clock-controller@900000 {
                        compatible = "qcom,gcc-msm8960";
                        #clock-cells = <1>;
+                       #power-domain-cells = <1>;
                        #reset-cells = <1>;
                        reg = <0x900000 0x4000>;
                };
                        compatible = "qcom,mmcc-msm8960";
                        reg = <0x4000000 0x1000>;
                        #clock-cells = <1>;
+                       #power-domain-cells = <1>;
                        #reset-cells = <1>;
                };
 
                l2cc: clock-controller@2011000 {
-                       compatible      = "syscon";
+                       compatible      = "qcom,kpss-gcc", "syscon";
                        reg             = <0x2011000 0x1000>;
                };
 
                        reg             = <0x108000 0x1000>;
                        qcom,ipc        = <&l2cc 0x8 2>;
 
-                       interrupts      = <0 19 0>, <0 21 0>, <0 22 0>;
+                       interrupts      = <GIC_SPI 19 IRQ_TYPE_EDGE_RISING>,
+                                         <GIC_SPI 21 IRQ_TYPE_EDGE_RISING>,
+                                         <GIC_SPI 22 IRQ_TYPE_EDGE_RISING>;
                        interrupt-names = "ack", "err", "wakeup";
 
                        regulators {
                                compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
                                reg = <0x16440000 0x1000>,
                                      <0x16400000 0x1000>;
-                               interrupts = <0 154 0x0>;
+                               interrupts = <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>;
                                clocks = <&gcc GSBI5_UART_CLK>, <&gcc GSBI5_H_CLK>;
                                clock-names = "core", "iface";
                                status = "disabled";
                        clock-names = "core";
                };
 
-               /* Temporary fixed regulator */
-               vsdcc_fixed: vsdcc-regulator {
-                       compatible = "regulator-fixed";
-                       regulator-name = "SDCC Power";
-                       regulator-min-microvolt = <2700000>;
-                       regulator-max-microvolt = <2700000>;
-                       regulator-always-on;
-               };
-
                amba {
                        compatible = "simple-bus";
                        #address-cells = <1>;
                                #address-cells = <1>;
                                #size-cells = <0>;
                                reg = <0x16080000 0x1000>;
-                               interrupts = <0 147 0>;
+                               interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>;
                                spi-max-frequency = <24000000>;
                                cs-gpios = <&msmgpio 8 0>;
 
index dddb515..b3d0f7b 100644 (file)
                        debounce = <15625>;
                        bias-pull-up;
                };
+
+               smbb: charger@1000 {
+                       compatible = "qcom,pm8226-charger";
+                       reg = <0x1000>;
+                       interrupts = <0x0 0x10 7 IRQ_TYPE_EDGE_BOTH>,
+                                    <0x0 0x10 5 IRQ_TYPE_EDGE_BOTH>,
+                                    <0x0 0x10 4 IRQ_TYPE_EDGE_BOTH>,
+                                    <0x0 0x12 1 IRQ_TYPE_EDGE_BOTH>,
+                                    <0x0 0x12 0 IRQ_TYPE_EDGE_BOTH>,
+                                    <0x0 0x13 2 IRQ_TYPE_EDGE_BOTH>,
+                                    <0x0 0x13 1 IRQ_TYPE_EDGE_BOTH>,
+                                    <0x0 0x14 1 IRQ_TYPE_EDGE_BOTH>;
+                       interrupt-names = "chg-done",
+                                         "chg-fast",
+                                         "chg-trkl",
+                                         "bat-temp-ok",
+                                         "bat-present",
+                                         "chg-gone",
+                                         "usb-valid",
+                                         "dc-valid";
+
+                       chg_otg: otg-vbus { };
+               };
+
+               pm8226_mpps: mpps@a000 {
+                       compatible = "qcom,pm8226-mpp", "qcom,spmi-mpp";
+                       reg = <0xa000>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       gpio-ranges = <&pm8226_mpps 0 0 8>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
        };
 
        pm8226_1: pm8226@1 {
                reg = <0x1 SPMI_USID>;
                #address-cells = <1>;
                #size-cells = <0>;
+
+               pm8226_spmi_regulators: pm8226-regulators {
+                       compatible = "qcom,pm8226-regulators";
+               };
+
+               pm8226_vib: vibrator@c000 {
+                       compatible = "qcom,pm8916-vib";
+                       reg = <0xc000>;
+                       status = "disabled";
+               };
        };
 };
index 8ac0492..d455795 100644 (file)
                              <0x40000000 0xf1d>,
                              <0x40000f20 0xc8>,
                              <0x40001000 0x1000>,
-                             <0x40002000 0x10000>,
+                             <0x40200000 0x100000>,
                              <0x01c03000 0x3000>;
                        reg-names = "parf", "dbi", "elbi", "atu", "addr_space",
                                    "mmio";
                        reg = <0x0c264000 0x1000>;
                };
 
-               spmi_bus: qcom,spmi@c440000 {
+               spmi_bus: spmi@c440000 {
                        compatible = "qcom,spmi-pmic-arb";
                        reg = <0x0c440000 0x0000d00>,
                              <0x0c600000 0x2000000>,
index a01f3de..0af63dd 100644 (file)
                function = "lcd0";
        };
 
-       lcd0_mux {
+       lcd0-mux-hog {
                /* DBGMD/LCDC0/FSIA MUX */
                gpio-hog;
                gpios = <176 0>;
index 3c8a7c8..4e58c54 100644 (file)
 
 &gpio0 {
        /* Disable hogging GP0_18 to output LOW */
-       /delete-node/ qspi_en;
+       /delete-node/ qspi-en-hog;
 
        /* Hog GP0_18 to output HIGH to enable VIN2 */
-       vin2_en {
+       vin2-en-hog {
                gpio-hog;
                gpios = <18 GPIO_ACTIVE_HIGH>;
                output-high;
index a5a79cd..64102b6 100644 (file)
 };
 
 &gpio0 {
-       touch-interrupt {
+       touch-interrupt-hog {
                gpio-hog;
                gpios = <24 GPIO_ACTIVE_LOW>;
                input;
 };
 
 &gpio1 {
-       can-trx-en-gpio{
+       can-trx-en-hog {
                gpio-hog;
                gpios = <28 GPIO_ACTIVE_HIGH>;
                output-low;
index 5621c9e..b281a4d 100644 (file)
@@ -37,7 +37,7 @@
 
 &gpio0 {
        /* GP0_18 set low to select QSPI. Doing so will disable VIN2 */
-       qspi_en {
+       qspi-en-hog {
                gpio-hog;
                gpios = <18 GPIO_ACTIVE_HIGH>;
                output-low;
index b024621..6448022 100644 (file)
 };
 
 &gpio2 {
-       interrupt-fixup {
+       interrupt-fixup-hog {
                gpio-hog;
                gpios = <29 GPIO_ACTIVE_HIGH>;
                line-name = "hdmi-hpd-int";
index 4e57ae2..3f8f3ce 100644 (file)
@@ -26,3 +26,8 @@
 &uart0 {
        status = "okay";
 };
+
+&wdt0 {
+       timeout-sec = <60>;
+       status = "okay";
+};
index c47896e..636a6ab 100644 (file)
                interrupt-parent = <&gic>;
                ranges;
 
+               wdt0: watchdog@40008000 {
+                       compatible = "renesas,r9a06g032-wdt", "renesas,rzn1-wdt";
+                       reg = <0x40008000 0x1000>;
+                       interrupts = <GIC_SPI 73 IRQ_TYPE_EDGE_RISING>;
+                       clocks = <&sysctrl R9A06G032_CLK_WATCHDOG>;
+                       status = "disabled";
+               };
+
+               wdt1: watchdog@40009000 {
+                       compatible = "renesas,r9a06g032-wdt", "renesas,rzn1-wdt";
+                       reg = <0x40009000 0x1000>;
+                       interrupts = <GIC_SPI 74 IRQ_TYPE_EDGE_RISING>;
+                       clocks = <&sysctrl R9A06G032_CLK_WATCHDOG>;
+                       status = "disabled";
+               };
+
                sysctrl: system-controller@4000c000 {
                        compatible = "renesas,r9a06g032-sysctrl";
                        reg = <0x4000c000 0x1000>;
                        status = "okay";
                };
 
+               nand_controller: nand-controller@40102000 {
+                       compatible = "renesas,r9a06g032-nandc", "renesas,rzn1-nandc";
+                       reg = <0x40102000 0x2000>;
+                       interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&sysctrl R9A06G032_HCLK_NAND>, <&sysctrl R9A06G032_CLK_NAND>;
+                       clock-names = "hclk", "eclk";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+               };
+
                gic: interrupt-controller@44101000 {
                        compatible = "arm,gic-400", "arm,cortex-a7-gic";
                        interrupt-controller;
index aaaa618..85d56c6 100644 (file)
                clock-names = "aclk", "hclk", "sclk", "apb_pclk";
                resets = <&cru SRST_CRYPTO>;
                reset-names = "crypto-rst";
-               status = "okay";
        };
 
        iep_mmu: iommu@ff900800 {
index 92439ee..20a7d72 100644 (file)
         * Pin banks
         */
 
-       gpa: gpa {
+       gpa: gpa-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpb: gpb {
+       gpb: gpb-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpc: gpc {
+       gpc: gpc-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpd: gpd {
+       gpd: gpd-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpe: gpe {
+       gpe: gpe-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpf: gpf {
+       gpf: gpf-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
                interrupt-controller;
                #interrupt-cells = <2>;
        };
 
-       gpg: gpg {
+       gpg: gpg-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
                interrupt-controller;
                #interrupt-cells = <2>;
        };
 
-       gph: gph {
+       gph: gph-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpj: gpj {
+       gpj: gpj-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpk: gpk {
+       gpk: gpk-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpl: gpl {
+       gpl: gpl-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpm: gpm {
+       gpm: gpm-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
         * Pin groups
         */
 
-       uart0_data: uart0-data {
+       uart0_data: uart0-data-pins {
                samsung,pins = "gph-0", "gph-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
        };
 
-       uart0_fctl: uart0-fctl {
+       uart0_fctl: uart0-fctl-pins {
                samsung,pins = "gph-8", "gph-9";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
        };
 
-       uart1_data: uart1-data {
+       uart1_data: uart1-data-pins {
                samsung,pins = "gph-2", "gph-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
        };
 
-       uart1_fctl: uart1-fctl {
+       uart1_fctl: uart1-fctl-pins {
                samsung,pins = "gph-10", "gph-11";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
        };
 
-       uart2_data: uart2-data {
+       uart2_data: uart2-data-pins {
                samsung,pins = "gph-4", "gph-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
        };
 
-       uart2_fctl: uart2-fctl {
+       uart2_fctl: uart2-fctl-pins {
                samsung,pins = "gph-6", "gph-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
        };
 
-       uart3_data: uart3-data {
+       uart3_data: uart3-data-pins {
                samsung,pins = "gph-6", "gph-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
        };
 
-       extuart_clk: extuart-clk {
+       extuart_clk: extuart-clk-pins {
                samsung,pins = "gph-12";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
        };
 
-       i2c0_bus: i2c0-bus {
+       i2c0_bus: i2c0-bus-pins {
                samsung,pins = "gpe-14", "gpe-15";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
        };
 
-       spi0_bus: spi0-bus {
+       spi0_bus: spi0-bus-pins {
                samsung,pins = "gpe-11", "gpe-12", "gpe-13";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
        };
 
-       sd0_clk: sd0-clk {
+       sd0_clk: sd0-clk-pins {
                samsung,pins = "gpe-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
        };
 
-       sd0_cmd: sd0-cmd {
+       sd0_cmd: sd0-cmd-pins {
                samsung,pins = "gpe-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
        };
 
-       sd0_bus1: sd0-bus1 {
+       sd0_bus1: sd0-bus1-pins {
                samsung,pins = "gpe-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
        };
 
-       sd0_bus4: sd0-bus4 {
+       sd0_bus4: sd0-bus4-pins {
                samsung,pins = "gpe-8", "gpe-9", "gpe-10";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
        };
 
-       sd1_cmd: sd1-cmd {
+       sd1_cmd: sd1-cmd-pins {
                samsung,pins = "gpl-8";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
        };
 
-       sd1_clk: sd1-clk {
+       sd1_clk: sd1-clk-pins {
                samsung,pins = "gpl-9";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
        };
 
-       sd1_bus1: sd1-bus1 {
+       sd1_bus1: sd1-bus1-pins {
                samsung,pins = "gpl-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
        };
 
-       sd1_bus4: sd1-bus4 {
+       sd1_bus4: sd1-bus4-pins {
                samsung,pins = "gpl-1", "gpl-2", "gpl-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
        };
index 285555b..17097da 100644 (file)
 };
 
 &pinctrl0 {
-       gpio_leds: gpio-leds {
+       gpio_leds: gpio-leds-pins {
                samsung,pins = "gpk-4", "gpk-5", "gpk-6", "gpk-7";
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       gpio_keys: gpio-keys {
+       gpio_keys: gpio-keys-pins {
                samsung,pins = "gpn-0", "gpn-1", "gpn-2", "gpn-3",
                                "gpn-4", "gpn-5", "gpl-11", "gpl-12";
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
index 8e9594d..0a3186d 100644 (file)
         * Pin banks
         */
 
-       gpa: gpa {
+       gpa: gpa-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
                interrupt-controller;
                #interrupt-cells = <2>;
        };
 
-       gpb: gpb {
+       gpb: gpb-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
                interrupt-controller;
                #interrupt-cells = <2>;
        };
 
-       gpc: gpc {
+       gpc: gpc-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
                interrupt-controller;
                #interrupt-cells = <2>;
        };
 
-       gpd: gpd {
+       gpd: gpd-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
                interrupt-controller;
                #interrupt-cells = <2>;
        };
 
-       gpe: gpe {
+       gpe: gpe-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpf: gpf {
+       gpf: gpf-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
                interrupt-controller;
                #interrupt-cells = <2>;
        };
 
-       gpg: gpg {
+       gpg: gpg-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
                interrupt-controller;
                #interrupt-cells = <2>;
        };
 
-       gph: gph {
+       gph: gph-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
                interrupt-controller;
                #interrupt-cells = <2>;
        };
 
-       gpi: gpi {
+       gpi: gpi-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpj: gpj {
+       gpj: gpj-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpk: gpk {
+       gpk: gpk-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gpl: gpl {
+       gpl: gpl-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
                interrupt-controller;
                #interrupt-cells = <2>;
        };
 
-       gpm: gpm {
+       gpm: gpm-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
                interrupt-controller;
                #interrupt-cells = <2>;
        };
 
-       gpn: gpn {
+       gpn: gpn-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
                interrupt-controller;
                #interrupt-cells = <2>;
        };
 
-       gpo: gpo {
+       gpo: gpo-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
                interrupt-controller;
                #interrupt-cells = <2>;
        };
 
-       gpp: gpp {
+       gpp: gpp-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
                interrupt-controller;
                #interrupt-cells = <2>;
        };
 
-       gpq: gpq {
+       gpq: gpq-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
                interrupt-controller;
         * Pin groups
         */
 
-       uart0_data: uart0-data {
+       uart0_data: uart0-data-pins {
                samsung,pins = "gpa-0", "gpa-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       uart0_fctl: uart0-fctl {
+       uart0_fctl: uart0-fctl-pins {
                samsung,pins = "gpa-2", "gpa-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       uart1_data: uart1-data {
+       uart1_data: uart1-data-pins {
                samsung,pins = "gpa-4", "gpa-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       uart1_fctl: uart1-fctl {
+       uart1_fctl: uart1-fctl-pins {
                samsung,pins = "gpa-6", "gpa-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       uart2_data: uart2-data {
+       uart2_data: uart2-data-pins {
                samsung,pins = "gpb-0", "gpb-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       uart3_data: uart3-data {
+       uart3_data: uart3-data-pins {
                samsung,pins = "gpb-2", "gpb-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       ext_dma_0: ext-dma-0 {
+       ext_dma_0: ext-dma-0-pins {
                samsung,pins = "gpb-0", "gpb-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       ext_dma_1: ext-dma-1 {
+       ext_dma_1: ext-dma-1-pins {
                samsung,pins = "gpb-2", "gpb-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       irda_data_0: irda-data-0 {
+       irda_data_0: irda-data-0-pins {
                samsung,pins = "gpb-0", "gpb-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       irda_data_1: irda-data-1 {
+       irda_data_1: irda-data-1-pins {
                samsung,pins = "gpb-2", "gpb-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       irda_sdbw: irda-sdbw {
+       irda_sdbw: irda-sdbw-pins {
                samsung,pins = "gpb-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       i2c0_bus: i2c0-bus {
+       i2c0_bus: i2c0-bus-pins {
                samsung,pins = "gpb-5", "gpb-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
        };
 
-       i2c1_bus: i2c1-bus {
+       i2c1_bus: i2c1-bus-pins {
                /* S3C6410-only */
                samsung,pins = "gpb-2", "gpb-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_6>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
        };
 
-       spi0_bus: spi0-bus {
+       spi0_bus: spi0-bus-pins {
                samsung,pins = "gpc-0", "gpc-1", "gpc-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
        };
 
-       spi0_cs: spi0-cs {
+       spi0_cs: spi0-cs-pins {
                samsung,pins = "gpc-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       spi1_bus: spi1-bus {
+       spi1_bus: spi1-bus-pins {
                samsung,pins = "gpc-4", "gpc-5", "gpc-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
        };
 
-       spi1_cs: spi1-cs {
+       spi1_cs: spi1-cs-pins {
                samsung,pins = "gpc-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       sd0_cmd: sd0-cmd {
+       sd0_cmd: sd0-cmd-pins {
                samsung,pins = "gpg-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       sd0_clk: sd0-clk {
+       sd0_clk: sd0-clk-pins {
                samsung,pins = "gpg-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       sd0_bus1: sd0-bus1 {
+       sd0_bus1: sd0-bus1-pins {
                samsung,pins = "gpg-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       sd0_bus4: sd0-bus4 {
+       sd0_bus4: sd0-bus4-pins {
                samsung,pins = "gpg-2", "gpg-3", "gpg-4", "gpg-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       sd0_cd: sd0-cd {
+       sd0_cd: sd0-cd-pins {
                samsung,pins = "gpg-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
        };
 
-       sd1_cmd: sd1-cmd {
+       sd1_cmd: sd1-cmd-pins {
                samsung,pins = "gph-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       sd1_clk: sd1-clk {
+       sd1_clk: sd1-clk-pins {
                samsung,pins = "gph-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       sd1_bus1: sd1-bus1 {
+       sd1_bus1: sd1-bus1-pins {
                samsung,pins = "gph-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       sd1_bus4: sd1-bus4 {
+       sd1_bus4: sd1-bus4-pins {
                samsung,pins = "gph-2", "gph-3", "gph-4", "gph-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       sd1_bus8: sd1-bus8 {
+       sd1_bus8: sd1-bus8-pins {
                samsung,pins = "gph-2", "gph-3", "gph-4", "gph-5",
                                "gph-6", "gph-7", "gph-8", "gph-9";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       sd1_cd: sd1-cd {
+       sd1_cd: sd1-cd-pins {
                samsung,pins = "gpg-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
        };
 
-       sd2_cmd: sd2-cmd {
+       sd2_cmd: sd2-cmd-pins {
                samsung,pins = "gpc-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       sd2_clk: sd2-clk {
+       sd2_clk: sd2-clk-pins {
                samsung,pins = "gpc-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       sd2_bus1: sd2-bus1 {
+       sd2_bus1: sd2-bus1-pins {
                samsung,pins = "gph-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       sd2_bus4: sd2-bus4 {
+       sd2_bus4: sd2-bus4-pins {
                samsung,pins = "gph-6", "gph-7", "gph-8", "gph-9";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       i2s0_bus: i2s0-bus {
+       i2s0_bus: i2s0-bus-pins {
                samsung,pins = "gpd-0", "gpd-2", "gpd-3", "gpd-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       i2s0_cdclk: i2s0-cdclk {
+       i2s0_cdclk: i2s0-cdclk-pins {
                samsung,pins = "gpd-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       i2s1_bus: i2s1-bus {
+       i2s1_bus: i2s1-bus-pins {
                samsung,pins = "gpe-0", "gpe-2", "gpe-3", "gpe-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       i2s1_cdclk: i2s1-cdclk {
+       i2s1_cdclk: i2s1-cdclk-pins {
                samsung,pins = "gpe-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       i2s2_bus: i2s2-bus {
+       i2s2_bus: i2s2-bus-pins {
                /* S3C6410-only */
                samsung,pins = "gpc-4", "gpc-5", "gpc-6", "gph-6",
                                "gph-8", "gph-9";
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       i2s2_cdclk: i2s2-cdclk {
+       i2s2_cdclk: i2s2-cdclk-pins {
                /* S3C6410-only */
                samsung,pins = "gph-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_5>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       pcm0_bus: pcm0-bus {
+       pcm0_bus: pcm0-bus-pins {
                samsung,pins = "gpd-0", "gpd-2", "gpd-3", "gpd-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       pcm0_extclk: pcm0-extclk {
+       pcm0_extclk: pcm0-extclk-pins {
                samsung,pins = "gpd-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       pcm1_bus: pcm1-bus {
+       pcm1_bus: pcm1-bus-pins {
                samsung,pins = "gpe-0", "gpe-2", "gpe-3", "gpe-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       pcm1_extclk: pcm1-extclk {
+       pcm1_extclk: pcm1-extclk-pins {
                samsung,pins = "gpe-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       ac97_bus_0: ac97-bus-0 {
+       ac97_bus_0: ac97-bus-0-pins {
                samsung,pins = "gpd-0", "gpd-1", "gpd-2", "gpd-3", "gpd-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       ac97_bus_1: ac97-bus-1 {
+       ac97_bus_1: ac97-bus-1-pins {
                samsung,pins = "gpe-0", "gpe-1", "gpe-2", "gpe-3", "gpe-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       cam_port: cam-port {
+       cam_port: cam-port-pins {
                samsung,pins = "gpf-0", "gpf-1", "gpf-2", "gpf-4",
                                "gpf-5", "gpf-6", "gpf-7", "gpf-8",
                                "gpf-9", "gpf-10", "gpf-11", "gpf-12";
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       cam_rst: cam-rst {
+       cam_rst: cam-rst-pins {
                samsung,pins = "gpf-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       cam_field: cam-field {
+       cam_field: cam-field-pins {
                /* S3C6410-only */
                samsung,pins = "gpb-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       pwm_extclk: pwm-extclk {
+       pwm_extclk: pwm-extclk-pins {
                samsung,pins = "gpf-13";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       pwm0_out: pwm0-out {
+       pwm0_out: pwm0-out-pins {
                samsung,pins = "gpf-14";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       pwm1_out: pwm1-out {
+       pwm1_out: pwm1-out-pins {
                samsung,pins = "gpf-15";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       clkout0: clkout-0 {
+       clkout0: clkout-0-pins {
                samsung,pins = "gpf-14";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_col0_0: keypad-col0-0 {
+       keypad_col0_0: keypad-col0-0-pins {
                samsung,pins = "gph-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_col1_0: keypad-col1-0 {
+       keypad_col1_0: keypad-col1-0-pins {
                samsung,pins = "gph-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_col2_0: keypad-col2-0 {
+       keypad_col2_0: keypad-col2-0-pins {
                samsung,pins = "gph-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_col3_0: keypad-col3-0 {
+       keypad_col3_0: keypad-col3-0-pins {
                samsung,pins = "gph-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_col4_0: keypad-col4-0 {
+       keypad_col4_0: keypad-col4-0-pins {
                samsung,pins = "gph-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_col5_0: keypad-col5-0 {
+       keypad_col5_0: keypad-col5-0-pins {
                samsung,pins = "gph-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_col6_0: keypad-col6-0 {
+       keypad_col6_0: keypad-col6-0-pins {
                samsung,pins = "gph-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_col7_0: keypad-col7-0 {
+       keypad_col7_0: keypad-col7-0-pins {
                samsung,pins = "gph-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_col0_1: keypad-col0-1 {
+       keypad_col0_1: keypad-col0-1-pins {
                samsung,pins = "gpl-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_col1_1: keypad-col1-1 {
+       keypad_col1_1: keypad-col1-1-pins {
                samsung,pins = "gpl-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_col2_1: keypad-col2-1 {
+       keypad_col2_1: keypad-col2-1-pins {
                samsung,pins = "gpl-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_col3_1: keypad-col3-1 {
+       keypad_col3_1: keypad-col3-1-pins {
                samsung,pins = "gpl-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_col4_1: keypad-col4-1 {
+       keypad_col4_1: keypad-col4-1-pins {
                samsung,pins = "gpl-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_col5_1: keypad-col5-1 {
+       keypad_col5_1: keypad-col5-1-pins {
                samsung,pins = "gpl-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_col6_1: keypad-col6-1 {
+       keypad_col6_1: keypad-col6-1-pins {
                samsung,pins = "gpl-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_col7_1: keypad-col7-1 {
+       keypad_col7_1: keypad-col7-1-pins {
                samsung,pins = "gpl-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_row0_0: keypad-row0-0 {
+       keypad_row0_0: keypad-row0-0-pins {
                samsung,pins = "gpk-8";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_row1_0: keypad-row1-0 {
+       keypad_row1_0: keypad-row1-0-pins {
                samsung,pins = "gpk-9";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_row2_0: keypad-row2-0 {
+       keypad_row2_0: keypad-row2-0-pins {
                samsung,pins = "gpk-10";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_row3_0: keypad-row3-0 {
+       keypad_row3_0: keypad-row3-0-pins {
                samsung,pins = "gpk-11";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_row4_0: keypad-row4-0 {
+       keypad_row4_0: keypad-row4-0-pins {
                samsung,pins = "gpk-12";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_row5_0: keypad-row5-0 {
+       keypad_row5_0: keypad-row5-0-pins {
                samsung,pins = "gpk-13";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_row6_0: keypad-row6-0 {
+       keypad_row6_0: keypad-row6-0-pins {
                samsung,pins = "gpk-14";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_row7_0: keypad-row7-0 {
+       keypad_row7_0: keypad-row7-0-pins {
                samsung,pins = "gpk-15";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_row0_1: keypad-row0-1 {
+       keypad_row0_1: keypad-row0-1-pins {
                samsung,pins = "gpn-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_row1_1: keypad-row1-1 {
+       keypad_row1_1: keypad-row1-1-pins {
                samsung,pins = "gpn-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_row2_1: keypad-row2-1 {
+       keypad_row2_1: keypad-row2-1-pins {
                samsung,pins = "gpn-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_row3_1: keypad-row3-1 {
+       keypad_row3_1: keypad-row3-1-pins {
                samsung,pins = "gpn-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_row4_1: keypad-row4-1 {
+       keypad_row4_1: keypad-row4-1-pins {
                samsung,pins = "gpn-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_row5_1: keypad-row5-1 {
+       keypad_row5_1: keypad-row5-1-pins {
                samsung,pins = "gpn-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_row6_1: keypad-row6-1 {
+       keypad_row6_1: keypad-row6-1-pins {
                samsung,pins = "gpn-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       keypad_row7_1: keypad-row7-1 {
+       keypad_row7_1: keypad-row7-1-pins {
                samsung,pins = "gpn-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       lcd_ctrl: lcd-ctrl {
+       lcd_ctrl: lcd-ctrl-pins {
                samsung,pins = "gpj-8", "gpj-9", "gpj-10", "gpj-11";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       lcd_data16: lcd-data-width16 {
+       lcd_data16: lcd-data-width16-pins {
                samsung,pins = "gpi-3", "gpi-4", "gpi-5", "gpi-6",
                                "gpi-7", "gpi-10", "gpi-11", "gpi-12",
                                "gpi-13", "gpi-14", "gpi-15", "gpj-3",
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       lcd_data18: lcd-data-width18 {
+       lcd_data18: lcd-data-width18-pins {
                samsung,pins = "gpi-2", "gpi-3", "gpi-4", "gpi-5",
                                "gpi-6", "gpi-7", "gpi-10", "gpi-11",
                                "gpi-12", "gpi-13", "gpi-14", "gpi-15",
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       lcd_data24: lcd-data-width24 {
+       lcd_data24: lcd-data-width24-pins {
                samsung,pins = "gpi-0", "gpi-1", "gpi-2", "gpi-3",
                                "gpi-4", "gpi-5", "gpi-6", "gpi-7",
                                "gpi-8", "gpi-9", "gpi-10", "gpi-11",
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       hsi_bus: hsi-bus {
+       hsi_bus: hsi-bus-pins {
                samsung,pins = "gpk-0", "gpk-1", "gpk-2", "gpk-3",
                                "gpk-4", "gpk-5", "gpk-6", "gpk-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
index cb11a87..67a7a66 100644 (file)
                        interrupt-parent = <&vic1>;
                        interrupts = <21>;
 
-                       pctrl_int_map: pinctrl-interrupt-map {
-                               interrupt-map = <0 &vic0 0>,
-                                               <1 &vic0 1>,
-                                               <2 &vic1 0>,
-                                               <3 &vic1 1>;
-                               #address-cells = <0>;
-                               #size-cells = <0>;
-                               #interrupt-cells = <1>;
-                       };
-
                        wakeup-interrupt-controller {
                                compatible = "samsung,s3c64xx-wakeup-eint";
-                               interrupts = <0>, <1>, <2>, <3>;
-                               interrupt-parent = <&pctrl_int_map>;
+                               interrupts-extended = <&vic0 0>,
+                                                     <&vic0 1>,
+                                                     <&vic1 0>,
+                                                     <&vic1 1>;
                        };
                };
        };
index 6423348..54de3bc 100644 (file)
 };
 
 &pinctrl0 {
-       t_flash_detect: t-flash-detect {
+       t_flash_detect: t-flash-detect-pins {
                samsung,pins = "gph3-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
index 160f8cd..c8f1c32 100644 (file)
 };
 
 &pinctrl0 {
-       bt_reset: bt-reset {
+       bt_reset: bt-reset-pins {
                samsung,pins = "gpb-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       wlan_bt_en: wlan-bt-en {
+       wlan_bt_en: wlan-bt-en-pins {
                samsung,pins = "gpb-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-val = <1>;
        };
 
-       codec_ldo: codec-ldo {
+       codec_ldo: codec-ldo-pins {
                samsung,pins = "gpf3-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       wlan_gpio_rst: wlan-gpio-rst {
+       wlan_gpio_rst: wlan-gpio-rst-pins {
                samsung,pins = "gpg1-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       bt_wake: bt-wake {
+       bt_wake: bt-wake-pins {
                samsung,pins = "gpg3-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       gp2a_irq: gp2a-irq {
+       gp2a_irq: gp2a-irq-pins {
                samsung,pins = "gph0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_DOWN>;
                samsung,pin-val = <0>;
        };
 
-       pmic_irq: pmic-irq {
+       pmic_irq: pmic-irq-pins {
                samsung,pins = "gph0-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       wifi_host_wake: wifi-host-wake {
+       wifi_host_wake: wifi-host-wake-pins {
                samsung,pins = "gph2-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_DOWN>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       bt_host_wake: bt-host-wake {
+       bt_host_wake: bt-host-wake-pins {
                samsung,pins = "gph2-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_DOWN>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       musb_irq: musq-irq {
+       musb_irq: musq-irq-pins {
                samsung,pins = "gph2-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       tf_detect: tf-detect {
+       tf_detect: tf-detect-pins {
                samsung,pins = "gph3-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_DOWN>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       wifi_wake: wifi-wake {
+       wifi_wake: wifi-wake-pins {
                samsung,pins = "gph3-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       magnetometer_i2c_pins: yas529-i2c-pins {
+       magnetometer_i2c_pins: yas529-i2c-pins-pins {
                samsung,pins = "gpj0-0", "gpj0-1";
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       ts_irq: ts-irq {
+       ts_irq: ts-irq-pins {
                samsung,pins = "gpj0-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       vibrator_ena: vibrator-ena {
+       vibrator_ena: vibrator-ena-pins {
                samsung,pins = "gpj1-1";
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       gp2a_power: gp2a-power {
+       gp2a_power: gp2a-power-pins {
                samsung,pins = "gpj1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       touchkey_vdd_ena: touchkey-vdd-ena {
+       touchkey_vdd_ena: touchkey-vdd-ena-pins {
                samsung,pins = "gpj3-2";
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pmic_i2c_pins: pmic-i2c-pins {
+       pmic_i2c_pins: pmic-i2c-pins-pins {
                samsung,pins = "gpj4-0", "gpj4-3";
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       touchkey_irq: touchkey-irq {
+       touchkey_irq: touchkey-irq-pins {
                samsung,pins = "gpj4-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       panel_rst: panel-rst {
+       panel_rst: panel-rst-pins {
                samsung,pins = "mp05-5";
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
index 7427c84..dfb2ee6 100644 (file)
        pinctrl-names = "default";
        pinctrl-0 = <&sleep_cfg>;
 
-       headset_det: headset-det {
+       headset_det: headset-det-pins {
                samsung,pins = "gph0-6", "gph3-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       fg_irq: fg-irq {
+       fg_irq: fg-irq-pins {
                samsung,pins = "gph3-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       headset_micbias_ena: headset-micbias-ena {
+       headset_micbias_ena: headset-micbias-ena-pins {
                samsung,pins = "gpj2-5";
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       earpath_sel: earpath-sel {
+       earpath_sel: earpath-sel-pins {
                samsung,pins = "gpj2-6";
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       main_micbias_ena: main-micbias-ena {
+       main_micbias_ena: main-micbias-ena-pins {
                samsung,pins = "gpj4-2";
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
        /* Based on vendor kernel v2.6.35.7 */
-       sleep_cfg: sleep-cfg {
+       sleep_cfg: sleep-state {
                PIN_SLP(gpa0-0, PREV, NONE);
                PIN_SLP(gpa0-1, PREV, NONE);
                PIN_SLP(gpa0-2, PREV, NONE);
index eeec2bd..a78caaa 100644 (file)
        pinctrl-names = "default";
        pinctrl-0 = <&sleep_cfg>;
 
-       fm_i2c_pins: fm-i2c-pins {
+       fm_i2c_pins: fm-i2c-pins-pins {
                samsung,pins = "gpd1-2", "gpd1-3";
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       headset_det: headset-det {
+       headset_det: headset-det-pins {
                samsung,pins = "gph0-6", "gph3-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
-       fm_irq: fm-irq {
+       fm_irq: fm-irq-pins {
                samsung,pins = "gpj2-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       fm_rst: fm-rst {
+       fm_rst: fm-rst-pins {
                samsung,pins = "gpj2-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       earpath_sel: earpath-sel {
+       earpath_sel: earpath-sel-pins {
                samsung,pins = "gpj2-6";
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       massmemory_en: massmemory-en {
+       massmemory_en: massmemory-en-pins {
                samsung,pins = "gpj2-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       micbias_reg_ena: micbias-reg-ena {
+       micbias_reg_ena: micbias-reg-ena-pins {
                samsung,pins = "gpj4-2";
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
        /* Based on CyanogenMod 3.0.101 kernel */
-       sleep_cfg: sleep-cfg {
+       sleep_cfg: sleep-state {
                PIN_SLP(gpa0-0, PREV, NONE);
                PIN_SLP(gpa0-1, PREV, NONE);
                PIN_SLP(gpa0-2, PREV, NONE);
index b8c5172..ae34e7e 100644 (file)
@@ -26,7 +26,7 @@
        }
 
 &pinctrl0 {
-       gpa0: gpa0 {
+       gpa0: gpa0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -34,7 +34,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpa1: gpa1 {
+       gpa1: gpa1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -42,7 +42,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpb: gpb {
+       gpb: gpb-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -50,7 +50,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpc0: gpc0 {
+       gpc0: gpc0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -58,7 +58,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpc1: gpc1 {
+       gpc1: gpc1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -66,7 +66,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpd0: gpd0 {
+       gpd0: gpd0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -74,7 +74,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpd1: gpd1 {
+       gpd1: gpd1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -82,7 +82,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpe0: gpe0 {
+       gpe0: gpe0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -90,7 +90,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpe1: gpe1 {
+       gpe1: gpe1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -98,7 +98,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpf0: gpf0 {
+       gpf0: gpf0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf1: gpf1 {
+       gpf1: gpf1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf2: gpf2 {
+       gpf2: gpf2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf3: gpf3 {
+       gpf3: gpf3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpg0: gpg0 {
+       gpg0: gpg0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpg1: gpg1 {
+       gpg1: gpg1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpg2: gpg2 {
+       gpg2: gpg2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpg3: gpg3 {
+       gpg3: gpg3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpj0: gpj0 {
+       gpj0: gpj0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpj1: gpj1 {
+       gpj1: gpj1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpj2: gpj2 {
+       gpj2: gpj2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpj3: gpj3 {
+       gpj3: gpj3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpj4: gpj4 {
+       gpj4: gpj4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpi: gpi {
+       gpi: gpi-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       mp01: mp01 {
+       mp01: mp01-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       mp02: mp02 {
+       mp02: mp02-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       mp03: mp03 {
+       mp03: mp03-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       mp04: mp04 {
+       mp04: mp04-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       mp05: mp05 {
+       mp05: mp05-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       mp06: mp06 {
+       mp06: mp06-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       mp07: mp07 {
+       mp07: mp07-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
        };
 
-       gph0: gph0 {
+       gph0: gph0-gpio-bank {
                gpio-controller;
                interrupt-controller;
                interrupt-parent = <&vic0>;
                #interrupt-cells = <2>;
        };
 
-       gph1: gph1 {
+       gph1: gph1-gpio-bank {
                gpio-controller;
                interrupt-controller;
                interrupt-parent = <&vic0>;
                #interrupt-cells = <2>;
        };
 
-       gph2: gph2 {
+       gph2: gph2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gph3: gph3 {
+       gph3: gph3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       uart0_data: uart0-data {
+       uart0_data: uart0-data-pins {
                samsung,pins = "gpa0-0", "gpa0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart0_fctl: uart0-fctl {
+       uart0_fctl: uart0-fctl-pins {
                samsung,pins = "gpa0-2", "gpa0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart1_data: uart1-data {
+       uart1_data: uart1-data-pins {
                samsung,pins = "gpa0-4", "gpa0-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart1_fctl: uart1-fctl {
+       uart1_fctl: uart1-fctl-pins {
                samsung,pins = "gpa0-6", "gpa0-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart2_data: uart2-data {
+       uart2_data: uart2-data-pins {
                samsung,pins = "gpa1-0", "gpa1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart2_fctl: uart2-fctl {
+       uart2_fctl: uart2-fctl-pins {
                samsung,pins = "gpa1-2", "gpa1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart3_data: uart3-data {
+       uart3_data: uart3-data-pins {
                samsung,pins = "gpa1-2", "gpa1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart_audio: uart-audio {
+       uart_audio: uart-audio-pins {
                samsung,pins = "gpa1-2", "gpa1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       spi0_bus: spi0-bus {
+       spi0_bus: spi0-bus-pins {
                samsung,pins = "gpb-0", "gpb-2", "gpb-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       spi1_bus: spi1-bus {
+       spi1_bus: spi1-bus-pins {
                samsung,pins = "gpb-4", "gpb-6", "gpb-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2s0_bus: i2s0-bus {
+       i2s0_bus: i2s0-bus-pins {
                samsung,pins = "gpi-0", "gpi-1", "gpi-2", "gpi-3",
                                "gpi-4", "gpi-5", "gpi-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2s1_bus: i2s1-bus {
+       i2s1_bus: i2s1-bus-pins {
                samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3",
                                "gpc0-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2s2_bus: i2s2-bus {
+       i2s2_bus: i2s2-bus-pins {
                samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3",
                                "gpc1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pcm1_bus: pcm1-bus {
+       pcm1_bus: pcm1-bus-pins {
                samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3",
                                "gpc0-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       ac97_bus: ac97-bus {
+       ac97_bus: ac97-bus-pins {
                samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3",
                                "gpc0-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2s2_bus: i2s2-bus {
+       i2s2_bus: i2s2-bus-pins {
                samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3",
                                "gpc1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pcm2_bus: pcm2-bus {
+       pcm2_bus: pcm2-bus-pins {
                samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3",
                                "gpc1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       spdif_bus: spdif-bus {
+       spdif_bus: spdif-bus-pins {
                samsung,pins = "gpc1-0", "gpc1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       spi2_bus: spi2-bus {
+       spi2_bus: spi2-bus-pins {
                samsung,pins = "gpc1-1", "gpc1-2", "gpc1-3", "gpc1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_5>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c0_bus: i2c0-bus {
+       i2c0_bus: i2c0-bus-pins {
                samsung,pins = "gpd1-0", "gpd1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c1_bus: i2c1-bus {
+       i2c1_bus: i2c1-bus-pins {
                samsung,pins = "gpd1-2", "gpd1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       i2c2_bus: i2c2-bus {
+       i2c2_bus: i2c2-bus-pins {
                samsung,pins = "gpd1-4", "gpd1-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pwm0_out: pwm0-out {
+       pwm0_out: pwm0-out-pins {
                samsung,pins = "gpd0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pwm1_out: pwm1-out {
+       pwm1_out: pwm1-out-pins {
                samsung,pins = "gpd0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pwm2_out: pwm2-out {
+       pwm2_out: pwm2-out-pins {
                samsung,pins = "gpd0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pwm3_out: pwm3-out {
+       pwm3_out: pwm3-out-pins {
                samsung,pins = "gpd0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       keypad_row0: keypad-row-0 {
+       keypad_row0: keypad-row-0-pins {
                samsung,pins = "gph3-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       keypad_row1: keypad-row-1 {
+       keypad_row1: keypad-row-1-pins {
                samsung,pins = "gph3-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       keypad_row2: keypad-row-2 {
+       keypad_row2: keypad-row-2-pins {
                samsung,pins = "gph3-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       keypad_row3: keypad-row-3 {
+       keypad_row3: keypad-row-3-pins {
                samsung,pins = "gph3-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       keypad_row4: keypad-row-4 {
+       keypad_row4: keypad-row-4-pins {
                samsung,pins = "gph3-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       keypad_row5: keypad-row-5 {
+       keypad_row5: keypad-row-5-pins {
                samsung,pins = "gph3-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       keypad_row6: keypad-row-6 {
+       keypad_row6: keypad-row-6-pins {
                samsung,pins = "gph3-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       keypad_row7: keypad-row-7 {
+       keypad_row7: keypad-row-7-pins {
                samsung,pins = "gph3-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       keypad_col0: keypad-col-0 {
+       keypad_col0: keypad-col-0-pins {
                samsung,pins = "gph2-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       keypad_col1: keypad-col-1 {
+       keypad_col1: keypad-col-1-pins {
                samsung,pins = "gph2-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       keypad_col2: keypad-col-2 {
+       keypad_col2: keypad-col-2-pins {
                samsung,pins = "gph2-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       keypad_col3: keypad-col-3 {
+       keypad_col3: keypad-col-3-pins {
                samsung,pins = "gph2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       keypad_col4: keypad-col-4 {
+       keypad_col4: keypad-col-4-pins {
                samsung,pins = "gph2-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       keypad_col5: keypad-col-5 {
+       keypad_col5: keypad-col-5-pins {
                samsung,pins = "gph2-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       keypad_col6: keypad-col-6 {
+       keypad_col6: keypad-col-6-pins {
                samsung,pins = "gph2-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       keypad_col7: keypad-col-7 {
+       keypad_col7: keypad-col-7-pins {
                samsung,pins = "gph2-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       sd0_clk: sd0-clk {
+       sd0_clk: sd0-clk-pins {
                samsung,pins = "gpg0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_cmd: sd0-cmd {
+       sd0_cmd: sd0-cmd-pins {
                samsung,pins = "gpg0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_cd: sd0-cd {
+       sd0_cd: sd0-cd-pins {
                samsung,pins = "gpg0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_bus1: sd0-bus-width1 {
+       sd0_bus1: sd0-bus-width1-pins {
                samsung,pins = "gpg0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_bus4: sd0-bus-width4 {
+       sd0_bus4: sd0-bus-width4-pins {
                samsung,pins = "gpg0-3", "gpg0-4", "gpg0-5", "gpg0-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd0_bus8: sd0-bus-width8 {
+       sd0_bus8: sd0-bus-width8-pins {
                samsung,pins = "gpg1-3", "gpg1-4", "gpg1-5", "gpg1-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd1_clk: sd1-clk {
+       sd1_clk: sd1-clk-pins {
                samsung,pins = "gpg1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd1_cmd: sd1-cmd {
+       sd1_cmd: sd1-cmd-pins {
                samsung,pins = "gpg1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd1_cd: sd1-cd {
+       sd1_cd: sd1-cd-pins {
                samsung,pins = "gpg1-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd1_bus1: sd1-bus-width1 {
+       sd1_bus1: sd1-bus-width1-pins {
                samsung,pins = "gpg1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd1_bus4: sd1-bus-width4 {
+       sd1_bus4: sd1-bus-width4-pins {
                samsung,pins = "gpg1-3", "gpg1-4", "gpg1-5", "gpg1-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_clk: sd2-clk {
+       sd2_clk: sd2-clk-pins {
                samsung,pins = "gpg2-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_cmd: sd2-cmd {
+       sd2_cmd: sd2-cmd-pins {
                samsung,pins = "gpg2-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_cd: sd2-cd {
+       sd2_cd: sd2-cd-pins {
                samsung,pins = "gpg2-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_bus1: sd2-bus-width1 {
+       sd2_bus1: sd2-bus-width1-pins {
                samsung,pins = "gpg2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_bus4: sd2-bus-width4 {
+       sd2_bus4: sd2-bus-width4-pins {
                samsung,pins = "gpg2-3", "gpg2-4", "gpg2-5", "gpg2-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_bus8: sd2-bus-width8 {
+       sd2_bus8: sd2-bus-width8-pins {
                samsung,pins = "gpg3-3", "gpg3-4", "gpg3-5", "gpg3-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd3_clk: sd3-clk {
+       sd3_clk: sd3-clk-pins {
                samsung,pins = "gpg3-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd3_cmd: sd3-cmd {
+       sd3_cmd: sd3-cmd-pins {
                samsung,pins = "gpg3-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd3_cd: sd3-cd {
+       sd3_cd: sd3-cd-pins {
                samsung,pins = "gpg3-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd3_bus1: sd3-bus-width1 {
+       sd3_bus1: sd3-bus-width1-pins {
                samsung,pins = "gpg3-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd3_bus4: sd3-bus-width4 {
+       sd3_bus4: sd3-bus-width4-pins {
                samsung,pins = "gpg3-3", "gpg3-4", "gpg3-5", "gpg3-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       eint0: ext-int0 {
+       eint0: ext-int0-pins {
                samsung,pins = "gph0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       eint8: ext-int8 {
+       eint8: ext-int8-pins {
                samsung,pins = "gph1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       eint15: ext-int15 {
+       eint15: ext-int15-pins {
                samsung,pins = "gph1-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       eint16: ext-int16 {
+       eint16: ext-int16-pins {
                samsung,pins = "gph2-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       eint31: ext-int31 {
+       eint31: ext-int31-pins {
                samsung,pins = "gph3-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       cam_port_a_io: cam-port-a-io {
+       cam_port_a_io: cam-port-a-io-pins {
                samsung,pins = "gpe0-0", "gpe0-1", "gpe0-2", "gpe0-3",
                                "gpe0-4", "gpe0-5", "gpe0-6", "gpe0-7",
                                "gpe1-0", "gpe1-1", "gpe1-2", "gpe1-4";
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       cam_port_a_clk_active: cam-port-a-clk-active {
+       cam_port_a_clk_active: cam-port-a-clk-active-pins {
                samsung,pins = "gpe1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       cam_port_a_clk_idle: cam-port-a-clk-idle {
+       cam_port_a_clk_idle: cam-port-a-clk-idle-pins {
                samsung,pins = "gpe1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_DOWN>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       cam_port_b_io: cam-port-b-io {
+       cam_port_b_io: cam-port-b-io-pins {
                samsung,pins = "gpj0-0", "gpj0-1", "gpj0-2", "gpj0-3",
                                "gpj0-4", "gpj0-5", "gpj0-6", "gpj0-7",
                                "gpj1-0", "gpj1-1", "gpj1-2", "gpj1-4";
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       cam_port_b_clk_active: cam-port-b-clk-active {
+       cam_port_b_clk_active: cam-port-b-clk-active-pins {
                samsung,pins = "gpj1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       cam_port_b_clk_idle: cam-port-b-clk-idle {
+       cam_port_b_clk_idle: cam-port-b-clk-idle-pins {
                samsung,pins = "gpj1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_DOWN>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-               lcd_ctrl: lcd-ctrl {
+       lcd_ctrl: lcd-ctrl-pins {
                samsung,pins = "gpd0-0", "gpd0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       lcd_sync: lcd-sync {
+       lcd_sync: lcd-sync-pins {
                samsung,pins = "gpf0-0", "gpf0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       lcd_clk: lcd-clk {
+       lcd_clk: lcd-clk-pins {
                samsung,pins = "gpf0-0", "gpf0-1", "gpf0-2", "gpf0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       lcd_data24: lcd-data-width24 {
+       lcd_data24: lcd-data-width24-pins {
                samsung,pins =  "gpf0-4", "gpf0-5", "gpf0-6", "gpf0-7",
                                "gpf1-0", "gpf1-1", "gpf1-2", "gpf1-3",
                                "gpf1-4", "gpf1-5", "gpf1-6", "gpf1-7",
index ec45ced..998629a 100644 (file)
                                clock-names = "pclk", "gclk";
                        };
 
-                       sha: sha@f002c000 {
+                       sha: crypto@f002c000 {
                                compatible = "atmel,at91sam9g46-sha";
                                reg = <0xf002c000 0x100>;
                                interrupts = <41 IRQ_TYPE_LEVEL_HIGH 0>;
                                dma-names = "tx";
                                clocks = <&pmc PMC_TYPE_PERIPHERAL 41>;
                                clock-names = "sha_clk";
-                               status = "okay";
                        };
 
                        trng: trng@f0030000 {
                                reg = <0xf0030000 0x100>;
                                interrupts = <38 IRQ_TYPE_LEVEL_HIGH 0>;
                                clocks = <&pmc PMC_TYPE_PERIPHERAL 38>;
-                               status = "okay";
                        };
 
-                       aes: aes@f0034000 {
+                       aes: crypto@f0034000 {
                                compatible = "atmel,at91sam9g46-aes";
                                reg = <0xf0034000 0x100>;
                                interrupts = <39 IRQ_TYPE_LEVEL_HIGH 0>;
                                dma-names = "tx", "rx";
                                clocks = <&pmc PMC_TYPE_PERIPHERAL 39>;
                                clock-names = "aes_clk";
-                               status = "okay";
                        };
 
-                       tdes: tdes@f0038000 {
+                       tdes: crypto@f0038000 {
                                compatible = "atmel,at91sam9g46-tdes";
                                reg = <0xf0038000 0x100>;
                                interrupts = <40 IRQ_TYPE_LEVEL_HIGH 0>;
                                dma-names = "tx", "rx";
                                clocks = <&pmc PMC_TYPE_PERIPHERAL 40>;
                                clock-names = "tdes_clk";
-                               status = "okay";
                        };
 
                        classd: classd@f003c000 {
index 09c741e..89c71d4 100644 (file)
                                status = "disabled";
                        };
 
-                       sha@f0028000 {
+                       sha: crypto@f0028000 {
                                compatible = "atmel,at91sam9g46-sha";
                                reg = <0xf0028000 0x100>;
                                interrupts = <12 IRQ_TYPE_LEVEL_HIGH 0>;
                                dma-names = "tx";
                                clocks = <&pmc PMC_TYPE_PERIPHERAL 12>;
                                clock-names = "sha_clk";
-                               status = "okay";
                        };
 
-                       aes@f002c000 {
+                       aes: crypto@f002c000 {
                                compatible = "atmel,at91sam9g46-aes";
                                reg = <0xf002c000 0x100>;
                                interrupts = <9 IRQ_TYPE_LEVEL_HIGH 0>;
                                dma-names = "tx", "rx";
                                clocks = <&pmc PMC_TYPE_PERIPHERAL 9>;
                                clock-names = "aes_clk";
-                               status = "okay";
                        };
 
                        spi0: spi@f8000000 {
                                pmecc: ecc-engine@f8014070 {
                                        compatible = "atmel,sama5d2-pmecc";
                                        reg = <0xf8014070 0x490>,
-                                             <0xf8014500 0x100>;
+                                             <0xf8014500 0x200>;
                                };
                        };
 
                                #gpio-cells = <2>;
                        };
 
-                       tdes@fc044000 {
+                       tdes: crypto@fc044000 {
                                compatible = "atmel,at91sam9g46-tdes";
                                reg = <0xfc044000 0x100>;
                                interrupts = <11 IRQ_TYPE_LEVEL_HIGH 0>;
                                dma-names = "tx", "rx";
                                clocks = <&pmc PMC_TYPE_PERIPHERAL 11>;
                                clock-names = "tdes_clk";
-                               status = "okay";
                        };
 
                        classd: classd@fc048000 {
index d1841bf..8fa423c 100644 (file)
                                status = "disabled";
                        };
 
-                       sha@f8034000 {
+                       sha: crypto@f8034000 {
                                compatible = "atmel,at91sam9g46-sha";
                                reg = <0xf8034000 0x100>;
                                interrupts = <42 IRQ_TYPE_LEVEL_HIGH 0>;
                                clock-names = "sha_clk";
                        };
 
-                       aes@f8038000 {
+                       aes: crypto@f8038000 {
                                compatible = "atmel,at91sam9g46-aes";
                                reg = <0xf8038000 0x100>;
                                interrupts = <43 IRQ_TYPE_LEVEL_HIGH 0>;
                                clock-names = "aes_clk";
                        };
 
-                       tdes@f803c000 {
+                       tdes: crypto@f803c000 {
                                compatible = "atmel,at91sam9g46-tdes";
                                reg = <0xf803c000 0x100>;
                                interrupts = <44 IRQ_TYPE_LEVEL_HIGH 0>;
index f6e3e6f..7b92426 100644 (file)
                                status = "disabled";
                        };
 
-                       aes@fc044000 {
+                       aes: crypto@fc044000 {
                                compatible = "atmel,at91sam9g46-aes";
                                reg = <0xfc044000 0x100>;
                                interrupts = <12 IRQ_TYPE_LEVEL_HIGH 0>;
                                dma-names = "tx", "rx";
                                clocks = <&pmc PMC_TYPE_PERIPHERAL 12>;
                                clock-names = "aes_clk";
-                               status = "okay";
                        };
 
-                       tdes@fc04c000 {
+                       tdes: crpyto@fc04c000 {
                                compatible = "atmel,at91sam9g46-tdes";
                                reg = <0xfc04c000 0x100>;
                                interrupts = <14 IRQ_TYPE_LEVEL_HIGH 0>;
                                dma-names = "tx", "rx";
                                clocks = <&pmc PMC_TYPE_PERIPHERAL 14>;
                                clock-names = "tdes_clk";
-                               status = "okay";
                        };
 
-                       sha@fc050000 {
+                       sha: crypto@fc050000 {
                                compatible = "atmel,at91sam9g46-sha";
                                reg = <0xfc050000 0x100>;
                                interrupts = <15 IRQ_TYPE_LEVEL_HIGH 0>;
                                dma-names = "tx";
                                clocks = <&pmc PMC_TYPE_PERIPHERAL 15>;
                                clock-names = "sha_clk";
-                               status = "okay";
                        };
 
                        hsmc: smc@fc05c000 {
index eddcfbf..e6d0c90 100644 (file)
                        device_type = "cpu";
                        compatible = "arm,cortex-a7";
                        reg = <0x0>;
+                       clocks = <&pmc PMC_TYPE_CORE PMC_CPUPLL>;
+                       clock-names = "cpu";
+                       operating-points-v2 = <&cpu_opp_table>;
+               };
+       };
+
+       cpu_opp_table: opp-table {
+               compatible = "operating-points-v2";
+
+               opp-90000000 {
+                       opp-hz = /bits/ 64 <90000000>;
+                       opp-microvolt = <1050000 1050000 1225000>;
+                       clock-latency-ns = <320000>;
+               };
+
+               opp-250000000 {
+                       opp-hz = /bits/ 64 <250000000>;
+                       opp-microvolt = <1050000 1050000 1225000>;
+                       clock-latency-ns = <320000>;
+               };
+
+               opp-600000000 {
+                       opp-hz = /bits/ 64 <600000000>;
+                       opp-microvolt = <1050000 1050000 1225000>;
+                       clock-latency-ns = <320000>;
+                       opp-suspend;
+               };
+
+               opp-800000000 {
+                       opp-hz = /bits/ 64 <800000000>;
+                       opp-microvolt = <1150000 1125000 1225000>;
+                       clock-latency-ns = <320000>;
+               };
+
+               opp-1000000002 {
+                       opp-hz = /bits/ 64 <1000000002>;
+                       opp-microvolt = <1250000 1225000 1300000>;
+                       clock-latency-ns = <320000>;
                };
        };
 
                        #size-cells = <1>;
                        ranges = <0 0xe0000000 0x4000>;
                        no-memory-wc;
-                       status = "okay";
                };
 
                secumod: secumod@e0004000 {
                        status = "disabled";
                };
 
+               can0: can@e0828000 {
+                       compatible = "bosch,m_can";
+                       reg = <0xe0828000 0x100>, <0x100000 0x7800>;
+                       reg-names = "m_can", "message_ram";
+                       interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "int0", "int1";
+                       clocks = <&pmc PMC_TYPE_PERIPHERAL 61>, <&pmc PMC_TYPE_GCK 61>;
+                       clock-names = "hclk", "cclk";
+                       assigned-clocks = <&pmc PMC_TYPE_GCK 61>;
+                       assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_SYSPLL>;
+                       assigned-clock-rates = <40000000>;
+                       bosch,mram-cfg = <0x3400 0 0 64 0 0 32 32>;
+                       status = "disabled";
+               };
+
+               can1: can@e082c000 {
+                       compatible = "bosch,m_can";
+                       reg = <0xe082c000 0x100>, <0x100000 0xbc00>;
+                       reg-names = "m_can", "message_ram";
+                       interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "int0", "int1";
+                       clocks = <&pmc PMC_TYPE_PERIPHERAL 62>, <&pmc PMC_TYPE_GCK 62>;
+                       clock-names = "hclk", "cclk";
+                       assigned-clocks = <&pmc PMC_TYPE_GCK 62>;
+                       assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_SYSPLL>;
+                       assigned-clock-rates = <40000000>;
+                       bosch,mram-cfg = <0x7800 0 0 64 0 0 32 32>;
+                       status = "disabled";
+               };
+
+               can2: can@e0830000 {
+                       compatible = "bosch,m_can";
+                       reg = <0xe0830000 0x100>, <0x100000 0x10000>;
+                       reg-names = "m_can", "message_ram";
+                       interrupts = <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "int0", "int1";
+                       clocks = <&pmc PMC_TYPE_PERIPHERAL 63>, <&pmc PMC_TYPE_GCK 63>;
+                       clock-names = "hclk", "cclk";
+                       assigned-clocks = <&pmc PMC_TYPE_GCK 63>;
+                       assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_SYSPLL>;
+                       assigned-clock-rates = <40000000>;
+                       bosch,mram-cfg = <0xbc00 0 0 64 0 0 32 32>;
+                       status = "disabled";
+               };
+
+               can3: can@e0834000 {
+                       compatible = "bosch,m_can";
+                       reg = <0xe0834000 0x100>, <0x110000 0x4400>;
+                       reg-names = "m_can", "message_ram";
+                       interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "int0", "int1";
+                       clocks = <&pmc PMC_TYPE_PERIPHERAL 64>, <&pmc PMC_TYPE_GCK 64>;
+                       clock-names = "hclk", "cclk";
+                       assigned-clocks = <&pmc PMC_TYPE_GCK 64>;
+                       assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_SYSPLL>;
+                       assigned-clock-rates = <40000000>;
+                       bosch,mram-cfg = <0x0 0 0 64 0 0 32 32>;
+                       status = "disabled";
+               };
+
+               can4: can@e0838000 {
+                       compatible = "bosch,m_can";
+                       reg = <0xe0838000 0x100>, <0x110000 0x8800>;
+                       reg-names = "m_can", "message_ram";
+                       interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "int0", "int1";
+                       clocks = <&pmc PMC_TYPE_PERIPHERAL 65>, <&pmc PMC_TYPE_GCK 65>;
+                       clock-names = "hclk", "cclk";
+                       assigned-clocks = <&pmc PMC_TYPE_GCK 65>;
+                       assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_SYSPLL>;
+                       assigned-clock-rates = <40000000>;
+                       bosch,mram-cfg = <0x4400 0 0 64 0 0 32 32>;
+                       status = "disabled";
+               };
+
+               can5: can@e083c000 {
+                       compatible = "bosch,m_can";
+                       reg = <0xe083c000 0x100>, <0x110000 0xcc00>;
+                       reg-names = "m_can", "message_ram";
+                       interrupts = <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "int0", "int1";
+                       clocks = <&pmc PMC_TYPE_PERIPHERAL 66>, <&pmc PMC_TYPE_GCK 66>;
+                       clock-names = "hclk", "cclk";
+                       assigned-clocks = <&pmc PMC_TYPE_GCK 66>;
+                       assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_SYSPLL>;
+                       assigned-clock-rates = <40000000>;
+                       bosch,mram-cfg = <0x8800 0 0 64 0 0 32 32>;
+                       status = "disabled";
+               };
+
                adc: adc@e1000000 {
                        compatible = "microchip,sama7g5-adc";
                        reg = <0xe1000000 0x200>;
                        clock-names = "pclk", "gclk";
                };
 
+               aes: crypto@e1810000 {
+                       compatible = "atmel,at91sam9g46-aes";
+                       reg = <0xe1810000 0x100>;
+                       interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&pmc PMC_TYPE_PERIPHERAL 27>;
+                       clock-names = "aes_clk";
+                       dmas = <&dma0 AT91_XDMAC_DT_PERID(1)>,
+                              <&dma0 AT91_XDMAC_DT_PERID(2)>;
+                       dma-names = "tx", "rx";
+               };
+
+               sha: crypto@e1814000 {
+                       compatible = "atmel,at91sam9g46-sha";
+                       reg = <0xe1814000 0x100>;
+                       interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&pmc PMC_TYPE_PERIPHERAL 83>;
+                       clock-names = "sha_clk";
+                       dmas = <&dma0 AT91_XDMAC_DT_PERID(48)>;
+                       dma-names = "tx";
+               };
+
                flx0: flexcom@e1818000 {
                        compatible = "atmel,sama5d2-flexcom";
                        reg = <0xe1818000 0x200>;
                        status = "disabled";
                };
 
+               tdes: crypto@e2014000 {
+                       compatible = "atmel,at91sam9g46-tdes";
+                       reg = <0xe2014000 0x100>;
+                       interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&pmc PMC_TYPE_PERIPHERAL 96>;
+                       clock-names = "tdes_clk";
+                       dmas = <&dma0 AT91_XDMAC_DT_PERID(54)>,
+                              <&dma0 AT91_XDMAC_DT_PERID(53)>;
+                       dma-names = "tx", "rx";
+               };
+
                flx4: flexcom@e2018000 {
                        compatible = "atmel,sama5d2-flexcom";
                        reg = <0xe2018000 0x200>;
                uddrc: uddrc@e3800000 {
                        compatible = "microchip,sama7g5-uddrc";
                        reg = <0xe3800000 0x4000>;
-                       status = "okay";
                };
 
                ddr3phy: ddr3phy@e3804000 {
                        compatible = "microchip,sama7g5-ddr3phy";
                        reg = <0xe3804000 0x1000>;
-                       status = "okay";
                };
 
                gic: interrupt-controller@e8c11000 {
index 2a3364b..a75c059 100644 (file)
@@ -6,7 +6,7 @@
 / {
 
        model = "Enclustra Mercury AA1";
-       compatible = "altr,socfpga-arria10", "altr,socfpga";
+       compatible = "enclustra,mercury-aa1", "altr,socfpga-arria10", "altr,socfpga";
 
        aliases {
                ethernet0 = &gmac0;
index 7edebe2..ec73654 100644 (file)
@@ -6,7 +6,7 @@
 
 / {
        model = "Altera SOCFPGA Arria 10";
-       compatible = "altr,socfpga-arria10", "altr,socfpga";
+       compatible = "altr,socfpga-arria10-socdk", "altr,socfpga-arria10", "altr,socfpga";
 
        aliases {
                ethernet0 = &gmac0;
index 1b02d46..7f5458d 100644 (file)
@@ -7,7 +7,7 @@
 
 / {
        model = "Altera SOCFPGA Arria V SoC Development Kit";
-       compatible = "altr,socfpga-arria5", "altr,socfpga";
+       compatible = "altr,socfpga-arria5-socdk", "altr,socfpga-arria5", "altr,socfpga";
 
        chosen {
                bootargs = "earlyprintk";
@@ -50,7 +50,7 @@
                };
        };
 
-       regulator_3_3v: 3-3-v-regulator {
+       regulator_3_3v: regulator {
                compatible = "regulator-fixed";
                regulator-name = "3.3V";
                regulator-min-microvolt = <3300000>;
index f656176..76262f1 100644 (file)
@@ -24,7 +24,7 @@
                reg = <0x0 0x20000000>; /* 512MB */
        };
 
-       regulator_3_3v: 3-3-v-regulator {
+       regulator_3_3v: regulator {
                compatible = "regulator-fixed";
                regulator-name = "3.3V";
                regulator-min-microvolt = <3300000>;
index 67076e1..c8f051f 100644 (file)
@@ -24,7 +24,7 @@
                ethernet0 = &gmac1;
        };
 
-       regulator_3_3v: 3-3-v-regulator {
+       regulator_3_3v: regulator {
                compatible = "regulator-fixed";
                regulator-name = "3.3V";
                regulator-min-microvolt = <3300000>;
index 51bb436..253ef13 100644 (file)
@@ -50,7 +50,7 @@
                };
        };
 
-       regulator_3_3v: 3-3-v-regulator {
+       regulator_3_3v: regulator {
                compatible = "regulator-fixed";
                regulator-name = "3.3V";
                regulator-min-microvolt = <3300000>;
index cae9ddd..3dd99c7 100644 (file)
                };
        };
 
-       regulator_3_3v: vcc3p3-regulator {
+       regulator_3_3v: regulator {
                compatible = "regulator-fixed";
                regulator-name = "VCC3P3";
                regulator-min-microvolt = <3300000>;
index 3f7aa7b..b0003f3 100644 (file)
@@ -26,7 +26,7 @@
                ethernet0 = &gmac1;
        };
 
-       regulator_3_3v: 3-3-v-regulator {
+       regulator_3_3v: regulator {
                compatible = "regulator-fixed";
                regulator-name = "3.3V";
                regulator-min-microvolt = <3300000>;
index 2cf1938..35137c6 100644 (file)
                                interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
                                interrupt-controller;
                                #interrupt-cells = <2>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
 
                                ab8500_clock: clock-controller {
                                        compatible = "stericsson,ab8500-clk";
                                        #clock-cells = <1>;
                                };
 
-                               ab8500_gpio: ab8500-gpiocontroller {
+                               ab8500_gpio: gpio {
                                        compatible = "stericsson,ab8500-gpio";
                                        gpio-controller;
                                        #gpio-cells = <2>;
                                };
 
-                               ab8500-rtc {
+                               rtc {
                                        compatible = "stericsson,ab8500-rtc";
                                        interrupts = <17 IRQ_TYPE_LEVEL_HIGH>,
                                                     <18 IRQ_TYPE_LEVEL_HIGH>;
                                        interrupt-names = "60S", "ALARM";
                                };
 
-                               gpadc: ab8500-gpadc {
+                               gpadc: adc {
                                        compatible = "stericsson,ab8500-gpadc";
                                        interrupts = <32 IRQ_TYPE_LEVEL_HIGH>,
                                                     <39 IRQ_TYPE_LEVEL_HIGH>;
                                        };
                                };
 
-                               ab8500_temp {
+                               thermal {
                                        compatible = "stericsson,abx500-temp";
                                        interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
                                        interrupt-names = "ABX500_TEMP_WARM";
-                                       io-channels = <&gpadc 0x06>,
-                                                     <&gpadc 0x07>;
-                                       io-channel-names = "aux1", "aux2";
                                };
 
                                ab8500_fg {
                                        monitored-battery       = <&battery>;
                                };
 
-                               ab8500_usb: ab8500_usb {
+                               ab8500_usb: phy {
                                        compatible = "stericsson,ab8500-usb";
                                        interrupts = <90 IRQ_TYPE_LEVEL_HIGH>,
                                                     <96 IRQ_TYPE_LEVEL_HIGH>,
                                        #phy-cells = <0>;
                                };
 
-                               ab8500-ponkey {
+                               key {
                                        compatible = "stericsson,ab8500-poweron-key";
                                        interrupts = <6 IRQ_TYPE_LEVEL_HIGH>,
                                                     <7 IRQ_TYPE_LEVEL_HIGH>;
                                        compatible = "stericsson,ab8500-sysctrl";
                                };
 
-                               ab8500-pwm-1 {
+                               pwm@1 {
                                        compatible = "stericsson,ab8500-pwm";
+                                       reg = <1>;
                                        clocks = <&ab8500_clock AB8500_SYSCLK_INT>;
                                        clock-names = "intclk";
+                                       #pwm-cells = <1>;
                                };
 
-                               ab8500-pwm-2 {
+                               pwm@2 {
                                        compatible = "stericsson,ab8500-pwm";
+                                       reg = <2>;
                                        clocks = <&ab8500_clock AB8500_SYSCLK_INT>;
                                        clock-names = "intclk";
+                                       #pwm-cells = <1>;
                                };
 
-                               ab8500-pwm-3 {
+                               pwm@3 {
                                        compatible = "stericsson,ab8500-pwm";
+                                       reg = <3>;
                                        clocks = <&ab8500_clock AB8500_SYSCLK_INT>;
                                        clock-names = "intclk";
+                                       #pwm-cells = <1>;
                                };
 
-                               ab8500-debugfs {
-                                       compatible = "stericsson,ab8500-debug";
-                               };
-
-                               codec: ab8500-codec {
+                               codec: codec {
                                        compatible = "stericsson,ab8500-codec";
 
                                        V-AUD-supply = <&ab8500_ldo_audio_reg>;
                                        stericsson,earpeice-cmv = <950>; /* Units in mV. */
                                };
 
-                               ext_regulators: ab8500-ext-regulators {
+                               ext_regulators: regulator-external {
                                        compatible = "stericsson,ab8500-ext-regulator";
 
                                        ab8500_ext1_reg: ab8500_ext1 {
                                        };
                                };
 
-                               ab8500-regulators {
+                               regulator {
                                        compatible = "stericsson,ab8500-regulator";
                                        vin-supply = <&ab8500_ext3_reg>;
 
index e98335e..131c825 100644 (file)
                                interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
                                interrupt-controller;
                                #interrupt-cells = <2>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
 
                                ab8500_clock: clock-controller {
                                        compatible = "stericsson,ab8500-clk";
                                        #clock-cells = <1>;
                                };
 
-                               ab8505_gpio: ab8505-gpiocontroller {
+                               ab8505_gpio: gpio {
                                        compatible = "stericsson,ab8505-gpio";
                                        gpio-controller;
                                        #gpio-cells = <2>;
                                };
 
-                               ab8500-rtc {
+                               rtc {
                                        compatible = "stericsson,ab8500-rtc";
                                        interrupts = <17 IRQ_TYPE_LEVEL_HIGH>,
                                                     <18 IRQ_TYPE_LEVEL_HIGH>;
                                        interrupt-names = "60S", "ALARM";
                                };
 
-                               gpadc: ab8500-gpadc {
+                               gpadc: adc {
                                        compatible = "stericsson,ab8500-gpadc";
                                        interrupts = <39 IRQ_TYPE_LEVEL_HIGH>;
                                        interrupt-names = "SW_CONV_END";
                                        };
                                };
 
+                               thermal {
+                                       compatible = "stericsson,abx500-temp";
+                                       interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
+                                       interrupt-names = "ABX500_TEMP_WARM";
+                               };
+
                                ab8500_fg {
-                                       status = "disabled";
                                        compatible = "stericsson,ab8500-fg";
                                        interrupts = <24 IRQ_TYPE_LEVEL_HIGH>,
                                                     <8 IRQ_TYPE_LEVEL_HIGH>,
                                };
 
                                ab8500_btemp {
-                                       status = "disabled";
                                        compatible = "stericsson,ab8500-btemp";
                                        interrupts = <20 IRQ_TYPE_LEVEL_HIGH>,
                                                     <80 IRQ_TYPE_LEVEL_HIGH>,
                                };
 
                                ab8500_charger {
-                                       status = "disabled";
                                        compatible = "stericsson,ab8500-charger";
                                        interrupts = <10 IRQ_TYPE_LEVEL_HIGH>,
                                                     <11 IRQ_TYPE_LEVEL_HIGH>,
                                };
 
                                ab8500_chargalg {
-                                       status = "disabled";
                                        compatible = "stericsson,ab8500-chargalg";
                                        monitored-battery = <&battery>;
                                };
 
-                               ab8500_usb: ab8500_usb {
+                               ab8500_usb: phy {
                                        compatible = "stericsson,ab8500-usb";
                                        interrupts = <90 IRQ_TYPE_LEVEL_HIGH>,
                                                     <96 IRQ_TYPE_LEVEL_HIGH>,
                                        #phy-cells = <0>;
                                };
 
-                               ab8500-ponkey {
+                               key {
                                        compatible = "stericsson,ab8500-poweron-key";
                                        interrupts = <6 IRQ_TYPE_LEVEL_HIGH>,
                                                     <7 IRQ_TYPE_LEVEL_HIGH>;
                                        compatible = "stericsson,ab8500-sysctrl";
                                };
 
-                               ab8500-pwm {
+                               pwm@1 {
                                        compatible = "stericsson,ab8500-pwm";
+                                       reg = <1>;
                                        clocks = <&ab8500_clock AB8500_SYSCLK_INT>;
                                        clock-names = "intclk";
+                                       #pwm-cells = <1>;
                                };
 
-                               ab8500-debugfs {
-                                       compatible = "stericsson,ab8500-debug";
-                               };
-
-                               codec: ab8500-codec {
+                               codec: codec {
                                        compatible = "stericsson,ab8500-codec";
 
                                        V-AUD-supply = <&ab8500_ldo_audio_reg>;
                                        stericsson,earpeice-cmv = <950>; /* Units in mV. */
                                };
 
-                               ab8505-regulators {
+                               regulator {
                                        compatible = "stericsson,ab8505-regulator";
 
                                        ab8500_ldo_aux1_reg: ab8500_ldo_aux1 {
index 3ccb7b5..9fa0249 100644 (file)
@@ -9,7 +9,7 @@
        soc {
                prcmu@80157000 {
                        ab8500 {
-                               ab8500-gpiocontroller {
+                               gpio {
                                        /* Hog a few default settings */
                                        pinctrl-names = "default";
                                        pinctrl-0 = <&gpio2_default_mode>,
index 718752a..fbaa0ce 100644 (file)
        battery: battery {
                compatible = "simple-battery";
                battery-type = "lithium-ion-polymer";
-               thermistor-on-batctrl;
+       };
+
+       thermal-zones {
+               battery-thermal {
+                       /* This zone will be polled by the battery temperature code */
+                       polling-delay = <0>;
+                       polling-delay-passive = <0>;
+                       thermal-sensors = <&bat_therm>;
+               };
+       };
+
+       bat_therm: thermistor {
+               compatible = "murata,ncp18wb473";
+               io-channels = <&gpadc 0x02>; /* BatTemp */
+               pullup-uv = <1800000>;
+               pullup-ohm = <230000>;
+               pulldown-ohm = <0>;
+               #thermal-sensor-cells = <0>;
        };
 
        soc {
 
                prcmu@80157000 {
                        ab8500 {
-                               ab8500-gpiocontroller {
+                               gpio {
                                };
 
-                               ab8500_usb {
+                               phy {
                                        pinctrl-names = "default", "sleep";
                                        pinctrl-0 = <&usb_a_1_default>;
                                        pinctrl-1 = <&usb_a_1_sleep>;
                                };
 
-                               ab8500-regulators {
+                               regulator {
                                        ab8500_ldo_aux1_reg: ab8500_ldo_aux1 {
                                                regulator-name = "V-DISPLAY";
                                        };
index fb719c8..1c9094f 100644 (file)
        battery: battery {
                compatible = "simple-battery";
                battery-type = "lithium-ion-polymer";
-               thermistor-on-batctrl;
+       };
+
+       thermal-zones {
+               battery-thermal {
+                       /* This zone will be polled by the battery temperature code */
+                       polling-delay = <0>;
+                       polling-delay-passive = <0>;
+                       thermal-sensors = <&bat_therm>;
+               };
+       };
+
+       bat_therm: thermistor {
+               compatible = "murata,ncp18wb473";
+               io-channels = <&gpadc 0x02>; /* BatTemp */
+               pullup-uv = <1800000>;
+               pullup-ohm = <230000>;
+               pulldown-ohm = <0>;
+               #thermal-sensor-cells = <0>;
        };
 
        en_3v3_reg: en_3v3 {
 
                prcmu@80157000 {
                        ab8500 {
-                               ab8500-gpiocontroller {
+                               gpio {
                                        /*
                                         * AB8500 GPIOs are numbered starting from 1, so the first
                                         * index 0 is what in the datasheet is called "GPIO1", and
                                                     "PM_GPIO42"; /* AB8500 GPIO42 */
                                };
 
-                               ab8500_usb {
+                               phy {
                                        pinctrl-names = "default", "sleep";
                                        pinctrl-0 = <&usb_a_1_default>;
                                        pinctrl-1 = <&usb_a_1_sleep>;
                                };
 
-                               ext_regulators: ab8500-ext-regulators {
+                               ext_regulators: regulator-external {
                                        ab8500_ext1_reg: ab8500_ext1 {
                                                regulator-name = "ab8500-ext-supply1";
                                        };
                                        };
                                };
 
-                               ab8500-regulators {
+                               regulator {
                                        ab8500_ldo_aux1_reg: ab8500_ldo_aux1 {
                                                regulator-name = "V-DISPLAY";
                                        };
index fbd6006..1c1725d 100644 (file)
                compatible = "samsung,eb425161lu";
        };
 
+       thermal-zones {
+               battery-thermal {
+                       /* This zone will be polled by the battery temperature code */
+                       polling-delay = <0>;
+                       polling-delay-passive = <0>;
+                       thermal-sensors = <&bat_therm>;
+               };
+       };
+
+       bat_therm: thermistor {
+               compatible = "samsung,1404-001221";
+               io-channels = <&gpadc 0x02>; /* BatTemp */
+               pullup-uv = <1800000>;
+               pullup-ohm = <230000>;
+               pulldown-ohm = <0>;
+               #thermal-sensor-cells = <0>;
+       };
+
        /* TI TXS0206 level translator for 2.9 V */
        sd_level_translator: regulator-gpio {
                compatible = "regulator-fixed";
 
                prcmu@80157000 {
                        ab8500 {
-                               ab8500_usb {
+                               phy {
                                        pinctrl-names = "default", "sleep";
                                        pinctrl-0 = <&usb_a_1_default>;
                                        pinctrl-1 = <&usb_a_1_sleep>;
                                };
 
-                               ab8500-regulators {
+                               regulator {
                                        ab8500_ldo_aux1 {
                                                /* Used for VDD for sensors */
                                                regulator-name = "V-SENSORS-VDD";
index 1c0e5cf..fd17097 100644 (file)
                compatible = "samsung,eb585157lu";
        };
 
+       thermal-zones {
+               battery-thermal {
+                       /* This zone will be polled by the battery temperature code */
+                       polling-delay = <0>;
+                       polling-delay-passive = <0>;
+                       thermal-sensors = <&bat_therm>;
+               };
+       };
+
+       bat_therm: thermistor {
+               compatible = "samsung,1404-001221";
+               io-channels = <&gpadc 0x02>; /* BatTemp */
+               pullup-uv = <1800000>;
+               pullup-ohm = <230000>;
+               pulldown-ohm = <0>;
+               #thermal-sensor-cells = <0>;
+       };
+
        /* TI TXS0206 level translator for 2.9 V */
        sd_level_translator: regulator-gpio {
                compatible = "regulator-fixed";
 
                prcmu@80157000 {
                        ab8500 {
-                               ab8500_usb {
+                               phy {
                                        pinctrl-names = "default", "sleep";
                                        pinctrl-0 = <&usb_a_1_default>;
                                        pinctrl-1 = <&usb_a_1_sleep>;
                                };
 
-                               ab8500-regulators {
+                               regulator {
                                        ab8500_ldo_aux1 {
                                                /* Used for VDD for sensors */
                                                regulator-name = "V-SENSORS-VDD";
index fc4c516..290ab59 100644 (file)
                compatible = "samsung,eb-l1m7flu";
        };
 
+       thermal-zones {
+               battery-thermal {
+                       /* This zone will be polled by the battery temperature code */
+                       polling-delay = <0>;
+                       polling-delay-passive = <0>;
+                       thermal-sensors = <&bat_therm>;
+               };
+       };
+
+       bat_therm: thermistor {
+               compatible = "samsung,1404-001221";
+               io-channels = <&gpadc 0x02>; /* BatTemp */
+               pullup-uv = <1800000>;
+               pullup-ohm = <230000>;
+               pulldown-ohm = <0>;
+               #thermal-sensor-cells = <0>;
+       };
+
        i2c-gpio-0 {
                compatible = "i2c-gpio";
                sda-gpios = <&gpio2 14 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
 
                prcmu@80157000 {
                        ab8505 {
-                               ab8500_usb {
+                               phy {
                                        pinctrl-names = "default", "sleep";
                                        pinctrl-0 = <&usb_a_1_default>;
                                        pinctrl-1 = <&usb_a_1_sleep>;
                                };
 
-                               ab8505-regulators {
+                               regulator {
                                        ab8500_ldo_aux1 {
                                                regulator-name = "sensor_3v";
                                                regulator-min-microvolt = <3000000>;
index 5ddcbc1..42762bf 100644 (file)
                compatible = "samsung,eb535151vu";
        };
 
+       thermal-zones {
+               battery-thermal {
+                       /* This zone will be polled by the battery temperature code */
+                       polling-delay = <0>;
+                       polling-delay-passive = <0>;
+                       thermal-sensors = <&bat_therm>;
+               };
+       };
+
+       bat_therm: thermistor {
+               compatible = "samsung,1404-001221";
+               io-channels = <&gpadc 0x02>; /* BatTemp */
+               pullup-uv = <1800000>;
+               pullup-ohm = <230000>;
+               pulldown-ohm = <0>;
+               #thermal-sensor-cells = <0>;
+       };
+
        /* External LDO for eMMC LDO VMEM_3V3 controlled by GPIO6 */
        ldo_3v3_reg: regulator-gpio-ldo-3v3 {
                compatible = "regulator-fixed";
 
                prcmu@80157000 {
                        ab8500 {
-                               ab8500_usb {
+                               phy {
                                        pinctrl-names = "default", "sleep";
                                        pinctrl-0 = <&usb_a_1_default>;
                                        pinctrl-1 = <&usb_a_1_sleep>;
                                };
 
-                               ab8500-regulators {
+                               regulator {
                                        ab8500_ldo_aux1 {
                                                /* Used for VDD for sensors */
                                                regulator-name = "V-SENSORS-VDD";
                                                reg = <0x08>;
                                                mount-matrix = "0", "1", "0",
                                                               "-1", "0", "0",
-                                                              "0", "0", "-1";
+                                                              "0", "0", "1";
                                                vddio-supply = <&ab8500_ldo_aux2_reg>; // 1.8V
                                                vdd-supply = <&ab8500_ldo_aux1_reg>; // 3V
                                        };
index 9ec3f85..2a5bf54 100644 (file)
                compatible = "samsung,eb425161la";
        };
 
+       thermal-zones {
+               battery-thermal {
+                       /* This zone will be polled by the battery temperature code */
+                       polling-delay = <0>;
+                       polling-delay-passive = <0>;
+                       thermal-sensors = <&bat_therm>;
+               };
+       };
+
+       bat_therm: thermistor {
+               compatible = "samsung,1404-001221";
+               io-channels = <&gpadc 0x02>; /* BatTemp */
+               pullup-uv = <1800000>;
+               pullup-ohm = <230000>;
+               pulldown-ohm = <0>;
+               #thermal-sensor-cells = <0>;
+       };
+
        /* TI TXS0206 level translator for 2.9 V */
        sd_level_translator: regulator-gpio {
                compatible = "regulator-fixed";
 
                prcmu@80157000 {
                        ab8505 {
-                               ab8500_usb {
+                               phy {
                                        pinctrl-names = "default", "sleep";
                                        pinctrl-0 = <&usb_a_1_default>;
                                        pinctrl-1 = <&usb_a_1_sleep>;
                                };
 
-                               ab8505-regulators {
+                               regulator {
                                        ab8500_ldo_aux1 {
                                                /* Used for VDD for sensors */
                                                regulator-name = "AUX1";
index 580ca49..ce104f9 100644 (file)
                compatible = "samsung,eb485159lu";
        };
 
+       thermal-zones {
+               battery-thermal {
+                       /* This zone will be polled by the battery temperature code */
+                       polling-delay = <0>;
+                       polling-delay-passive = <0>;
+                       thermal-sensors = <&bat_therm>;
+               };
+       };
+
+       bat_therm: thermistor {
+               compatible = "samsung,1404-001221";
+               io-channels = <&gpadc 0x02>; /* BatTemp */
+               pullup-uv = <1800000>;
+               pullup-ohm = <230000>;
+               pulldown-ohm = <0>;
+               #thermal-sensor-cells = <0>;
+       };
+
        /* TI TXS0206 level translator for 2.9 V */
        sd_level_translator: regulator-gpio {
                compatible = "regulator-fixed";
 
                prcmu@80157000 {
                        ab8505 {
-                               ab8500_usb {
+                               phy {
                                        pinctrl-names = "default", "sleep";
                                        pinctrl-0 = <&usb_a_1_default>;
                                        pinctrl-1 = <&usb_a_1_sleep>;
                                };
 
-                               ab8505-regulators {
+                               regulator {
                                        ab8500_ldo_aux1 {
                                                /* Used for VDD for sensors */
                                                regulator-name = "AUX1";
index 9cce954..350bcfc 100644 (file)
@@ -29,7 +29,7 @@
                 */
                clockgen-a9@92b0000 {
                        compatible = "st,clkgen-c32";
-                       reg = <0x92b0000 0xffff>;
+                       reg = <0x92b0000 0x10000>;
 
                        clockgen_a9_pll: clockgen-a9-pll {
                                #clock-cells = <1>;
 
                                clocks = <&clk_sysin>;
                        };
-               };
 
-               /*
-                * ARM CPU related clocks.
-                */
-               clk_m_a9: clk-m-a9@92b0000 {
-                       #clock-cells = <0>;
-                       compatible = "st,stih407-clkgen-a9-mux";
-                       reg = <0x92b0000 0x10000>;
-
-                       clocks = <&clockgen_a9_pll 0>,
-                                <&clockgen_a9_pll 0>,
-                                <&clk_s_c0_flexgen 13>,
-                                <&clk_m_a9_ext2f_div2>;
+                       clk_m_a9: clk-m-a9 {
+                               #clock-cells = <0>;
+                               compatible = "st,stih407-clkgen-a9-mux";
 
+                               clocks = <&clockgen_a9_pll 0>,
+                                        <&clockgen_a9_pll 0>,
+                                        <&clk_s_c0_flexgen 13>,
+                                        <&clk_m_a9_ext2f_div2>;
 
-                       /*
-                        * ARM Peripheral clock for timers
-                        */
-                       arm_periph_clk: clk-m-a9-periphs {
-                               #clock-cells = <0>;
-                               compatible = "fixed-factor-clock";
+                               /*
+                                * ARM Peripheral clock for timers
+                                */
+                               arm_periph_clk: clk-m-a9-periphs {
+                                       #clock-cells = <0>;
+                                       compatible = "fixed-factor-clock";
 
-                               clocks = <&clk_m_a9>;
-                               clock-div = <2>;
-                               clock-mult = <1>;
+                                       clocks = <&clk_m_a9>;
+                                       clock-div = <2>;
+                                       clock-mult = <1>;
+                               };
                        };
                };
 
                        };
                };
 
-               clk_s_c0_quadfs: clk-s-c0-quadfs@9103000 {
-                       #clock-cells = <1>;
-                       compatible = "st,quadfs-pll";
-                       reg = <0x9103000 0x1000>;
-
-                       clocks = <&clk_sysin>;
-               };
-
                clk_s_c0: clockgen-c@9103000 {
                        compatible = "st,clkgen-c32";
                        reg = <0x9103000 0x1000>;
                                clocks = <&clk_sysin>;
                        };
 
+                       clk_s_c0_quadfs: clk-s-c0-quadfs {
+                               #clock-cells = <1>;
+                               compatible = "st,quadfs-pll";
+
+                               clocks = <&clk_sysin>;
+                       };
+
                        clk_s_c0_flexgen: clk-s-c0-flexgen {
                                #clock-cells = <1>;
                                compatible = "st,flexgen", "st,flexgen-stih407-c0";
                        };
                };
 
-               clk_s_d0_quadfs: clk-s-d0-quadfs@9104000 {
-                       #clock-cells = <1>;
-                       compatible = "st,quadfs-d0";
-                       reg = <0x9104000 0x1000>;
-
-                       clocks = <&clk_sysin>;
-               };
-
                clockgen-d0@9104000 {
                        compatible = "st,clkgen-c32";
                        reg = <0x9104000 0x1000>;
 
+                       clk_s_d0_quadfs: clk-s-d0-quadfs {
+                               #clock-cells = <1>;
+                               compatible = "st,quadfs-d0";
+
+                               clocks = <&clk_sysin>;
+                       };
+
                        clk_s_d0_flexgen: clk-s-d0-flexgen {
                                #clock-cells = <1>;
                                compatible = "st,flexgen", "st,flexgen-stih407-d0";
                        };
                };
 
-               clk_s_d2_quadfs: clk-s-d2-quadfs@9106000 {
-                       #clock-cells = <1>;
-                       compatible = "st,quadfs-d2";
-                       reg = <0x9106000 0x1000>;
-
-                       clocks = <&clk_sysin>;
-               };
-
                clockgen-d2@9106000 {
                        compatible = "st,clkgen-c32";
                        reg = <0x9106000 0x1000>;
 
+                       clk_s_d2_quadfs: clk-s-d2-quadfs {
+                               #clock-cells = <1>;
+                               compatible = "st,quadfs-d2";
+
+                               clocks = <&clk_sysin>;
+                       };
+
                        clk_s_d2_flexgen: clk-s-d2-flexgen {
                                #clock-cells = <1>;
                                compatible = "st,flexgen", "st,flexgen-stih407-d2";
                        };
                };
 
-               clk_s_d3_quadfs: clk-s-d3-quadfs@9107000 {
-                       #clock-cells = <1>;
-                       compatible = "st,quadfs-d3";
-                       reg = <0x9107000 0x1000>;
-
-                       clocks = <&clk_sysin>;
-               };
-
                clockgen-d3@9107000 {
                        compatible = "st,clkgen-c32";
                        reg = <0x9107000 0x1000>;
 
+                       clk_s_d3_quadfs: clk-s-d3-quadfs {
+                               #clock-cells = <1>;
+                               compatible = "st,quadfs-d3";
+
+                               clocks = <&clk_sysin>;
+                       };
+
                        clk_s_d3_flexgen: clk-s-d3-flexgen {
                                #clock-cells = <1>;
                                compatible = "st,flexgen", "st,flexgen-stih407-d3";
index 21f3347..1713f78 100644 (file)
                status = "okay";
        };
 
-       soc {
-               #address-cells = <1>;
-               #size-cells = <1>;
-               interrupt-parent = <&intc>;
+       restart: restart-controller {
+               compatible = "st,stih407-restart";
+               st,syscfg = <&syscfg_sbc_reg>;
+               status = "okay";
+       };
+
+       powerdown: powerdown-controller {
+               compatible = "st,stih407-powerdown";
+               #reset-cells = <1>;
+       };
+
+       softreset: softreset-controller {
+               compatible = "st,stih407-softreset";
+               #reset-cells = <1>;
+       };
+
+       picophyreset: picophyreset-controller {
+               compatible = "st,stih407-picophyreset";
+               #reset-cells = <1>;
+       };
+
+       irq-syscfg {
+               compatible    = "st,stih407-irq-syscfg";
+               st,syscfg     = <&syscfg_core>;
+               st,irq-device = <ST_IRQ_SYSCFG_PMU_0>,
+                               <ST_IRQ_SYSCFG_PMU_1>;
+               st,fiq-device = <ST_IRQ_SYSCFG_DISABLED>,
+                               <ST_IRQ_SYSCFG_DISABLED>;
+       };
+
+       usb2_picophy0: phy1 {
+               compatible = "st,stih407-usb2-phy";
+               #phy-cells = <0>;
+               st,syscfg = <&syscfg_core 0x100 0xf4>;
+               resets = <&softreset STIH407_PICOPHY_SOFTRESET>,
+                        <&picophyreset STIH407_PICOPHY2_RESET>;
+               reset-names = "global", "port";
+       };
+
+       miphy28lp_phy: miphy28lp {
+               compatible = "st,miphy28lp-phy";
+               st,syscfg = <&syscfg_core>;
+               #address-cells  = <1>;
+               #size-cells     = <1>;
                ranges;
-               compatible = "simple-bus";
 
-               restart: restart-controller@0 {
-                       compatible = "st,stih407-restart";
-                       reg = <0 0>;
-                       st,syscfg = <&syscfg_sbc_reg>;
-                       status = "okay";
-               };
+               phy_port0: port@9b22000 {
+                       reg = <0x9b22000 0xff>,
+                             <0x9b09000 0xff>,
+                             <0x9b04000 0xff>;
+                       reg-names = "sata-up",
+                                   "pcie-up",
+                                   "pipew";
+
+                       st,syscfg = <0x114 0x818 0xe0 0xec>;
+                       #phy-cells = <1>;
 
-               powerdown: powerdown-controller@0 {
-                       compatible = "st,stih407-powerdown";
-                       reg = <0 0>;
-                       #reset-cells = <1>;
+                       reset-names = "miphy-sw-rst";
+                       resets = <&softreset STIH407_MIPHY0_SOFTRESET>;
                };
 
-               softreset: softreset-controller@0 {
-                       compatible = "st,stih407-softreset";
-                       reg = <0 0>;
-                       #reset-cells = <1>;
+               phy_port1: port@9b2a000 {
+                       reg = <0x9b2a000 0xff>,
+                             <0x9b19000 0xff>,
+                             <0x9b14000 0xff>;
+                       reg-names = "sata-up",
+                                   "pcie-up",
+                                   "pipew";
+
+                       st,syscfg = <0x118 0x81c 0xe4 0xf0>;
+
+                       #phy-cells = <1>;
+
+                       reset-names = "miphy-sw-rst";
+                       resets = <&softreset STIH407_MIPHY1_SOFTRESET>;
                };
 
-               picophyreset: picophyreset-controller@0 {
-                       compatible = "st,stih407-picophyreset";
-                       reg = <0 0>;
-                       #reset-cells = <1>;
+               phy_port2: port@8f95000 {
+                       reg = <0x8f95000 0xff>,
+                             <0x8f90000 0xff>;
+                       reg-names = "pipew",
+                                   "usb3-up";
+
+                       st,syscfg = <0x11c 0x820>;
+
+                       #phy-cells = <1>;
+
+                       reset-names = "miphy-sw-rst";
+                       resets = <&softreset STIH407_MIPHY2_SOFTRESET>;
                };
+       };
+
+       st231_gp0: st231-gp0 {
+               compatible      = "st,st231-rproc";
+               memory-region   = <&gp0_reserved>;
+               resets          = <&softreset STIH407_ST231_GP0_SOFTRESET>;
+               reset-names     = "sw_reset";
+               clocks          = <&clk_s_c0_flexgen CLK_ST231_GP_0>;
+               clock-frequency = <600000000>;
+               st,syscfg       = <&syscfg_core 0x22c>;
+               #mbox-cells = <1>;
+               mbox-names = "vq0_rx", "vq0_tx", "vq1_rx", "vq1_tx";
+               mboxes = <&mailbox0 0 2>, <&mailbox2 0 1>, <&mailbox0 0 3>, <&mailbox2 0 0>;
+       };
+
+       st231_delta: st231-delta {
+               compatible      = "st,st231-rproc";
+               memory-region   = <&delta_reserved>;
+               resets          = <&softreset STIH407_ST231_DMU_SOFTRESET>;
+               reset-names     = "sw_reset";
+               clocks          = <&clk_s_c0_flexgen CLK_ST231_DMU>;
+               clock-frequency = <600000000>;
+               st,syscfg       = <&syscfg_core 0x224>;
+               #mbox-cells = <1>;
+               mbox-names = "vq0_rx", "vq0_tx", "vq1_rx", "vq1_tx";
+               mboxes = <&mailbox0 0 0>, <&mailbox3 0 1>, <&mailbox0 0 1>, <&mailbox3 0 0>;
+       };
+
+       delta0 {
+               compatible = "st,st-delta";
+               clock-names = "delta",
+                             "delta-st231",
+                             "delta-flash-promip";
+               clocks = <&clk_s_c0_flexgen CLK_VID_DMU>,
+                        <&clk_s_c0_flexgen CLK_ST231_DMU>,
+                        <&clk_s_c0_flexgen CLK_FLASH_PROMIP>;
+       };
+
+       soc {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               interrupt-parent = <&intc>;
+               ranges;
+               compatible = "simple-bus";
 
                syscfg_sbc: sbc-syscfg@9620000 {
                        compatible = "st,stih407-sbc-syscfg", "syscon";
                        reg = <0x94b5100 0x1000>;
                };
 
-               irq-syscfg@0 {
-                       compatible    = "st,stih407-irq-syscfg";
-                       reg = <0 0>;
-                       st,syscfg     = <&syscfg_core>;
-                       st,irq-device = <ST_IRQ_SYSCFG_PMU_0>,
-                                       <ST_IRQ_SYSCFG_PMU_1>;
-                       st,fiq-device = <ST_IRQ_SYSCFG_DISABLED>,
-                                       <ST_IRQ_SYSCFG_DISABLED>;
-               };
-
                /* Display */
                vtg_main: sti-vtg-main@8d02800 {
                        compatible = "st,vtg";
                        status = "disabled";
                };
 
-               usb2_picophy0: phy1@0 {
-                       compatible = "st,stih407-usb2-phy";
-                       reg = <0 0>;
-                       #phy-cells = <0>;
-                       st,syscfg = <&syscfg_core 0x100 0xf4>;
-                       resets = <&softreset STIH407_PICOPHY_SOFTRESET>,
-                                <&picophyreset STIH407_PICOPHY2_RESET>;
-                       reset-names = "global", "port";
-               };
-
-               miphy28lp_phy: miphy28lp@0 {
-                       compatible = "st,miphy28lp-phy";
-                       st,syscfg = <&syscfg_core>;
-                       #address-cells  = <1>;
-                       #size-cells     = <1>;
-                       ranges;
-                       reg = <0 0>;
-
-                       phy_port0: port@9b22000 {
-                               reg = <0x9b22000 0xff>,
-                                     <0x9b09000 0xff>,
-                                     <0x9b04000 0xff>;
-                               reg-names = "sata-up",
-                                           "pcie-up",
-                                           "pipew";
-
-                               st,syscfg = <0x114 0x818 0xe0 0xec>;
-                               #phy-cells = <1>;
-
-                               reset-names = "miphy-sw-rst";
-                               resets = <&softreset STIH407_MIPHY0_SOFTRESET>;
-                       };
-
-                       phy_port1: port@9b2a000 {
-                               reg = <0x9b2a000 0xff>,
-                                     <0x9b19000 0xff>,
-                                     <0x9b14000 0xff>;
-                               reg-names = "sata-up",
-                                           "pcie-up",
-                                           "pipew";
-
-                               st,syscfg = <0x118 0x81c 0xe4 0xf0>;
-
-                               #phy-cells = <1>;
-
-                               reset-names = "miphy-sw-rst";
-                               resets = <&softreset STIH407_MIPHY1_SOFTRESET>;
-                       };
-
-                       phy_port2: port@8f95000 {
-                               reg = <0x8f95000 0xff>,
-                                     <0x8f90000 0xff>;
-                               reg-names = "pipew",
-                                           "usb3-up";
-
-                               st,syscfg = <0x11c 0x820>;
-
-                               #phy-cells = <1>;
-
-                               reset-names = "miphy-sw-rst";
-                               resets = <&softreset STIH407_MIPHY2_SOFTRESET>;
-                       };
-               };
-
                spi@9840000 {
                        compatible = "st,comms-ssc4-spi";
                        reg = <0x9840000 0x110>;
                        status          = "okay";
                };
 
-               st231_gp0: st231-gp0@0 {
-                       compatible      = "st,st231-rproc";
-                       reg             = <0 0>;
-                       memory-region   = <&gp0_reserved>;
-                       resets          = <&softreset STIH407_ST231_GP0_SOFTRESET>;
-                       reset-names     = "sw_reset";
-                       clocks          = <&clk_s_c0_flexgen CLK_ST231_GP_0>;
-                       clock-frequency = <600000000>;
-                       st,syscfg       = <&syscfg_core 0x22c>;
-                       #mbox-cells = <1>;
-                       mbox-names = "vq0_rx", "vq0_tx", "vq1_rx", "vq1_tx";
-                       mboxes = <&mailbox0 0 2>, <&mailbox2 0 1>, <&mailbox0 0 3>, <&mailbox2 0 0>;
-               };
-
-               st231_delta: st231-delta@0 {
-                       compatible      = "st,st231-rproc";
-                       reg             = <0 0>;
-                       memory-region   = <&delta_reserved>;
-                       resets          = <&softreset STIH407_ST231_DMU_SOFTRESET>;
-                       reset-names     = "sw_reset";
-                       clocks          = <&clk_s_c0_flexgen CLK_ST231_DMU>;
-                       clock-frequency = <600000000>;
-                       st,syscfg       = <&syscfg_core 0x224>;
-                       #mbox-cells = <1>;
-                       mbox-names = "vq0_rx", "vq0_tx", "vq1_rx", "vq1_tx";
-                       mboxes = <&mailbox0 0 0>, <&mailbox3 0 1>, <&mailbox0 0 1>, <&mailbox3 0 0>;
-               };
-
                /* fdma audio */
                fdma0: dma-controller@8e20000 {
                        compatible = "st,stih407-fdma-mpe31-11", "st,slim-rproc";
 
                        status = "disabled";
                };
-
-               delta0@0 {
-                       compatible = "st,st-delta";
-                       reg = <0 0>;
-                       clock-names = "delta",
-                                     "delta-st231",
-                                     "delta-flash-promip";
-                       clocks = <&clk_s_c0_flexgen CLK_VID_DMU>,
-                                <&clk_s_c0_flexgen CLK_ST231_DMU>,
-                                <&clk_s_c0_flexgen CLK_FLASH_PROMIP>;
-               };
        };
 };
index 9d3b118..538ff98 100644 (file)
                ethernet0 = &ethernet0;
        };
 
+       usb2_picophy1: phy2 {
+               status = "okay";
+       };
+
+       usb2_picophy2: phy3 {
+               status = "okay";
+       };
+
        soc {
 
                mmc0: sdhci@9060000 {
                        sd-uhs-ddr50;
                };
 
-               usb2_picophy1: phy2@0 {
-                       status = "okay";
-               };
-
-               usb2_picophy2: phy3@0 {
-                       status = "okay";
-               };
-
                ohci0: usb@9a03c00 {
                        status = "okay";
                };
index 9d579c1..26d93f2 100644 (file)
                };
        };
 
+       miphy28lp_phy: miphy28lp {
+
+               phy_port1: port@9b2a000 {
+                       st,osc-force-ext;
+               };
+       };
+
+       usb2_picophy1: phy2 {
+               status = "okay";
+       };
+
+       usb2_picophy2: phy3 {
+               status = "okay";
+       };
+
        soc {
                /* Low speed expansion connector */
                uart0: serial@9830000 {
                        status = "okay";
                };
 
-               usb2_picophy1: phy2@0 {
-                       status = "okay";
-               };
-
-               usb2_picophy2: phy3@0 {
-                       status = "okay";
-               };
-
                ohci0: usb@9a03c00 {
                        status = "okay";
                };
                        status = "okay";
                };
 
-               miphy28lp_phy: miphy28lp@0 {
-
-                       phy_port1: port@9b2a000 {
-                               st,osc-force-ext;
-                       };
-               };
-
                sata1: sata@9b28000 {
                        status = "okay";
                };
index 6b0e6d4..abac98a 100644 (file)
@@ -32,7 +32,7 @@
                 */
                clockgen-a9@92b0000 {
                        compatible = "st,clkgen-c32";
-                       reg = <0x92b0000 0xffff>;
+                       reg = <0x92b0000 0x10000>;
 
                        clockgen_a9_pll: clockgen-a9-pll {
                                #clock-cells = <1>;
 
                                clocks = <&clk_sysin>;
                        };
-               };
 
-               /*
-                * ARM CPU related clocks.
-                */
-               clk_m_a9: clk-m-a9@92b0000 {
-                       #clock-cells = <0>;
-                       compatible = "st,stih407-clkgen-a9-mux", "st,clkgen-mux";
-                       reg = <0x92b0000 0x10000>;
-
-                       clocks = <&clockgen_a9_pll 0>,
-                                <&clockgen_a9_pll 0>,
-                                <&clk_s_c0_flexgen 13>,
-                                <&clk_m_a9_ext2f_div2>;
                        /*
-                        * ARM Peripheral clock for timers
+                        * ARM CPU related clocks.
                         */
-                       arm_periph_clk: clk-m-a9-periphs {
+                       clk_m_a9: clk-m-a9 {
                                #clock-cells = <0>;
-                               compatible = "fixed-factor-clock";
-                               clocks = <&clk_m_a9>;
-                               clock-div = <2>;
-                               clock-mult = <1>;
+                               compatible = "st,stih407-clkgen-a9-mux", "st,clkgen-mux";
+
+                               clocks = <&clockgen_a9_pll 0>,
+                                        <&clockgen_a9_pll 0>,
+                                        <&clk_s_c0_flexgen 13>,
+                                        <&clk_m_a9_ext2f_div2>;
+
+                               /*
+                                * ARM Peripheral clock for timers
+                                */
+                               arm_periph_clk: clk-m-a9-periphs {
+                                       #clock-cells = <0>;
+                                       compatible = "fixed-factor-clock";
+                                       clocks = <&clk_m_a9>;
+                                       clock-div = <2>;
+                                       clock-mult = <1>;
+                               };
                        };
                };
 
                        };
                };
 
-               clk_s_c0_quadfs: clk-s-c0-quadfs@9103000 {
-                       #clock-cells = <1>;
-                       compatible = "st,quadfs-pll";
-                       reg = <0x9103000 0x1000>;
-
-                       clocks = <&clk_sysin>;
-               };
-
                clk_s_c0: clockgen-c@9103000 {
                        compatible = "st,clkgen-c32";
                        reg = <0x9103000 0x1000>;
                                clocks = <&clk_sysin>;
                        };
 
+                       clk_s_c0_quadfs: clk-s-c0-quadfs {
+                               #clock-cells = <1>;
+                               compatible = "st,quadfs-pll";
+
+                               clocks = <&clk_sysin>;
+                       };
+
                        clk_s_c0_flexgen: clk-s-c0-flexgen {
                                #clock-cells = <1>;
                                compatible = "st,flexgen", "st,flexgen-stih410-c0";
                        };
                };
 
-               clk_s_d0_quadfs: clk-s-d0-quadfs@9104000 {
-                       #clock-cells = <1>;
-                       compatible = "st,quadfs-d0";
-                       reg = <0x9104000 0x1000>;
-
-                       clocks = <&clk_sysin>;
-               };
-
                clockgen-d0@9104000 {
                        compatible = "st,clkgen-c32";
                        reg = <0x9104000 0x1000>;
 
+                       clk_s_d0_quadfs: clk-s-d0-quadfs {
+                               #clock-cells = <1>;
+                               compatible = "st,quadfs-d0";
+
+                               clocks = <&clk_sysin>;
+                       };
+
                        clk_s_d0_flexgen: clk-s-d0-flexgen {
                                #clock-cells = <1>;
                                compatible = "st,flexgen", "st,flexgen-stih410-d0";
                        };
                };
 
-               clk_s_d2_quadfs: clk-s-d2-quadfs@9106000 {
-                       #clock-cells = <1>;
-                       compatible = "st,quadfs-d2";
-                       reg = <0x9106000 0x1000>;
-
-                       clocks = <&clk_sysin>;
-               };
-
                clockgen-d2@9106000 {
                        compatible = "st,clkgen-c32";
                        reg = <0x9106000 0x1000>;
 
+                       clk_s_d2_quadfs: clk-s-d2-quadfs {
+                               #clock-cells = <1>;
+                               compatible = "st,quadfs-d2";
+
+                               clocks = <&clk_sysin>;
+                       };
+
                        clk_s_d2_flexgen: clk-s-d2-flexgen {
                                #clock-cells = <1>;
                                compatible = "st,flexgen", "st,flexgen-stih407-d2";
                        };
                };
 
-               clk_s_d3_quadfs: clk-s-d3-quadfs@9107000 {
-                       #clock-cells = <1>;
-                       compatible = "st,quadfs-d3";
-                       reg = <0x9107000 0x1000>;
-
-                       clocks = <&clk_sysin>;
-               };
-
                clockgen-d3@9107000 {
                        compatible = "st,clkgen-c32";
                        reg = <0x9107000 0x1000>;
 
+                       clk_s_d3_quadfs: clk-s-d3-quadfs {
+                               #clock-cells = <1>;
+                               compatible = "st,quadfs-d3";
+
+                               clocks = <&clk_sysin>;
+                       };
+
                        clk_s_d3_flexgen: clk-s-d3-flexgen {
                                #clock-cells = <1>;
                                compatible = "st,flexgen", "st,flexgen-stih407-d3";
index 6d84701..ce2f62c 100644 (file)
                bdisp0 = &bdisp0;
        };
 
-       soc {
-               usb2_picophy1: phy2@0 {
-                       compatible = "st,stih407-usb2-phy";
-                       reg = <0 0>;
-                       #phy-cells = <0>;
-                       st,syscfg = <&syscfg_core 0xf8 0xf4>;
-                       resets = <&softreset STIH407_PICOPHY_SOFTRESET>,
-                                <&picophyreset STIH407_PICOPHY0_RESET>;
-                       reset-names = "global", "port";
-
-                       status = "disabled";
-               };
+       usb2_picophy1: phy2 {
+               compatible = "st,stih407-usb2-phy";
+               #phy-cells = <0>;
+               st,syscfg = <&syscfg_core 0xf8 0xf4>;
+               resets = <&softreset STIH407_PICOPHY_SOFTRESET>,
+                        <&picophyreset STIH407_PICOPHY0_RESET>;
+               reset-names = "global", "port";
+
+               status = "disabled";
+       };
 
-               usb2_picophy2: phy3@0 {
-                       compatible = "st,stih407-usb2-phy";
-                       reg = <0 0>;
-                       #phy-cells = <0>;
-                       st,syscfg = <&syscfg_core 0xfc 0xf4>;
-                       resets = <&softreset STIH407_PICOPHY_SOFTRESET>,
-                                <&picophyreset STIH407_PICOPHY1_RESET>;
-                       reset-names = "global", "port";
+       usb2_picophy2: phy3 {
+               compatible = "st,stih407-usb2-phy";
+               #phy-cells = <0>;
+               st,syscfg = <&syscfg_core 0xfc 0xf4>;
+               resets = <&softreset STIH407_PICOPHY_SOFTRESET>,
+                        <&picophyreset STIH407_PICOPHY1_RESET>;
+               reset-names = "global", "port";
 
-                       status = "disabled";
-               };
+               status = "disabled";
+       };
 
+       soc {
                ohci0: usb@9a03c00 {
                        compatible = "st,st-ohci-300x";
                        reg = <0x9a03c00 0x100>;
                        interrupts = <GIC_SPI 205 IRQ_TYPE_EDGE_RISING>;
                };
 
-               delta0@0 {
-                       compatible = "st,st-delta";
-                       clock-names = "delta",
-                                     "delta-st231",
-                                     "delta-flash-promip";
-                       clocks = <&clk_s_c0_flexgen CLK_VID_DMU>,
-                                <&clk_s_c0_flexgen CLK_ST231_DMU>,
-                                <&clk_s_c0_flexgen CLK_FLASH_PROMIP>;
-               };
-
                sti-cec@94a087c {
                        compatible = "st,stih-cec";
                        reg = <0x94a087c 0x64>;
index b66e2b2..d21bcc7 100644 (file)
                };
        };
 
+       miphy28lp_phy: miphy28lp {
+
+               phy_port0: port@9b22000 {
+                       st,osc-rdy;
+               };
+
+               phy_port1: port@9b2a000 {
+                       st,osc-force-ext;
+               };
+       };
+
        soc {
                sbc_serial0: serial@9530000 {
                        status = "okay";
                        non-removable;
                };
 
-               miphy28lp_phy: miphy28lp@0 {
-
-                       phy_port0: port@9b22000 {
-                               st,osc-rdy;
-                       };
-
-                       phy_port1: port@9b2a000 {
-                               st,osc-force-ext;
-                       };
-               };
-
                st_dwc3: dwc3@8f94000 {
                        status = "okay";
                };
index e84c476..e1749e9 100644 (file)
@@ -32,7 +32,7 @@
                 */
                clockgen-a9@92b0000 {
                        compatible = "st,clkgen-c32";
-                       reg = <0x92b0000 0xffff>;
+                       reg = <0x92b0000 0x10000>;
 
                        clockgen_a9_pll: clockgen-a9-pll {
                                #clock-cells = <1>;
 
                                clocks = <&clk_sysin>;
                        };
-               };
-
-               /*
-                * ARM CPU related clocks.
-                */
-               clk_m_a9: clk-m-a9@92b0000 {
-                       #clock-cells = <0>;
-                       compatible = "st,stih407-clkgen-a9-mux", "st,clkgen-mux";
-                       reg = <0x92b0000 0x10000>;
-
-                       clocks = <&clockgen_a9_pll 0>,
-                                <&clockgen_a9_pll 0>,
-                                <&clk_s_c0_flexgen 13>,
-                                <&clk_m_a9_ext2f_div2>;
 
                        /*
-                        * ARM Peripheral clock for timers
+                        * ARM CPU related clocks.
                         */
-                       arm_periph_clk: clk-m-a9-periphs {
+                       clk_m_a9: clk-m-a9 {
                                #clock-cells = <0>;
-                               compatible = "fixed-factor-clock";
-                               clocks = <&clk_m_a9>;
-                               clock-div = <2>;
-                               clock-mult = <1>;
+                               compatible = "st,stih407-clkgen-a9-mux", "st,clkgen-mux";
+
+                               clocks = <&clockgen_a9_pll 0>,
+                                        <&clockgen_a9_pll 0>,
+                                        <&clk_s_c0_flexgen 13>,
+                                        <&clk_m_a9_ext2f_div2>;
+
+                               /*
+                                * ARM Peripheral clock for timers
+                                */
+                               arm_periph_clk: clk-m-a9-periphs {
+                                       #clock-cells = <0>;
+                                       compatible = "fixed-factor-clock";
+                                       clocks = <&clk_m_a9>;
+                                       clock-div = <2>;
+                                       clock-mult = <1>;
+                               };
                        };
                };
 
                        };
                };
 
-               clk_s_c0_quadfs: clk-s-c0-quadfs@9103000 {
-                       #clock-cells = <1>;
-                       compatible = "st,quadfs-pll";
-                       reg = <0x9103000 0x1000>;
-
-                       clocks = <&clk_sysin>;
-               };
-
                clk_s_c0: clockgen-c@9103000 {
                        compatible = "st,clkgen-c32";
                        reg = <0x9103000 0x1000>;
                                clocks = <&clk_sysin>;
                        };
 
+                       clk_s_c0_quadfs: clk-s-c0-quadfs {
+                               #clock-cells = <1>;
+                               compatible = "st,quadfs-pll";
+
+                               clocks = <&clk_sysin>;
+                       };
+
                        clk_s_c0_flexgen: clk-s-c0-flexgen {
                                #clock-cells = <1>;
                                compatible = "st,flexgen", "st,flexgen-stih418-c0";
                        };
                };
 
-               clk_s_d0_quadfs: clk-s-d0-quadfs@9104000 {
-                       #clock-cells = <1>;
-                       compatible = "st,quadfs-d0";
-                       reg = <0x9104000 0x1000>;
-
-                       clocks = <&clk_sysin>;
-               };
-
                clockgen-d0@9104000 {
                        compatible = "st,clkgen-c32";
                        reg = <0x9104000 0x1000>;
 
+                       clk_s_d0_quadfs: clk-s-d0-quadfs {
+                               #clock-cells = <1>;
+                               compatible = "st,quadfs-d0";
+
+                               clocks = <&clk_sysin>;
+                       };
+
                        clk_s_d0_flexgen: clk-s-d0-flexgen {
                                #clock-cells = <1>;
                                compatible = "st,flexgen", "st,flexgen-stih410-d0";
                        };
                };
 
-               clk_s_d2_quadfs: clk-s-d2-quadfs@9106000 {
-                       #clock-cells = <1>;
-                       compatible = "st,quadfs-d2";
-                       reg = <0x9106000 0x1000>;
-
-                       clocks = <&clk_sysin>;
-               };
-
                clockgen-d2@9106000 {
                        compatible = "st,clkgen-c32";
                        reg = <0x9106000 0x1000>;
 
+                       clk_s_d2_quadfs: clk-s-d2-quadfs {
+                               #clock-cells = <1>;
+                               compatible = "st,quadfs-d2";
+
+                               clocks = <&clk_sysin>;
+                       };
+
                        clk_s_d2_flexgen: clk-s-d2-flexgen {
                                #clock-cells = <1>;
                                compatible = "st,flexgen", "st,flexgen-stih418-d2";
                        };
                };
 
-               clk_s_d3_quadfs: clk-s-d3-quadfs@9107000 {
-                       #clock-cells = <1>;
-                       compatible = "st,quadfs-d3";
-                       reg = <0x9107000 0x1000>;
-
-                       clocks = <&clk_sysin>;
-               };
-
                clockgen-d3@9107000 {
                        compatible = "st,clkgen-c32";
                        reg = <0x9107000 0x1000>;
 
+                       clk_s_d3_quadfs: clk-s-d3-quadfs {
+                               #clock-cells = <1>;
+                               compatible = "st,quadfs-d3";
+
+                               clocks = <&clk_sysin>;
+                       };
+
                        clk_s_d3_flexgen: clk-s-d3-flexgen {
                                #clock-cells = <1>;
                                compatible = "st,flexgen", "st,flexgen-stih407-d3";
index 97eda43..b35b9b7 100644 (file)
                };
        };
 
+       usb2_picophy1: phy2 {
+               compatible = "st,stih407-usb2-phy";
+               #phy-cells = <0>;
+               st,syscfg = <&syscfg_core 0xf8 0xf4>;
+               resets = <&softreset STIH407_PICOPHY_SOFTRESET>,
+                        <&picophyreset STIH407_PICOPHY0_RESET>;
+               reset-names = "global", "port";
+       };
+
+       usb2_picophy2: phy3 {
+               compatible = "st,stih407-usb2-phy";
+               #phy-cells = <0>;
+               st,syscfg = <&syscfg_core 0xfc 0xf4>;
+               resets = <&softreset STIH407_PICOPHY_SOFTRESET>,
+                        <&picophyreset STIH407_PICOPHY1_RESET>;
+               reset-names = "global", "port";
+       };
+
        soc {
                rng11: rng@8a8a000 {
                        status = "disabled";
                };
 
-               usb2_picophy1: phy2@0 {
-                       compatible = "st,stih407-usb2-phy";
-                       reg = <0 0>;
-                       #phy-cells = <0>;
-                       st,syscfg = <&syscfg_core 0xf8 0xf4>;
-                       resets = <&softreset STIH407_PICOPHY_SOFTRESET>,
-                                <&picophyreset STIH407_PICOPHY0_RESET>;
-                       reset-names = "global", "port";
-               };
-
-               usb2_picophy2: phy3@0 {
-                       compatible = "st,stih407-usb2-phy";
-                       reg = <0 0>;
-                       #phy-cells = <0>;
-                       st,syscfg = <&syscfg_core 0xfc 0xf4>;
-                       resets = <&softreset STIH407_PICOPHY_SOFTRESET>,
-                                <&picophyreset STIH407_PICOPHY1_RESET>;
-                       reset-names = "global", "port";
-               };
-
                ohci0: usb@9a03c00 {
                        compatible = "st,st-ohci-300x";
                        reg = <0x9a03c00 0x100>;
index d051f08..4c72ded 100644 (file)
                };
        };
 
+       miphy28lp_phy: miphy28lp {
+
+               phy_port0: port@9b22000 {
+                       st,osc-rdy;
+               };
+
+               phy_port1: port@9b2a000 {
+                       st,osc-force-ext;
+               };
+       };
+
        soc {
                sbc_serial0: serial@9530000 {
                        status = "okay";
                        st,i2c-min-sda-pulse-width-us = <5>;
                };
 
-               miphy28lp_phy: miphy28lp@0 {
-
-                       phy_port0: port@9b22000 {
-                               st,osc-rdy;
-                       };
-
-                       phy_port1: port@9b2a000 {
-                               st,osc-force-ext;
-                       };
-               };
-
                st_dwc3: dwc3@8f94000 {
                        status = "okay";
                };
index cb46326..0d98aca 100644 (file)
        };
 };
 
+&timers5 {
+       /* Override timer5 to act as clockevent */
+       compatible = "st,stm32-timer";
+       interrupts = <50>;
+       status = "okay";
+       /delete-property/#address-cells;
+       /delete-property/#size-cells;
+       /delete-property/clock-names;
+       /delete-node/pwm;
+       /delete-node/timer@4;
+};
+
 &usart1 {
        pinctrl-0 = <&usart1_pins_a>;
        pinctrl-names = "default";
index 327613f..a293e65 100644 (file)
        bus-width = <4>;
 };
 
+&timers5 {
+       /* Override timer5 to act as clockevent */
+       compatible = "st,stm32-timer";
+       interrupts = <50>;
+       status = "okay";
+       /delete-property/#address-cells;
+       /delete-property/#size-cells;
+       /delete-property/clock-names;
+       /delete-node/pwm;
+       /delete-node/timer@4;
+};
+
 &usart1 {
        pinctrl-0 = <&usart1_pins_a>;
        pinctrl-names = "default";
index 6435e09..3b81228 100644 (file)
        };
 };
 
+&timers5 {
+       /* Override timer5 to act as clockevent */
+       compatible = "st,stm32-timer";
+       interrupts = <50>;
+       status = "okay";
+       /delete-property/#address-cells;
+       /delete-property/#size-cells;
+       /delete-property/clock-names;
+       /delete-node/pwm;
+       /delete-node/timer@4;
+};
+
 &usart1 {
        pinctrl-0 = <&usart1_pins_a>;
        pinctrl-names = "default";
index 8748d58..c31ceb8 100644 (file)
                        };
                };
 
-               timer2: timer@40000000 {
-                       compatible = "st,stm32-timer";
-                       reg = <0x40000000 0x400>;
-                       interrupts = <28>;
-                       clocks = <&rcc 0 STM32F4_APB1_CLOCK(TIM2)>;
-                       status = "disabled";
-               };
-
                timers2: timers@40000000 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        };
                };
 
-               timer3: timer@40000400 {
-                       compatible = "st,stm32-timer";
-                       reg = <0x40000400 0x400>;
-                       interrupts = <29>;
-                       clocks = <&rcc 0 STM32F4_APB1_CLOCK(TIM3)>;
-                       status = "disabled";
-               };
-
                timers3: timers@40000400 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        };
                };
 
-               timer4: timer@40000800 {
-                       compatible = "st,stm32-timer";
-                       reg = <0x40000800 0x400>;
-                       interrupts = <30>;
-                       clocks = <&rcc 0 STM32F4_APB1_CLOCK(TIM4)>;
-                       status = "disabled";
-               };
-
                timers4: timers@40000800 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        };
                };
 
-               timer5: timer@40000c00 {
-                       compatible = "st,stm32-timer";
-                       reg = <0x40000c00 0x400>;
-                       interrupts = <50>;
-                       clocks = <&rcc 0 STM32F4_APB1_CLOCK(TIM5)>;
-               };
-
                timers5: timers@40000c00 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        };
                };
 
-               timer6: timer@40001000 {
-                       compatible = "st,stm32-timer";
-                       reg = <0x40001000 0x400>;
-                       interrupts = <54>;
-                       clocks = <&rcc 0 STM32F4_APB1_CLOCK(TIM6)>;
-                       status = "disabled";
-               };
-
                timers6: timers@40001000 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        };
                };
 
-               timer7: timer@40001400 {
-                       compatible = "st,stm32-timer";
-                       reg = <0x40001400 0x400>;
-                       interrupts = <55>;
-                       clocks = <&rcc 0 STM32F4_APB1_CLOCK(TIM7)>;
-                       status = "disabled";
-               };
-
                timers7: timers@40001400 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "disabled";
                };
 
+               dma2d: dma2d@4002b000 {
+                       compatible = "st,stm32-dma2d";
+                       reg = <0x4002b000 0xc00>;
+                       interrupts = <90>;
+                       resets = <&rcc STM32F4_AHB1_RESET(DMA2D)>;
+                       clocks = <&rcc 0 STM32F4_AHB1_CLOCK(DMA2D)>;
+                       clock-names = "dma2d";
+                       status = "disabled";
+               };
+
                usbotg_hs: usb@40040000 {
                        compatible = "snps,dwc2";
                        reg = <0x40040000 0x40000>;
index 30905ce..5a0daf8 100644 (file)
        clock-frequency = <8000000>;
 };
 
+&dma2d {
+       status = "okay";
+};
+
 &dsi {
        #address-cells = <1>;
        #size-cells = <0>;
        bus-width = <4>;
 };
 
+&timers5 {
+       /* Override timer5 to act as clockevent */
+       compatible = "st,stm32-timer";
+       interrupts = <50>;
+       status = "okay";
+       /delete-property/#address-cells;
+       /delete-property/#size-cells;
+       /delete-property/clock-names;
+       /delete-node/pwm;
+       /delete-node/timer@4;
+};
+
 &usart3 {
        pinctrl-0 = <&usart3_pins_a>;
        pinctrl-names = "default";
index 569d23c..c11616e 100644 (file)
        bus-width = <4>;
 };
 
+&timers5 {
+       /* Override timer5 to act as clockevent */
+       compatible = "st,stm32-timer";
+       interrupts = <50>;
+       status = "okay";
+       /delete-property/#address-cells;
+       /delete-property/#size-cells;
+       /delete-property/clock-names;
+       /delete-node/pwm;
+       /delete-node/timer@4;
+};
+
 &usart1 {
        pinctrl-0 = <&usart1_pins_b>;
        pinctrl-names = "default";
index 014b416..dc868e6 100644 (file)
        };
 
        soc {
-               timer2: timer@40000000 {
-                       compatible = "st,stm32-timer";
-                       reg = <0x40000000 0x400>;
-                       interrupts = <28>;
-                       clocks = <&rcc 0 STM32F7_APB1_CLOCK(TIM2)>;
-                       status = "disabled";
-               };
-
                timers2: timers@40000000 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        };
                };
 
-               timer3: timer@40000400 {
-                       compatible = "st,stm32-timer";
-                       reg = <0x40000400 0x400>;
-                       interrupts = <29>;
-                       clocks = <&rcc 0 STM32F7_APB1_CLOCK(TIM3)>;
-                       status = "disabled";
-               };
-
                timers3: timers@40000400 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        };
                };
 
-               timer4: timer@40000800 {
-                       compatible = "st,stm32-timer";
-                       reg = <0x40000800 0x400>;
-                       interrupts = <30>;
-                       clocks = <&rcc 0 STM32F7_APB1_CLOCK(TIM4)>;
-                       status = "disabled";
-               };
-
                timers4: timers@40000800 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        };
                };
 
-               timer5: timer@40000c00 {
-                       compatible = "st,stm32-timer";
-                       reg = <0x40000c00 0x400>;
-                       interrupts = <50>;
-                       clocks = <&rcc 0 STM32F7_APB1_CLOCK(TIM5)>;
-               };
-
                timers5: timers@40000c00 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        };
                };
 
-               timer6: timer@40001000 {
-                       compatible = "st,stm32-timer";
-                       reg = <0x40001000 0x400>;
-                       interrupts = <54>;
-                       clocks = <&rcc 0 STM32F7_APB1_CLOCK(TIM6)>;
-                       status = "disabled";
-               };
-
                timers6: timers@40001000 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        };
                };
 
-               timer7: timer@40001400 {
-                       compatible = "st,stm32-timer";
-                       reg = <0x40001400 0x400>;
-                       interrupts = <55>;
-                       clocks = <&rcc 0 STM32F7_APB1_CLOCK(TIM7)>;
-                       status = "disabled";
-               };
-
                timers7: timers@40001400 {
                        #address-cells = <1>;
                        #size-cells = <0>;
index be943b7..b038d0e 100644 (file)
        bus-width = <4>;
 };
 
+&timers5 {
+       /* Override timer5 to act as clockevent */
+       compatible = "st,stm32-timer";
+       interrupts = <50>;
+       status = "okay";
+       /delete-property/#address-cells;
+       /delete-property/#size-cells;
+       /delete-property/clock-names;
+       /delete-node/pwm;
+       /delete-node/timer@4;
+};
+
 &usart1 {
        pinctrl-0 = <&usart1_pins_a>;
        pinctrl-names = "default";
index 069f95f..d2472cd 100644 (file)
@@ -7,7 +7,7 @@
 
 &pinctrl {
        sdmmc1_b4_pins_a: sdmmc1-b4-0 {
-               pins1 {
+               pins {
                        pinmux = <STM32_PINMUX('C', 8, AF12)>, /* SDMMC1_D0 */
                                 <STM32_PINMUX('C', 9, AF12)>, /* SDMMC1_D1 */
                                 <STM32_PINMUX('C', 10, AF12)>, /* SDMMC1_D2 */
                        drive-push-pull;
                        bias-disable;
                };
-               pins2 {
-                       pinmux = <STM32_PINMUX('C', 12, AF12)>; /* SDMMC1_CK */
-                       slew-rate = <2>;
-                       drive-push-pull;
-                       bias-disable;
-               };
        };
 
        sdmmc1_b4_od_pins_a: sdmmc1-b4-od-0 {
                        bias-disable;
                };
                pins2 {
+                       pinmux = <STM32_PINMUX('D', 2, AF12)>; /* SDMMC1_CMD */
+                       slew-rate = <1>;
+                       drive-open-drain;
+                       bias-disable;
+               };
+       };
+
+       sdmmc1_b4_sleep_pins_a: sdmmc1-b4-sleep-0 {
+               pins {
+                       pinmux = <STM32_PINMUX('C', 8, ANALOG)>, /* SDMMC1_D0 */
+                                <STM32_PINMUX('C', 9, ANALOG)>, /* SDMMC1_D1 */
+                                <STM32_PINMUX('C', 10, ANALOG)>, /* SDMMC1_D2 */
+                                <STM32_PINMUX('C', 11, ANALOG)>, /* SDMMC1_D3 */
+                                <STM32_PINMUX('C', 12, ANALOG)>, /* SDMMC1_CK */
+                                <STM32_PINMUX('D', 2, ANALOG)>; /* SDMMC1_CMD */
+               };
+       };
+
+       sdmmc1_clk_pins_a: sdmmc1-clk-0 {
+               pins {
                        pinmux = <STM32_PINMUX('C', 12, AF12)>; /* SDMMC1_CK */
-                       slew-rate = <2>;
+                       slew-rate = <1>;
                        drive-push-pull;
                        bias-disable;
                };
-               pins3 {
-                       pinmux = <STM32_PINMUX('D', 2, AF12)>; /* SDMMC1_CMD */
+       };
+
+       sdmmc2_b4_pins_a: sdmmc2-b4-0 {
+               pins {
+                       pinmux = <STM32_PINMUX('B', 14, AF10)>, /* SDMMC2_D0 */
+                                <STM32_PINMUX('B', 15, AF10)>, /* SDMMC2_D1 */
+                                <STM32_PINMUX('B', 3, AF10)>, /* SDMMC2_D2 */
+                                <STM32_PINMUX('B', 4, AF10)>, /* SDMMC2_D3 */
+                                <STM32_PINMUX('G', 6, AF10)>; /* SDMMC2_CMD */
+                       slew-rate = <1>;
+                       drive-push-pull;
+                       bias-pull-up;
+               };
+       };
+
+       sdmmc2_b4_od_pins_a: sdmmc2-b4-od-0 {
+               pins1 {
+                       pinmux = <STM32_PINMUX('B', 14, AF10)>, /* SDMMC2_D0 */
+                                <STM32_PINMUX('B', 15, AF10)>, /* SDMMC2_D1 */
+                                <STM32_PINMUX('B', 3, AF10)>, /* SDMMC2_D2 */
+                                <STM32_PINMUX('B', 4, AF10)>; /* SDMMC2_D3 */
+                       slew-rate = <1>;
+                       drive-push-pull;
+                       bias-pull-up;
+               };
+               pins2 {
+                       pinmux = <STM32_PINMUX('G', 6, AF10)>; /* SDMMC2_CMD */
                        slew-rate = <1>;
                        drive-open-drain;
-                       bias-disable;
+                       bias-pull-up;
+               };
+       };
+
+       sdmmc2_b4_sleep_pins_a: sdmmc2-b4-sleep-0 {
+               pins {
+                       pinmux = <STM32_PINMUX('B', 14, ANALOG)>, /* SDMMC2_D0 */
+                                <STM32_PINMUX('B', 15, ANALOG)>, /* SDMMC2_D1 */
+                                <STM32_PINMUX('B', 3, ANALOG)>, /* SDMMC2_D2 */
+                                <STM32_PINMUX('B', 4, ANALOG)>, /* SDMMC2_D3 */
+                                <STM32_PINMUX('E', 3, ANALOG)>, /* SDMMC2_CK */
+                                <STM32_PINMUX('G', 6, ANALOG)>; /* SDMMC2_CMD */
+               };
+       };
+
+       sdmmc2_clk_pins_a: sdmmc2-clk-0 {
+               pins {
+                       pinmux = <STM32_PINMUX('E', 3, AF10)>; /* SDMMC2_CK */
+                       slew-rate = <1>;
+                       drive-push-pull;
+                       bias-pull-up;
                };
        };
 
index 86126dc..1708c79 100644 (file)
 
        timer {
                compatible = "arm,armv7-timer";
-               interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
-                            <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
-                            <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
-                            <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
+               interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>;
                interrupt-parent = <&intc>;
                always-on;
        };
                        status = "disabled";
                };
 
+               dma1: dma-controller@48000000 {
+                       compatible = "st,stm32-dma";
+                       reg = <0x48000000 0x400>;
+                       interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clk_pclk4>;
+                       #dma-cells = <4>;
+                       st,mem2mem;
+                       dma-requests = <8>;
+               };
+
+               dma2: dma-controller@48001000 {
+                       compatible = "st,stm32-dma";
+                       reg = <0x48001000 0x400>;
+                       interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clk_pclk4>;
+                       #dma-cells = <4>;
+                       st,mem2mem;
+                       dma-requests = <8>;
+               };
+
+               dmamux1: dma-router@48002000 {
+                       compatible = "st,stm32h7-dmamux";
+                       reg = <0x48002000 0x40>;
+                       clocks = <&clk_pclk4>;
+                       #dma-cells = <3>;
+                       dma-masters = <&dma1 &dma2>;
+                       dma-requests = <128>;
+                       dma-channels = <16>;
+               };
+
+               exti: interrupt-controller@5000d000 {
+                       compatible = "st,stm32mp13-exti", "syscon";
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+                       reg = <0x5000d000 0x400>;
+               };
+
                syscfg: syscon@50020000 {
                        compatible = "st,stm32mp157-syscfg", "syscon";
                        reg = <0x50020000 0x400>;
                        clocks = <&clk_pclk3>;
                };
 
+               mdma: dma-controller@58000000 {
+                       compatible = "st,stm32h7-mdma";
+                       reg = <0x58000000 0x1000>;
+                       interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clk_pclk4>;
+                       #dma-cells = <5>;
+                       dma-channels = <32>;
+                       dma-requests = <48>;
+               };
+
                sdmmc1: mmc@58005000 {
-                       compatible = "arm,pl18x", "arm,primecell";
-                       arm,primecell-periphid = <0x00253180>;
+                       compatible = "st,stm32-sdmmc2", "arm,pl18x", "arm,primecell";
+                       arm,primecell-periphid = <0x20253180>;
                        reg = <0x58005000 0x1000>, <0x58006000 0x1000>;
                        interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "cmd_irq";
                        clock-names = "apb_pclk";
                        cap-sd-highspeed;
                        cap-mmc-highspeed;
-                       max-frequency = <120000000>;
+                       max-frequency = <130000000>;
+                       status = "disabled";
+               };
+
+               sdmmc2: mmc@58007000 {
+                       compatible = "st,stm32-sdmmc2", "arm,pl18x", "arm,primecell";
+                       arm,primecell-periphid = <0x20253180>;
+                       reg = <0x58007000 0x1000>, <0x58008000 0x1000>;
+                       interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "cmd_irq";
+                       clocks = <&clk_pll4_p>;
+                       clock-names = "apb_pclk";
+                       cap-sd-highspeed;
+                       cap-mmc-highspeed;
+                       max-frequency = <130000000>;
                        status = "disabled";
                };
 
index 7e96d9e..ee100d1 100644 (file)
 };
 
 &sdmmc1 {
-       pinctrl-names = "default", "opendrain";
-       pinctrl-0 = <&sdmmc1_b4_pins_a>;
-       pinctrl-1 = <&sdmmc1_b4_od_pins_a>;
+       pinctrl-names = "default", "opendrain", "sleep";
+       pinctrl-0 = <&sdmmc1_b4_pins_a &sdmmc1_clk_pins_a>;
+       pinctrl-1 = <&sdmmc1_b4_od_pins_a &sdmmc1_clk_pins_a>;
+       pinctrl-2 = <&sdmmc1_b4_sleep_pins_a>;
        broken-cd;
        disable-wp;
        st,neg-edge;
index 3b65130..f0d66d8 100644 (file)
                };
        };
 
+       ethernet0_rmii_pins_b: rmii-1 {
+               pins1 {
+                       pinmux = <STM32_PINMUX('B', 5, AF0)>, /* ETH1_CLK */
+                               <STM32_PINMUX('C', 1, AF11)>, /* ETH1_MDC */
+                               <STM32_PINMUX('G', 13, AF11)>, /* ETH1_TXD0 */
+                               <STM32_PINMUX('G', 14, AF11)>; /* ETH1_TXD1 */
+                       bias-disable;
+                       drive-push-pull;
+                       slew-rate = <1>;
+               };
+               pins2 {
+                       pinmux = <STM32_PINMUX('A', 2, AF11)>; /* ETH1_MDIO */
+                       bias-disable;
+                       drive-push-pull;
+                       slew-rate = <0>;
+               };
+               pins3 {
+                       pinmux = <STM32_PINMUX('A', 7, AF11)>, /* ETH1_CRS_DV */
+                               <STM32_PINMUX('C', 4, AF11)>, /* ETH1_RXD0 */
+                               <STM32_PINMUX('C', 5, AF11)>; /* ETH1_RXD1 */
+                       bias-disable;
+               };
+               pins4 {
+                       pinmux = <STM32_PINMUX('B', 11, AF11)>; /* ETH1_TX_EN */
+               };
+       };
+
+       ethernet0_rmii_sleep_pins_b: rmii-sleep-1 {
+               pins1 {
+                       pinmux = <STM32_PINMUX('A', 2, ANALOG)>, /* ETH1_MDIO */
+                               <STM32_PINMUX('A', 7, ANALOG)>, /* ETH1_CRS_DV */
+                               <STM32_PINMUX('B', 5, ANALOG)>, /* ETH1_CLK */
+                               <STM32_PINMUX('B', 11, ANALOG)>, /* ETH1_TX_EN */
+                               <STM32_PINMUX('C', 1, ANALOG)>, /* ETH1_MDC */
+                               <STM32_PINMUX('C', 4, ANALOG)>, /* ETH1_RXD0 */
+                               <STM32_PINMUX('C', 5, ANALOG)>, /* ETH1_RXD1 */
+                               <STM32_PINMUX('G', 13, ANALOG)>, /* ETH1_TXD0 */
+                               <STM32_PINMUX('G', 14, ANALOG)>; /* ETH1_TXD1 */
+               };
+       };
+
        fmc_pins_a: fmc-0 {
                pins1 {
                        pinmux = <STM32_PINMUX('D', 4, AF12)>, /* FMC_NOE */
                };
        };
 
+       pwm1_pins_b: pwm1-1 {
+               pins {
+                       pinmux = <STM32_PINMUX('E', 9, AF1)>; /* TIM1_CH1 */
+                       bias-pull-down;
+                       drive-push-pull;
+                       slew-rate = <0>;
+               };
+       };
+
+       pwm1_sleep_pins_b: pwm1-sleep-1 {
+               pins {
+                       pinmux = <STM32_PINMUX('E', 9, ANALOG)>; /* TIM1_CH1 */
+               };
+       };
+
        pwm2_pins_a: pwm2-0 {
                pins {
                        pinmux = <STM32_PINMUX('A', 3, AF1)>; /* TIM2_CH4 */
                };
        };
 
-       sai2a_sleep_pins_c: sai2a-2 {
+       sai2a_sleep_pins_c: sai2a-sleep-2 {
                pins {
                        pinmux = <STM32_PINMUX('D', 13, ANALOG)>, /* SAI2_SCK_A */
                                 <STM32_PINMUX('D', 11, ANALOG)>, /* SAI2_SD_A */
                };
        };
 
+       usart3_pins_d: usart3-3 {
+               pins1 {
+                       pinmux = <STM32_PINMUX('B', 10, AF7)>, /* USART3_TX */
+                                <STM32_PINMUX('G', 8, AF8)>; /* USART3_RTS */
+                       bias-disable;
+                       drive-push-pull;
+                       slew-rate = <0>;
+               };
+               pins2 {
+                       pinmux = <STM32_PINMUX('D', 9, AF7)>, /* USART3_RX */
+                                <STM32_PINMUX('D', 11, AF7)>; /* USART3_CTS_NSS */
+                       bias-disable;
+               };
+       };
+
+       usart3_idle_pins_d: usart3-idle-3 {
+               pins1 {
+                       pinmux = <STM32_PINMUX('B', 10, ANALOG)>, /* USART3_TX */
+                                <STM32_PINMUX('G', 8, ANALOG)>, /* USART3_RTS */
+                                <STM32_PINMUX('D', 11, ANALOG)>; /* USART3_CTS_NSS */
+               };
+               pins2 {
+                       pinmux = <STM32_PINMUX('D', 9, AF7)>; /* USART3_RX */
+                       bias-disable;
+               };
+       };
+
+       usart3_sleep_pins_d: usart3-sleep-3 {
+               pins {
+                       pinmux = <STM32_PINMUX('B', 10, ANALOG)>, /* USART3_TX */
+                                <STM32_PINMUX('G', 8, ANALOG)>, /* USART3_RTS */
+                                <STM32_PINMUX('D', 11, ANALOG)>, /* USART3_CTS_NSS */
+                                <STM32_PINMUX('D', 9, ANALOG)>; /* USART3_RX */
+               };
+       };
+
        usbotg_hs_pins_a: usbotg-hs-0 {
                pins {
                        pinmux = <STM32_PINMUX('A', 10, ANALOG)>; /* OTG_ID */
index 1cfc2f0..f9aa9af 100644 (file)
 
        timer {
                compatible = "arm,armv7-timer";
-               interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
-                            <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
-                            <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
-                            <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
+               interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>;
                interrupt-parent = <&intc>;
        };
 
                        interrupts-extended = <&exti 27 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&rcc USART2_K>;
                        wakeup-source;
+                       dmas = <&dmamux1 43 0x400 0x15>,
+                              <&dmamux1 44 0x400 0x11>;
+                       dma-names = "rx", "tx";
                        status = "disabled";
                };
 
                        interrupts-extended = <&exti 28 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&rcc USART3_K>;
                        wakeup-source;
+                       dmas = <&dmamux1 45 0x400 0x15>,
+                              <&dmamux1 46 0x400 0x11>;
+                       dma-names = "rx", "tx";
                        status = "disabled";
                };
 
                        interrupts-extended = <&exti 30 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&rcc UART4_K>;
                        wakeup-source;
+                       dmas = <&dmamux1 63 0x400 0x15>,
+                              <&dmamux1 64 0x400 0x11>;
+                       dma-names = "rx", "tx";
                        status = "disabled";
                };
 
                        interrupts-extended = <&exti 31 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&rcc UART5_K>;
                        wakeup-source;
+                       dmas = <&dmamux1 65 0x400 0x15>,
+                              <&dmamux1 66 0x400 0x11>;
+                       dma-names = "rx", "tx";
                        status = "disabled";
                };
 
                        interrupts-extended = <&exti 32 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&rcc UART7_K>;
                        wakeup-source;
+                       dmas = <&dmamux1 79 0x400 0x15>,
+                              <&dmamux1 80 0x400 0x11>;
+                       dma-names = "rx", "tx";
                        status = "disabled";
                };
 
                        interrupts-extended = <&exti 33 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&rcc UART8_K>;
                        wakeup-source;
+                       dmas = <&dmamux1 81 0x400 0x15>,
+                              <&dmamux1 82 0x400 0x11>;
+                       dma-names = "rx", "tx";
                        status = "disabled";
                };
 
                        interrupts-extended = <&exti 29 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&rcc USART6_K>;
                        wakeup-source;
+                       dmas = <&dmamux1 71 0x400 0x15>,
+                              <&dmamux1 72 0x400 0x11>;
+                       dma-names = "rx", "tx";
                        status = "disabled";
                };
 
                };
 
                sdmmc3: mmc@48004000 {
-                       compatible = "arm,pl18x", "arm,primecell";
+                       compatible = "st,stm32-sdmmc2", "arm,pl18x", "arm,primecell";
                        arm,primecell-periphid = <0x00253180>;
                        reg = <0x48004000 0x400>;
                        interrupts = <GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>;
                };
 
                sdmmc1: mmc@58005000 {
-                       compatible = "arm,pl18x", "arm,primecell";
+                       compatible = "st,stm32-sdmmc2", "arm,pl18x", "arm,primecell";
                        arm,primecell-periphid = <0x00253180>;
                        reg = <0x58005000 0x1000>;
                        interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>;
                };
 
                sdmmc2: mmc@58007000 {
-                       compatible = "arm,pl18x", "arm,primecell";
+                       compatible = "st,stm32-sdmmc2", "arm,pl18x", "arm,primecell";
                        arm,primecell-periphid = <0x00253180>;
                        reg = <0x58007000 0x1000>;
                        interrupts = <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>;
                        reg = <0x5c004000 0x400>;
                        clocks = <&rcc RTCAPB>, <&rcc RTC>;
                        clock-names = "pclk", "rtc_ck";
-                       interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupts-extended = <&exti 19 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
                };
 
index 1c1889b..486084e 100644 (file)
                interrupt-affinity = <&cpu0>, <&cpu1>;
        };
 
+       timer {
+               interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>;
+       };
+
        soc {
                m_can1: can@4400e000 {
                        compatible = "bosch,m_can";
index d3058a0..1f75f1d 100644 (file)
@@ -43,5 +43,7 @@
        pinctrl-0 = <&uart4_pins_a>;
        pinctrl-1 = <&uart4_sleep_pins_a>;
        pinctrl-2 = <&uart4_idle_pins_a>;
+       /delete-property/dmas;
+       /delete-property/dma-names;
        status = "okay";
 };
index a797eaa..ba92d7d 100644 (file)
        pinctrl-0 = <&uart4_pins_a>;
        pinctrl-1 = <&uart4_sleep_pins_a>;
        pinctrl-2 = <&uart4_idle_pins_a>;
+       /delete-property/dmas;
+       /delete-property/dma-names;
        status = "okay";
 };
index 70f394b..6a5a4af 100644 (file)
@@ -58,6 +58,8 @@
        /delete-property/st,hw-flow-ctrl;
        cts-gpios = <&gpioa 15 GPIO_ACTIVE_LOW>;
        rts-gpios = <&gpiob 0 GPIO_ACTIVE_LOW>;
+       /delete-property/dmas;
+       /delete-property/dma-names;
        status = "okay";
 
        bluetooth {
index 5670b23..fae656e 100644 (file)
        pinctrl-0 = <&uart4_pins_a>;
        pinctrl-1 = <&uart4_sleep_pins_a>;
        pinctrl-2 = <&uart4_idle_pins_a>;
+       /delete-property/dmas;
+       /delete-property/dma-names;
        status = "okay";
 };
 
 &uart8 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart8_pins_a>;
+       /delete-property/dmas;
+       /delete-property/dma-names;
        status = "okay";
 };
index 7a75868..b9d0d3d 100644 (file)
@@ -44,6 +44,8 @@
        pinctrl-0 = <&uart4_pins_a>;
        pinctrl-1 = <&uart4_sleep_pins_a>;
        pinctrl-2 = <&uart4_idle_pins_a>;
+       /delete-property/dmas;
+       /delete-property/dma-names;
        status = "okay";
 };
 
@@ -51,5 +53,7 @@
 &uart8 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart8_pins_a>;
+       /delete-property/dmas;
+       /delete-property/dma-names;
        status = "okay";
 };
index a4b14ef..3a36f7f 100644 (file)
        pinctrl-0 = <&usart2_pins_b>;
        pinctrl-1 = <&usart2_sleep_pins_b>;
        st,hw-flow-ctrl;
+       /delete-property/dmas;
+       /delete-property/dma-names;
        status = "okay";
 };
 
        pinctrl-names = "default";
        pinctrl-0 = <&uart4_pins_c>;
        st,hw-flow-ctrl;
+       /delete-property/dmas;
+       /delete-property/dma-names;
        status = "okay";
 };
 
 &uart7 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart7_pins_b>;
+       /delete-property/dmas;
+       /delete-property/dma-names;
        status = "okay";
 };
 
index 46b471d..b1eb688 100644 (file)
        pinctrl-0 = <&uart4_pins_a>;
        pinctrl-1 = <&uart4_sleep_pins_a>;
        pinctrl-2 = <&uart4_idle_pins_a>;
+       /delete-property/dmas;
+       /delete-property/dma-names;
        status = "okay";
 };
 
diff --git a/arch/arm/boot/dts/stm32mp157c-emsbc-argon.dts b/arch/arm/boot/dts/stm32mp157c-emsbc-argon.dts
new file mode 100644 (file)
index 0000000..33b3f11
--- /dev/null
@@ -0,0 +1,53 @@
+// SPDX-License-Identifier: (GPL-2.0 or MIT)
+//
+// Copyright (c) 2021 emtrion GmbH
+// Author: Reinhold Müller <reinhold.mueller@emtrion.de>.
+//
+
+/dts-v1/;
+
+#include "stm32mp157c-emstamp-argon.dtsi"
+
+/ {
+       model = "emtrion STM32MP157C emSBC-Argon Developer Board";
+       compatible = "emtrion,stm32mp157c-emsbc-argon", "emtrion,stm32mp157c-emstamp-argon",
+                       "st,stm32mp157";
+
+       led: gpio_leds {
+               compatible = "gpio-leds";
+               led-2 {
+                       label = "red";
+                       gpios = <&gpiof 12 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "none";
+                       default-state = "off";
+               };
+               led-3 {
+                       label = "green";
+                       gpios = <&gpioe 7 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "none";
+                       default-state = "off";
+               };
+       };
+};
+
+&dac {
+       status = "okay";
+};
+
+&sdmmc1 {
+       pinctrl-names = "default", "opendrain", "sleep";
+       pinctrl-0 = <&sdmmc1_b4_pins_a>;
+       pinctrl-1 = <&sdmmc1_b4_od_pins_a>;
+       pinctrl-2 = <&sdmmc1_b4_sleep_pins_a>;
+       cd-gpios = <&gpiob 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+       disable-wp;
+       st,neg-edge;
+       bus-width = <4>;
+       vmmc-supply = <&vdd_sd>;
+       status = "okay";
+};
+
+&spi1 {
+       status = "okay";
+};
+
diff --git a/arch/arm/boot/dts/stm32mp157c-emstamp-argon.dtsi b/arch/arm/boot/dts/stm32mp157c-emstamp-argon.dtsi
new file mode 100644 (file)
index 0000000..33ae5e0
--- /dev/null
@@ -0,0 +1,552 @@
+// SPDX-License-Identifier: (GPL-2.0 or MIT)
+//
+// Copyright (c) 2021 emtrion GmbH
+// Author: Reinhold Müller <reinhold.mueller@emtrion.de>.
+//
+
+#include "stm32mp157.dtsi"
+#include "stm32mp15xc.dtsi"
+#include "stm32mp15-pinctrl.dtsi"
+#include "stm32mp15xxac-pinctrl.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/mfd/st,stpmic1.h>
+
+/ {
+       aliases {
+               ethernet0 = &ethernet0;
+               serial0 = &uart4;
+               serial1 = &usart2;
+               serial2 = &usart3;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory@c0000000 {
+               device_type = "memory";
+               reg = <0xc0000000 0x20000000>;
+       };
+
+       reserved-memory {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               mcuram2: mcuram2@10000000 {
+                       compatible = "shared-dma-pool";
+                       reg = <0x10000000 0x40000>;
+                       no-map;
+               };
+
+               vdev0vring0: vdev0vring0@10040000 {
+                       compatible = "shared-dma-pool";
+                       reg = <0x10040000 0x2000>;
+                       no-map;
+               };
+
+               vdev0vring1: vdev0vring1@10042000 {
+                       compatible = "shared-dma-pool";
+                       reg = <0x10042000 0x2000>;
+                       no-map;
+               };
+
+               vdev0buffer: vdev0buffer@10044000 {
+                       compatible = "shared-dma-pool";
+                       reg = <0x10044000 0x4000>;
+                       no-map;
+               };
+
+               mcuram: mcuram@30000000 {
+                       compatible = "shared-dma-pool";
+                       reg = <0x30000000 0x40000>;
+                       no-map;
+               };
+
+               retram: retram@38000000 {
+                       compatible = "shared-dma-pool";
+                       reg = <0x38000000 0x10000>;
+                       no-map;
+               };
+
+               gpu_reserved: gpu@dc000000 {
+                       reg = <0xdc000000 0x4000000>;
+                       no-map;
+               };
+       };
+
+       led: gpio_leds {
+               compatible = "gpio-leds";
+               led-0 {
+                       label = "panic";
+                       gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "none";
+                       default-state = "off";
+                       panic-indicator;
+               };
+               led-1 {
+                       label = "heartbeat";
+                       gpios = <&gpioa 14 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "heartbeat";
+                       default-state = "on";
+               };
+       };
+};
+
+&adc {
+       vdd-supply = <&vdd>;
+       vdda-supply = <&vdd>;
+       vref-supply = <&vrefbuf>;
+       status = "okay";
+
+       adc1: adc@0 {
+               pinctrl-names = "default";
+               pinctrl-0 = <&adc1_in6_pins_a>;
+               st,min-sample-time-nsecs = <5000>;
+               st,adc-channels = <6>;
+               status = "disabled";
+       };
+
+       adc2: adc@100 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "okay";
+               channel@12 {
+                       reg = <12>;
+                       label = "sense_temp";
+                       st,min-sample-time-ns = <9000>;
+               };
+               channel@15 {
+                       reg = <15>;
+                       label = "vbat";
+                       st,min-sample-time-ns = <9000>;
+               };
+               channel@16 {
+                       reg = <16>;
+                       label = "dac_out1";
+                       st,min-sample-time-ns = <9000>;
+               };
+               channel@17 {
+                       reg = <17>;
+                       label = "dac_out1";
+                       st,min-sample-time-ns = <9000>;
+               };
+       };
+};
+
+&crc1 {
+       status = "okay";
+};
+
+&cryp1 {
+       status = "okay";
+};
+
+&dac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&dac_ch1_pins_a &dac_ch2_pins_a>;
+       vref-supply = <&vdda>;
+       status = "disabled";
+
+       dac1: dac@1 {
+               status = "okay";
+       };
+       dac2: dac@2 {
+               status = "okay";
+       };
+};
+
+&dts {
+       status = "okay";
+};
+
+&ethernet0 {
+       status = "okay";
+       snps,reset-gpio = <&gpioa 1 GPIO_ACTIVE_LOW>;
+       snps,reset-active-low;
+       snps,reset-delays-us = <0 30000 50000>;
+       pinctrl-0 = <&ethernet0_rmii_pins_b>;
+       pinctrl-1 = <&ethernet0_rmii_sleep_pins_b>;
+       pinctrl-names = "default", "sleep";
+       phy-mode = "rmii";
+       max-speed = <100>;
+       phy-handle = <&phy0>;
+       st,eth-ref-clk-sel;
+
+       mdio0 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "snps,dwmac-mdio";
+               phy0: ethernet-phy@0 {
+                       reg = <0>;
+               };
+       };
+};
+
+&gpu {
+       contiguous-area = <&gpu_reserved>;
+};
+
+&hash1 {
+       status = "okay";
+};
+
+&i2c1 {
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <&i2c1_pins_a>;
+       pinctrl-1 = <&i2c1_sleep_pins_a>;
+       i2c-scl-rising-time-ns = <100>;
+       i2c-scl-falling-time-ns = <7>;
+       status = "disabled";
+       /delete-property/dmas;
+       /delete-property/dma-names;
+};
+
+&i2c4 {
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <&i2c4_pins_a>;
+       pinctrl-1 = <&i2c4_sleep_pins_a>;
+       i2c-scl-rising-time-ns = <185>;
+       i2c-scl-falling-time-ns = <20>;
+       status = "okay";
+       /delete-property/dmas;
+       /delete-property/dma-names;
+
+       pmic: stpmic@33 {
+               compatible = "st,stpmic1";
+               reg = <0x33>;
+               interrupts-extended = <&gpioa 0 IRQ_TYPE_EDGE_FALLING>;
+               interrupt-controller;
+               #interrupt-cells = <2>;
+               status = "okay";
+
+               regulators {
+                       compatible = "st,stpmic1-regulators";
+
+                       ldo1-supply = <&v3v3>;
+                       ldo3-supply = <&vdd_ddr>;
+                       ldo6-supply = <&v3v3>;
+                       pwr_sw1-supply = <&bst_out>;
+                       pwr_sw2-supply = <&bst_out>;
+
+                       vddcore: buck1 {
+                               regulator-name = "vddcore";
+                               regulator-min-microvolt = <1200000>;
+                               regulator-max-microvolt = <1350000>;
+                               regulator-always-on;
+                               regulator-initial-mode = <0>;
+                               regulator-over-current-protection;
+                       };
+
+                       vdd_ddr: buck2 {
+                               regulator-name = "vdd_ddr";
+                               regulator-min-microvolt = <1350000>;
+                               regulator-max-microvolt = <1350000>;
+                               regulator-always-on;
+                               regulator-initial-mode = <0>;
+                               regulator-over-current-protection;
+                       };
+
+                       vdd: buck3 {
+                               regulator-name = "vdd";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                               st,mask-reset;
+                               regulator-initial-mode = <0>;
+                               regulator-over-current-protection;
+                       };
+
+                       v3v3: buck4 {
+                               regulator-name = "v3v3";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                               regulator-over-current-protection;
+                               regulator-initial-mode = <0>;
+                       };
+
+                       v1v8_audio: ldo1 {
+                               regulator-name = "v1v8_audio";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               interrupts = <IT_CURLIM_LDO1 0>;
+                       };
+
+                       v3v3_hdmi: ldo2 {
+                               regulator-name = "v3v3_hdmi";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                               interrupts = <IT_CURLIM_LDO2 0>;
+                       };
+
+                       vtt_ddr: ldo3 {
+                               regulator-name = "vtt_ddr";
+                               regulator-min-microvolt = <500000>;
+                               regulator-max-microvolt = <750000>;
+                               regulator-always-on;
+                               regulator-over-current-protection;
+                       };
+
+                       vdd_usb: ldo4 {
+                               regulator-name = "vdd_usb";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               interrupts = <IT_CURLIM_LDO4 0>;
+                       };
+
+                       vdd_sd: ldo5 {
+                               regulator-name = "vdd_sd";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               interrupts = <IT_CURLIM_LDO5 0>;
+                               regulator-always-on;
+                       };
+
+                       vdda: ldo6 {
+                               regulator-name = "vdda";
+                               regulator-min-microvolt = <2900000>;
+                               regulator-max-microvolt = <2900000>;
+                               regulator-always-on;
+                               interrupts = <IT_CURLIM_LDO6 0>;
+                               regulator-boot-on;
+                       };
+
+                       vref_ddr: vref_ddr {
+                               regulator-name = "vref_ddr";
+                               regulator-always-on;
+                               regulator-over-current-protection;
+                       };
+
+                       bst_out: boost {
+                               regulator-name = "bst_out";
+                               interrupts = <IT_OCP_BOOST 0>;
+                       };
+
+                       vbus_otg: pwr_sw1 {
+                               regulator-name = "vbus_otg";
+                               interrupts = <IT_OCP_OTG 0>;
+                               regulator-active-discharge;
+                       };
+
+                       vbus_usbh: pwr_sw2 {
+                               regulator-name = "usbh_vbus";
+                               interrupts = <IT_OCP_SWOUT 0>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+               };
+
+               onkey {
+                       compatible = "st,stpmic1-onkey";
+                       interrupts = <IT_PONKEY_F 0>, <IT_PONKEY_R 1>;
+                       interrupt-names = "onkey-falling", "onkey-rising";
+                       status = "okay";
+               };
+
+               watchdog {
+                       compatible = "st,stpmic1-wdt";
+                       status = "disabled";
+               };
+       };
+};
+
+&i2c5 {
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <&i2c5_pins_a>;
+       pinctrl-1 = <&i2c5_sleep_pins_a>;
+       i2c-scl-rising-time-ns = <185>;
+       i2c-scl-falling-time-ns = <20>;
+       /delete-property/dmas;
+       /delete-property/dma-names;
+};
+
+&ipcc {
+       status = "okay";
+};
+
+&iwdg2 {
+       timeout-sec = <32>;
+       status = "okay";
+};
+
+&m4_rproc {
+       memory-region = <&retram>, <&mcuram>, <&mcuram2>, <&vdev0vring0>,
+                       <&vdev0vring1>, <&vdev0buffer>;
+       mboxes = <&ipcc 0>, <&ipcc 1>, <&ipcc 2>;
+       mbox-names = "vq0", "vq1", "shutdown";
+       interrupt-parent = <&exti>;
+       interrupts = <68 1>;
+       interrupt-names = "wdg";
+       recovery;
+       status = "okay";
+};
+
+&pwr_regulators {
+       vdd-supply = <&vdd>;
+       vdd_3v3_usbfs-supply = <&vdd_usb>;
+};
+
+&qspi {
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <&qspi_clk_pins_a &qspi_bk1_pins_a>;
+       pinctrl-1 = <&qspi_clk_sleep_pins_a &qspi_bk1_sleep_pins_a>;
+       reg = <0x58003000 0x1000>, <0x70000000 0x4000000>;
+       #address-cells = <1>;
+       #size-cells = <0>;
+       status = "okay";
+
+       flash0: is25lp016d@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <133000000>;
+               spi-rx-bus-width = <1>;
+               spi-tx-bus-width = <1>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+       };
+};
+
+&rng1 {
+       status = "okay";
+};
+
+&rtc {
+       status = "okay";
+};
+
+&sdmmc2 {
+       arm,primecell-periphid = <0x10153180>;
+       pinctrl-names = "default", "opendrain", "sleep";
+       pinctrl-0 = <&sdmmc2_b4_pins_b>;
+       pinctrl-1 = <&sdmmc2_b4_od_pins_b>;
+       pinctrl-2 = <&sdmmc2_b4_sleep_pins_a>;
+       non-removable;
+       st,neg-edge;
+       bus-width = <4>;
+       vmmc-supply = <&v3v3>;
+       status = "okay";
+};
+
+&spi1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi1_pins_a>;
+       cs-gpios = <&gpioz 3 0>;
+       status = "disabled";
+
+       spidev@0  {
+               compatible = "spidev";
+               reg = <0>;
+               spi-max-frequency = <100000>;
+       };
+};
+
+&timers1 {
+       /* spare dmas for other usage */
+       /delete-property/dmas;
+       /delete-property/dma-names;
+       pwm {
+               pinctrl-0 = <&pwm1_pins_b>;
+               pinctrl-1 = <&pwm1_sleep_pins_b>;
+               pinctrl-names = "default", "sleep";
+               status = "okay";
+       };
+       timer@0 {
+               status = "okay";
+       };
+};
+
+&timers4 {
+       /delete-property/dmas;
+       /delete-property/dma-names;
+       pwm {
+               pinctrl-0 = <&pwm4_pins_b>;
+               pinctrl-1 = <&pwm4_sleep_pins_b>;
+               pinctrl-names = "default", "sleep";
+               status = "okay";
+       };
+       timer@3 {
+               status = "okay";
+       };
+};
+
+&timers5 {
+       /delete-property/dmas;
+       /delete-property/dma-names;
+       pwm {
+               pinctrl-0 = <&pwm5_pins_a>;
+               pinctrl-1 = <&pwm5_sleep_pins_a>;
+               pinctrl-names = "default", "sleep";
+               status = "okay";
+       };
+       timer@4 {
+               status = "okay";
+       };
+};
+
+&uart4 {
+       pinctrl-names = "default", "sleep", "idle";
+       pinctrl-0 = <&uart4_pins_a>;
+       pinctrl-1 = <&uart4_sleep_pins_a>;
+       pinctrl-2 = <&uart4_idle_pins_a>;
+       status = "okay";
+};
+
+&usart2 {
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <&usart2_pins_a>;
+       pinctrl-1 = <&usart2_sleep_pins_a>;
+       status = "okay";
+};
+
+&usart3 {
+       pinctrl-names = "default", "sleep", "idle";
+       pinctrl-0 = <&usart3_pins_d>;
+       pinctrl-1 = <&usart3_sleep_pins_d>;
+       pinctrl-2 = <&usart3_idle_pins_d>;
+       status = "okay";
+};
+
+&usbh_ehci {
+       phys = <&usbphyc_port0>;
+       phy-names = "usb";
+       status = "okay";
+};
+
+&usbh_ohci {
+       phys = <&usbphyc_port0>;
+       phy-names = "usb";
+       status = "okay";
+};
+
+&usbotg_hs {
+       dr_mode = "peripheral";
+       pinctrl-names = "default";
+       pinctrl-0 = <&usbotg_hs_pins_a>;
+       phy-names = "usb2-phy";
+       phys = <&usbphyc_port1 0>;
+       vbus-supply = <&vbus_otg>;
+       status = "okay";
+};
+
+&usbphyc {
+       status = "okay";
+};
+
+&usbphyc_port0 {
+       phy-supply = <&vdd_usb>;
+};
+
+&usbphyc_port1 {
+       phy-supply = <&vdd_usb>;
+};
+
+&vrefbuf {
+       regulator-min-microvolt = <2500000>;
+       regulator-max-microvolt = <2500000>;
+       vdda-supply = <&vdd>;
+       status = "okay";
+};
+
index 1e9bf7e..e8d2ec4 100644 (file)
 &uart4 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart4_pins_a>;
+       /delete-property/dmas;
+       /delete-property/dma-names;
        status = "okay";
 };
index 554f5d3..ed66d25 100644 (file)
@@ -81,6 +81,8 @@
 &uart4 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart4_pins_a>;
+       /delete-property/dmas;
+       /delete-property/dma-names;
        status = "okay";
 };
 
index 4b10b01..35b1034 100644 (file)
 &usart3 {
        pinctrl-names = "default";
        pinctrl-0 = <&usart3_pins_a>;
+       /delete-property/dmas;
+       /delete-property/dma-names;
        status = "okay";
 };
 
        pinctrl-names = "default";
        pinctrl-0 = <&uart8_pins_a>;
        rts-gpios = <&gpioe 6 GPIO_ACTIVE_HIGH>;
+       /delete-property/dmas;
+       /delete-property/dma-names;
        status = "okay";
 };
 
index fbf3826..5f586f0 100644 (file)
 &usart3 {
        pinctrl-names = "default";
        pinctrl-0 = <&usart3_pins_a>;
+       /delete-property/dmas;
+       /delete-property/dma-names;
        status = "okay";
 };
 
        pinctrl-names = "default";
        pinctrl-0 = <&uart8_pins_a &uart8_rtscts_pins_a>;
        uart-has-rtscts;
+       /delete-property/dmas;
+       /delete-property/dma-names;
        status = "okay";
 };
 
index ba816ef..abc5953 100644 (file)
 &usart3 {
        pinctrl-names = "default";
        pinctrl-0 = <&usart3_pins_a>;
+       /delete-property/dmas;
+       /delete-property/dma-names;
        status = "okay";
 };
 
 &uart8 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart8_pins_a &uart8_rtscts_pins_a>;
+       /delete-property/dmas;
+       /delete-property/dma-names;
        status = "okay";
 };
 
index 8c41f81..83e2c87 100644 (file)
                          "", "", "DHCOM-E", "",
                          "", "", "", "",
                          "", "", "", "";
-       status = "okay";
 };
 
 &gpiod {
 &uart4 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart4_pins_a>;
+       /delete-property/dmas;
+       /delete-property/dma-names;
        status = "okay";
 };
index 6885948..61e17f4 100644 (file)
        label = "LS-UART1";
        pinctrl-names = "default";
        pinctrl-0 = <&uart4_pins_b>;
+       /delete-property/dmas;
+       /delete-property/dma-names;
        status = "okay";
 };
 
        pinctrl-names = "default";
        pinctrl-0 = <&uart7_pins_a>;
        uart-has-rtscts;
+       /delete-property/dmas;
+       /delete-property/dma-names;
        status = "okay";
 };
 
        pinctrl-0 = <&usart2_pins_a>;
        pinctrl-1 = <&usart2_sleep_pins_a>;
        st,hw-flow-ctrl;
+       /delete-property/dmas;
+       /delete-property/dma-names;
        status = "okay";
 
        bluetooth {
index 44ecc47..6336c3c 100644 (file)
                device_type = "memory";
                reg = <0xc0000000 0x40000000>;
        };
+
+       reserved-memory {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               mcuram2: mcuram2@10000000 {
+                       compatible = "shared-dma-pool";
+                       reg = <0x10000000 0x40000>;
+                       no-map;
+               };
+
+               vdev0vring0: vdev0vring0@10040000 {
+                       compatible = "shared-dma-pool";
+                       reg = <0x10040000 0x1000>;
+                       no-map;
+               };
+
+               vdev0vring1: vdev0vring1@10041000 {
+                       compatible = "shared-dma-pool";
+                       reg = <0x10041000 0x1000>;
+                       no-map;
+               };
+
+               vdev0buffer: vdev0buffer@10042000 {
+                       compatible = "shared-dma-pool";
+                       reg = <0x10042000 0x4000>;
+                       no-map;
+               };
+
+               mcuram: mcuram@30000000 {
+                       compatible = "shared-dma-pool";
+                       reg = <0x30000000 0x40000>;
+                       no-map;
+               };
+
+               retram: retram@38000000 {
+                       compatible = "shared-dma-pool";
+                       reg = <0x38000000 0x10000>;
+                       no-map;
+               };
+       };
 };
 
 &crc1 {
        };
 };
 
+&ipcc {
+       status = "okay";
+};
+
 &iwdg2 {
        timeout-sec = <32>;
        status = "okay";
 };
 
+&m4_rproc {
+       memory-region = <&retram>, <&mcuram>, <&mcuram2>, <&vdev0vring0>,
+                       <&vdev0vring1>, <&vdev0buffer>;
+       mboxes = <&ipcc 0>, <&ipcc 1>, <&ipcc 2>;
+       mbox-names = "vq0", "vq1", "shutdown";
+       interrupt-parent = <&exti>;
+       interrupts = <68 1>;
+       status = "okay";
+};
+
 &pwr_regulators {
        vdd-supply = <&vdd>;
        vdd_3v3_usbfs-supply = <&vdd_usb>;
index 6caeb44..333c2af 100644 (file)
        pinctrl-0 = <&uart4_pins_a>;
        pinctrl-1 = <&uart4_sleep_pins_a>;
        pinctrl-2 = <&uart4_idle_pins_a>;
+       /delete-property/dmas;
+       /delete-property/dma-names;
        status = "okay";
 };
 
        pinctrl-0 = <&uart7_pins_c>;
        pinctrl-1 = <&uart7_sleep_pins_c>;
        pinctrl-2 = <&uart7_idle_pins_c>;
+       /delete-property/dmas;
+       /delete-property/dma-names;
        status = "disabled";
 };
 
diff --git a/arch/arm/boot/dts/sun7i-a20-haoyu-marsboard.dts b/arch/arm/boot/dts/sun7i-a20-haoyu-marsboard.dts
new file mode 100644 (file)
index 0000000..097e479
--- /dev/null
@@ -0,0 +1,182 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2021 Conley Lee
+ * Conley Lee <conleylee@foxmail.com>
+ */
+
+/dts-v1/;
+#include "sun7i-a20.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+       model = "HAOYU Electronics Marsboard A20";
+       compatible = "haoyu,a20-marsboard", "allwinner,sun7i-a20";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       hdmi-connector {
+               compatible = "hdmi-connector";
+               type = "a";
+
+               port {
+                       hdmi_con_in: endpoint {
+                               remote-endpoint = <&hdmi_out_con>;
+                       };
+               };
+       };
+};
+
+&ahci {
+       target-supply = <&reg_ahci_5v>;
+       status = "okay";
+};
+
+&codec {
+       status = "okay";
+};
+
+&cpu0 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
+&de {
+       status = "okay";
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&gmac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&gmac_mii_pins>, <&gmac_txerr>;
+       phy-handle = <&phy0>;
+       phy-mode = "mii";
+       status = "okay";
+};
+
+&hdmi {
+       status = "okay";
+};
+
+&hdmi_out {
+       hdmi_out_con: endpoint {
+               remote-endpoint = <&hdmi_con_in>;
+       };
+};
+
+&i2c0 {
+       status = "okay";
+
+       axp209: pmic@34 {
+               reg = <0x34>;
+               interrupt-parent = <&nmi_intc>;
+               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+       };
+};
+
+&mmc0 {
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 7 10 GPIO_ACTIVE_LOW>; /* PH10 */
+       status = "okay";
+};
+
+&gmac_mdio {
+       phy0: ethernet-phy@0 {
+               reg = <0>;
+       };
+};
+
+&ohci0 {
+       status = "okay";
+};
+
+&ohci1 {
+       status = "okay";
+};
+
+&otg_sram {
+       status = "okay";
+};
+
+&pio {
+       gmac_txerr: gmac-txerr-pin {
+               pins = "PA17";
+               function = "gmac";
+       };
+};
+
+&reg_ahci_5v {
+       status = "okay";
+};
+
+#include "axp209.dtsi"
+
+&ac_power_supply {
+       status = "okay";
+};
+
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1450000>;
+       regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc3 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1400000>;
+       regulator-name = "vdd-int-dll";
+};
+
+&reg_ldo1 {
+       regulator-name = "vdd-rtc";
+};
+
+&reg_ldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "avcc";
+};
+
+&reg_usb1_vbus {
+       status = "okay";
+};
+
+&reg_usb2_vbus {
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pb_pins>;
+       status = "okay";
+};
+
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
+&usbphy {
+       usb0_id_det-gpios = <&pio 7 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PH4 */
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       usb2_vbus-supply = <&reg_usb2_vbus>;
+       status = "okay";
+};
index be49eab..cd3df12 100644 (file)
        };
 };
 
+&mmc2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc2_8bit_pins>;
+       vmmc-supply = <&reg_vcc3v3>;
+       vqmmc-supply = <&reg_vcc3v3>;
+       bus-width = <8>;
+       non-removable;
+       status = "okay";
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_pa_pins>;
        status = "okay";
 };
 
+&uart3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart3_pins>, <&uart3_rts_cts_pins>;
+       uart-has-rtscts;
+       status = "okay";
+
+       bluetooth {
+               compatible = "brcm,bcm43438-bt";
+               clocks = <&rtc 1>;
+               clock-names = "lpo";
+               vbat-supply = <&reg_vcc3v3>;
+               vddio-supply = <&reg_vcc3v3>;
+               device-wakeup-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */
+               host-wakeup-gpios = <&pio 0 7 GPIO_ACTIVE_HIGH>; /* PA7 */
+               shutdown-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */
+       };
+};
+
 &usbphy {
        /* USB VBUS is always on */
        status = "okay";
index 9f33f6f..df71fab 100644 (file)
 / {
        model = "FriendlyARM NanoPi NEO";
        compatible = "friendlyarm,nanopi-neo", "allwinner,sun8i-h3";
+
+       aliases {
+               ethernet0 = &emac;
+       };
 };
 
 &ehci0 {
index 845f252..eac2349 100644 (file)
                cpu_thermal: cpu-thermal {
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
-                       thermal-sensors = <&ths 0>;
+                       thermal-sensors = <&ths>;
 
                        trips {
                                cpu_hot_trip: cpu-hot {
index b30bc1a..084323d 100644 (file)
                        #size-cells = <0>;
                };
 
+               gic: interrupt-controller@1c81000 {
+                       compatible = "arm,gic-400";
+                       reg = <0x01c81000 0x1000>,
+                             <0x01c82000 0x2000>,
+                             <0x01c84000 0x2000>,
+                             <0x01c86000 0x2000>;
+                       interrupt-controller;
+                       #interrupt-cells = <3>;
+                       interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
+               };
+
                csi1: camera@1cb4000 {
                        compatible = "allwinner,sun8i-v3s-csi";
                        reg = <0x01cb4000 0x3000>;
                        resets = <&ccu RST_BUS_CSI>;
                        status = "disabled";
                };
-
-               gic: interrupt-controller@1c81000 {
-                       compatible = "arm,gic-400";
-                       reg = <0x01c81000 0x1000>,
-                             <0x01c82000 0x2000>,
-                             <0x01c84000 0x2000>,
-                             <0x01c86000 0x2000>;
-                       interrupt-controller;
-                       #interrupt-cells = <3>;
-                       interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
-               };
        };
 };
index 4aeca9e..d7e9f97 100644 (file)
                        #size-cells = <0>;
                };
 
+               r_uart: serial@1f02800 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01f02800 0x400>;
+                       interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&r_ccu CLK_APB0_UART>;
+                       resets = <&r_ccu RST_APB0_UART>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&r_uart_pins>;
+                       status = "disabled";
+               };
+
                r_pio: pinctrl@1f02c00 {
                        compatible = "allwinner,sun8i-h3-r-pinctrl";
                        reg = <0x01f02c00 0x400>;
                                pins = "PL10";
                                function = "s_pwm";
                        };
+
+                       r_uart_pins: r-uart-pins {
+                               pins = "PL2", "PL3";
+                               function = "s_uart";
+                       };
                };
 
                r_pwm: pwm@1f03800 {
index 020172e..a054d39 100644 (file)
                };
        };
 
+       spdif@70002400 {
+               status = "okay";
+
+               nvidia,fixed-parent-rate;
+       };
+
        i2s@70002800 {
                status = "okay";
+
+               nvidia,fixed-parent-rate;
        };
 
        serial@70006040 {
                compatible = "nvidia,tegra20-hsuart";
+               /delete-property/ reg-shift;
                /* GPS BCM4751 */
        };
 
        serial@70006200 {
                compatible = "nvidia,tegra20-hsuart";
+               /delete-property/ reg-shift;
                status = "okay";
 
                /* Azurewave AW-NH615 BCM4329B1 */
 
                        lpddr2 {
                                compatible = "elpida,B8132B2PB-6D-F", "jedec,lpddr2-s4";
-                               revision-id1 = <1>;
+                               revision-id = <1 0>;
                                density = <2048>;
                                io-width = <16>;
                        };
index 1eefb9e..8ebd8af 100644 (file)
                #address-cells = <1>;
                #size-cells = <0>;
 
-               asix@1 {
+               ethernet@1 {
                        compatible = "usbb95,772b";
                        reg = <1>;
                        local-mac-address = [00 00 00 00 00 00];
index d53a175..0fb4b1f 100644 (file)
@@ -13,6 +13,8 @@
        compatible = "compal,paz00", "nvidia,tegra20";
 
        aliases {
+               mmc0 = &sdmmc4; /* eMMC */
+               mmc1 = &sdmmc1; /* MicroSD */
                rtc0 = "/i2c@7000d000/tps6586x@34";
                rtc1 = "/rtc@7000e000";
                serial0 = &uarta;
                status = "okay";
        };
 
-       mmc@c8000000 {
+       sdmmc1: mmc@c8000000 {
                status = "okay";
                cd-gpios = <&gpio TEGRA_GPIO(V, 5) GPIO_ACTIVE_LOW>;
                wp-gpios = <&gpio TEGRA_GPIO(H, 1) GPIO_ACTIVE_HIGH>;
                bus-width = <4>;
        };
 
-       mmc@c8000600 {
+       sdmmc4: mmc@c8000600 {
                status = "okay";
                bus-width = <8>;
                non-removable;
index de39c54..0e19bd0 100644 (file)
                        };
                        conf_ata {
                                nvidia,pins = "ata", "atb", "atc", "atd", "ate",
-                                       "cdev1", "cdev2", "dap1", "dtb", "gma",
-                                       "gmb", "gmc", "gmd", "gme", "gpu7",
+                                       "cdev1", "cdev2", "dap1", "dtb", "dtf",
+                                       "gma", "gmb", "gmc", "gmd", "gme", "gpu7",
                                        "gpv", "i2cp", "irrx", "irtx", "pta",
                                        "rm", "slxa", "slxk", "spia", "spib",
                                        "uac";
                        };
                        conf_crtp {
                                nvidia,pins = "crtp", "dap2", "dap3", "dap4",
-                                       "dtc", "dte", "dtf", "gpu", "sdio1",
+                                       "dtc", "dte", "gpu", "sdio1",
                                        "slxc", "slxd", "spdi", "spdo", "spig",
                                        "uda";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
index 18a9bfa..1a331de 100644 (file)
                        #address-cells = <1>;
                        #size-cells = <0>;
 
-                       dsi-bridge@7 {
+                       dsi@7 {
                                compatible = "toshiba,tc358768";
                                reg = <0x7>;
 
index 85b43a8..c662ab2 100644 (file)
 
        serial@70006040 {
                compatible = "nvidia,tegra30-hsuart";
+               /delete-property/ reg-shift;
                status = "okay";
 
                /* Broadcom GPS BCM47511 */
 
        serial@70006200 {
                compatible = "nvidia,tegra30-hsuart";
+               /delete-property/ reg-shift;
                status = "okay";
 
                nvidia,adjust-baud-rates = <0 9600 100>,
index be691a1..22231d4 100644 (file)
                #address-cells = <1>;
                #size-cells = <0>;
 
-               asix@1 {
+               ethernet@1 {
                        compatible = "usbb95,772b";
                        reg = <1>;
                        local-mac-address = [00 00 00 00 00 00];
index a5cfbab..e58dda4 100644 (file)
                #address-cells = <1>;
                #size-cells = <0>;
 
-               smsc@2 { /* SMSC 10/100T Ethernet Controller */
+               ethernet@2 { /* SMSC 10/100T Ethernet Controller */
                        compatible = "usb424,9e00";
                        reg = <2>;
                        local-mac-address = [00 11 22 33 44 55];
index f4b2d42..8ce6103 100644 (file)
 
        uartb: serial@70006040 {
                compatible = "nvidia,tegra30-hsuart";
+               /delete-property/ reg-shift;
                status = "okay";
 
                /* Broadcom GPS BCM47511 */
 
        uartc: serial@70006200 {
                compatible = "nvidia,tegra30-hsuart";
+               /delete-property/ reg-shift;
                status = "okay";
 
                nvidia,adjust-baud-rates = <0 9600 100>,
index c12a1b8..14c411f 100644 (file)
        status = "okay";
 
        /* M41T0M6 real time clock on carrier board */
-       rtc: m41t0m6@68 {
+       rtc: rtc@68 {
                compatible = "st,m41t0";
                reg = <0x68>;
        };
index 17c1c3b..763c73b 100644 (file)
 static int crypto_blake2s_update_arm(struct shash_desc *desc,
                                     const u8 *in, unsigned int inlen)
 {
-       return crypto_blake2s_update(desc, in, inlen, blake2s_compress);
+       return crypto_blake2s_update(desc, in, inlen, false);
 }
 
 static int crypto_blake2s_final_arm(struct shash_desc *desc, u8 *out)
 {
-       return crypto_blake2s_final(desc, out, blake2s_compress);
+       return crypto_blake2s_final(desc, out, false);
 }
 
 #define BLAKE2S_ALG(name, driver_name, digest_size)                    \
index 7d23d4b..6fe6796 100644 (file)
  */
 #define ALT_UP(instr...)                                       \
        .pushsection ".alt.smp.init", "a"                       ;\
+       .align  2                                               ;\
        .long   9998b - .                                       ;\
 9997:  instr                                                   ;\
        .if . - 9997b == 2                                      ;\
        .popsection
 #define ALT_UP_B(label)                                        \
        .pushsection ".alt.smp.init", "a"                       ;\
+       .align  2                                               ;\
        .long   9998b - .                                       ;\
        W(b)    . + (label - 9998b)                                     ;\
        .popsection
index 6af68ed..bdc35c0 100644 (file)
@@ -96,6 +96,7 @@ unsigned long __get_wchan(struct task_struct *p);
 #define __ALT_SMP_ASM(smp, up)                                         \
        "9998:  " smp "\n"                                              \
        "       .pushsection \".alt.smp.init\", \"a\"\n"                \
+       "       .align  2\n"                                            \
        "       .long   9998b - .\n"                                    \
        "       " up "\n"                                               \
        "       .popsection\n"
index 36fbc33..32dbfd8 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/string.h>
 #include <asm/memory.h>
 #include <asm/domain.h>
+#include <asm/unaligned.h>
 #include <asm/unified.h>
 #include <asm/compiler.h>
 
@@ -497,7 +498,10 @@ do {                                                                       \
        }                                                               \
        default: __err = __get_user_bad(); break;                       \
        }                                                               \
-       *(type *)(dst) = __val;                                         \
+       if (IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS))         \
+               put_unaligned(__val, (type *)(dst));                    \
+       else                                                            \
+               *(type *)(dst) = __val; /* aligned by caller */         \
        if (__err)                                                      \
                goto err_label;                                         \
 } while (0)
@@ -507,7 +511,9 @@ do {                                                                        \
        const type *__pk_ptr = (dst);                                   \
        unsigned long __dst = (unsigned long)__pk_ptr;                  \
        int __err = 0;                                                  \
-       type __val = *(type *)src;                                      \
+       type __val = IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) \
+                    ? get_unaligned((type *)(src))                     \
+                    : *(type *)(src);  /* aligned by caller */         \
        switch (sizeof(type)) {                                         \
        case 1: __put_user_asm_byte(__val, __dst, __err, ""); break;    \
        case 2: __put_user_asm_half(__val, __dst, __err, ""); break;    \
diff --git a/arch/arm/mach-airoha/Makefile b/arch/arm/mach-airoha/Makefile
new file mode 100644 (file)
index 0000000..a5857d0
--- /dev/null
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0-only
+obj-y                  += airoha.o
diff --git a/arch/arm/mach-airoha/airoha.c b/arch/arm/mach-airoha/airoha.c
new file mode 100644 (file)
index 0000000..ea23b5a
--- /dev/null
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Device Tree support for Airoha SoCs
+ *
+ * Copyright (c) 2022 Felix Fietkau <nbd@nbd.name>
+ */
+#include <asm/mach/arch.h>
+
+static const char * const airoha_board_dt_compat[] = {
+       "airoha,en7523",
+       NULL,
+};
+
+DT_MACHINE_START(MEDIATEK_DT, "Airoha Cortex-A53 (Device Tree)")
+       .dt_compat      = airoha_board_dt_compat,
+MACHINE_END
index 14db56f..6159010 100644 (file)
@@ -1,4 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
+KASAN_SANITIZE_actions-common.o := n
+KASAN_SANITIZE_actions-arm.o := n
+KASAN_SANITIZE_actions-thumb.o := n
 obj-$(CONFIG_KPROBES)          += core.o actions-common.o checkers-common.o
 obj-$(CONFIG_ARM_KPROBES_TEST) += test-kprobes.o
 test-kprobes-objs              := test-core.o
index 6978140..cbcd42d 100644 (file)
@@ -670,15 +670,41 @@ config ARM64_ERRATUM_1508412
 config ARM64_WORKAROUND_TRBE_OVERWRITE_FILL_MODE
        bool
 
+config ARM64_ERRATUM_2051678
+       bool "Cortex-A510: 2051678: disable Hardware Update of the page table dirty bit"
+       help
+         This options adds the workaround for ARM Cortex-A510 erratum ARM64_ERRATUM_2051678.
+         Affected Coretex-A510 might not respect the ordering rules for
+         hardware update of the page table's dirty bit. The workaround
+         is to not enable the feature on affected CPUs.
+
+         If unsure, say Y.
+
+config ARM64_ERRATUM_2077057
+       bool "Cortex-A510: 2077057: workaround software-step corrupting SPSR_EL2"
+       help
+         This option adds the workaround for ARM Cortex-A510 erratum 2077057.
+         Affected Cortex-A510 may corrupt SPSR_EL2 when the a step exception is
+         expected, but a Pointer Authentication trap is taken instead. The
+         erratum causes SPSR_EL1 to be copied to SPSR_EL2, which could allow
+         EL1 to cause a return to EL2 with a guest controlled ELR_EL2.
+
+         This can only happen when EL2 is stepping EL1.
+
+         When these conditions occur, the SPSR_EL2 value is unchanged from the
+         previous guest entry, and can be restored from the in-memory copy.
+
+         If unsure, say Y.
+
 config ARM64_ERRATUM_2119858
-       bool "Cortex-A710: 2119858: workaround TRBE overwriting trace data in FILL mode"
+       bool "Cortex-A710/X2: 2119858: workaround TRBE overwriting trace data in FILL mode"
        default y
        depends on CORESIGHT_TRBE
        select ARM64_WORKAROUND_TRBE_OVERWRITE_FILL_MODE
        help
-         This option adds the workaround for ARM Cortex-A710 erratum 2119858.
+         This option adds the workaround for ARM Cortex-A710/X2 erratum 2119858.
 
-         Affected Cortex-A710 cores could overwrite up to 3 cache lines of trace
+         Affected Cortex-A710/X2 cores could overwrite up to 3 cache lines of trace
          data at the base of the buffer (pointed to by TRBASER_EL1) in FILL mode in
          the event of a WRAP event.
 
@@ -761,14 +787,14 @@ config ARM64_ERRATUM_2253138
          If unsure, say Y.
 
 config ARM64_ERRATUM_2224489
-       bool "Cortex-A710: 2224489: workaround TRBE writing to address out-of-range"
+       bool "Cortex-A710/X2: 2224489: workaround TRBE writing to address out-of-range"
        depends on CORESIGHT_TRBE
        default y
        select ARM64_WORKAROUND_TRBE_WRITE_OUT_OF_RANGE
        help
-         This option adds the workaround for ARM Cortex-A710 erratum 2224489.
+         This option adds the workaround for ARM Cortex-A710/X2 erratum 2224489.
 
-         Affected Cortex-A710 cores might write to an out-of-range address, not reserved
+         Affected Cortex-A710/X2 cores might write to an out-of-range address, not reserved
          for TRBE. Under some conditions, the TRBE might generate a write to the next
          virtually addressed page following the last page of the TRBE address space
          (i.e., the TRBLIMITR_EL1.LIMIT), instead of wrapping around to the base.
@@ -778,6 +804,65 @@ config ARM64_ERRATUM_2224489
 
          If unsure, say Y.
 
+config ARM64_ERRATUM_2064142
+       bool "Cortex-A510: 2064142: workaround TRBE register writes while disabled"
+       depends on COMPILE_TEST # Until the CoreSight TRBE driver changes are in
+       default y
+       help
+         This option adds the workaround for ARM Cortex-A510 erratum 2064142.
+
+         Affected Cortex-A510 core might fail to write into system registers after the
+         TRBE has been disabled. Under some conditions after the TRBE has been disabled
+         writes into TRBE registers TRBLIMITR_EL1, TRBPTR_EL1, TRBBASER_EL1, TRBSR_EL1,
+         and TRBTRG_EL1 will be ignored and will not be effected.
+
+         Work around this in the driver by executing TSB CSYNC and DSB after collection
+         is stopped and before performing a system register write to one of the affected
+         registers.
+
+         If unsure, say Y.
+
+config ARM64_ERRATUM_2038923
+       bool "Cortex-A510: 2038923: workaround TRBE corruption with enable"
+       depends on COMPILE_TEST # Until the CoreSight TRBE driver changes are in
+       default y
+       help
+         This option adds the workaround for ARM Cortex-A510 erratum 2038923.
+
+         Affected Cortex-A510 core might cause an inconsistent view on whether trace is
+         prohibited within the CPU. As a result, the trace buffer or trace buffer state
+         might be corrupted. This happens after TRBE buffer has been enabled by setting
+         TRBLIMITR_EL1.E, followed by just a single context synchronization event before
+         execution changes from a context, in which trace is prohibited to one where it
+         isn't, or vice versa. In these mentioned conditions, the view of whether trace
+         is prohibited is inconsistent between parts of the CPU, and the trace buffer or
+         the trace buffer state might be corrupted.
+
+         Work around this in the driver by preventing an inconsistent view of whether the
+         trace is prohibited or not based on TRBLIMITR_EL1.E by immediately following a
+         change to TRBLIMITR_EL1.E with at least one ISB instruction before an ERET, or
+         two ISB instructions if no ERET is to take place.
+
+         If unsure, say Y.
+
+config ARM64_ERRATUM_1902691
+       bool "Cortex-A510: 1902691: workaround TRBE trace corruption"
+       depends on COMPILE_TEST # Until the CoreSight TRBE driver changes are in
+       default y
+       help
+         This option adds the workaround for ARM Cortex-A510 erratum 1902691.
+
+         Affected Cortex-A510 core might cause trace data corruption, when being written
+         into the memory. Effectively TRBE is broken and hence cannot be used to capture
+         trace data.
+
+         Work around this problem in the driver by just preventing TRBE initialization on
+         affected cpus. The firmware must have disabled the access to TRBE for the kernel
+         on such implementations. This will cover the kernel for any firmware that doesn't
+         do this already.
+
+         If unsure, say Y.
+
 config CAVIUM_ERRATUM_22375
        bool "Cavium erratum 22375, 24313"
        default y
index 7d5d588..7392544 100644 (file)
@@ -268,6 +268,12 @@ config ARCH_TEGRA
        help
          This enables support for the NVIDIA Tegra SoC family.
 
+config ARCH_TESLA_FSD
+       bool "ARMv8 based Tesla platform"
+       depends on ARCH_EXYNOS
+       help
+         Support for ARMv8 based Tesla platforms.
+
 config ARCH_SPRD
        bool "Spreadtrum SoC platform"
        help
index 639e01a..1ba04e3 100644 (file)
@@ -27,6 +27,7 @@ subdir-y += rockchip
 subdir-y += socionext
 subdir-y += sprd
 subdir-y += synaptics
+subdir-y += tesla
 subdir-y += ti
 subdir-y += toshiba
 subdir-y += xilinx
index 3ec301b..da032a6 100644 (file)
                method = "smc";
        };
 
+       /* Local timer */
+       timer {
+               compatible = "arm,armv8-timer";
+               interrupts = <1 13 0xf08>,
+                            <1 14 0xf08>,
+                            <1 11 0xf08>,
+                            <1 10 0xf08>;
+               interrupt-parent = <&intc>;
+       };
+
        intc: interrupt-controller@fffc1000 {
                compatible = "arm,gic-400", "arm,cortex-a15-gic";
                #interrupt-cells = <3>;
                        status = "disabled";
                };
 
-               mmc: dwmmc0@ff808000 {
+               mmc: mmc@ff808000 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        compatible = "altr,socfpga-dw-mshc";
                        reg = <0xffe00000 0x100000>;
                };
 
-               pdma: pdma@ffda0000 {
+               pdma: dma-controller@ffda0000 {
                        compatible = "arm,pl330", "arm,primecell";
                        reg = <0xffda0000 0x1000>;
                        interrupts = <0 81 4>,
                        reg = <0xffd12000 0x228>;
                };
 
-               /* Local timer */
-               timer {
-                       compatible = "arm,armv8-timer";
-                       interrupts = <1 13 0xf08>,
-                                    <1 14 0xf08>,
-                                    <1 11 0xf08>,
-                                    <1 10 0xf08>;
-               };
-
                timer0: timer0@ffc03000 {
                        compatible = "snps,dw-apb-timer";
                        interrupts = <0 113 4>;
index 46e558a..5159cd5 100644 (file)
@@ -7,6 +7,7 @@
 
 / {
        model = "SoCFPGA Stratix 10 SoCDK";
+       compatible = "altr,socfpga-stratix10-socdk", "altr,socfpga-stratix10";
 
        aliases {
                serial0 = &uart0;
@@ -43,7 +44,7 @@
                reg = <0 0 0 0>;
        };
 
-       ref_033v: 033-v-ref {
+       ref_033v: regulator-v-ref {
                compatible = "regulator-fixed";
                regulator-name = "0.33V";
                regulator-min-microvolt = <330000>;
index bbc3db4..0ab676c 100644 (file)
@@ -7,6 +7,7 @@
 
 / {
        model = "SoCFPGA Stratix 10 SoCDK";
+       compatible = "altr,socfpga-stratix10-socdk", "altr,socfpga-stratix10";
 
        aliases {
                serial0 = &uart0;
@@ -43,7 +44,7 @@
                reg = <0 0 0 0>;
        };
 
-       ref_033v: 033-v-ref {
+       ref_033v: regulator-v-ref {
                compatible = "regulator-fixed";
                regulator-name = "0.33V";
                regulator-min-microvolt = <330000>;
index 5148cd9..0eec186 100644 (file)
@@ -36,6 +36,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905d-p230.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905d-p231.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905d-phicomm-n1.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905d-sml5442tw.dtb
+dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905d-vero4k-plus.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s805x-p241.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905w-p281.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905w-tx3-mini.dtb
@@ -51,9 +52,15 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxm-rbox-pro.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxm-s912-libretech-pc.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxm-vega-s96.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxm-wetek-core2.dtb
+dtb-$(CONFIG_ARCH_MESON) += meson-sm1-a95xf3-air.dtb
+dtb-$(CONFIG_ARCH_MESON) += meson-sm1-a95xf3-air-gbit.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-sm1-bananapi-m5.dtb
+dtb-$(CONFIG_ARCH_MESON) += meson-sm1-h96-max.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-sm1-khadas-vim3l.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-sm1-odroid-c4.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-sm1-odroid-hc4.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-sm1-sei610.dtb
+dtb-$(CONFIG_ARCH_MESON) += meson-sm1-x96-air.dtb
+dtb-$(CONFIG_ARCH_MESON) += meson-sm1-x96-air-gbit.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-a1-ad401.dtb
+dtb-$(CONFIG_ARCH_MESON) += meson-s4-s805x2-aq222.dtb
index 517519e..6d99c23 100644 (file)
                                                };
                                        };
 
+                                       pwm_f_z_pins: pwm-f-z {
+                                               mux {
+                                                       groups = "pwm_f_z";
+                                                       function = "pwm_f";
+                                                       bias-disable;
+                                               };
+                                       };
+
+                                       pwm_f_a_pins: pwm-f-a {
+                                               mux {
+                                                       groups = "pwm_f_a";
+                                                       function = "pwm_f";
+                                                       bias-disable;
+                                               };
+                                       };
+
                                        pwm_f_x_pins: pwm-f-x {
                                                mux {
                                                        groups = "pwm_f_x";
                                                };
                                        };
 
+                                       uart_ao_b_2_3_pins: uart-ao-b-2-3 {
+                                               mux {
+                                                       groups = "uart_ao_b_tx_2",
+                                                                "uart_ao_b_rx_3";
+                                                       function = "uart_ao_b";
+                                                       bias-disable;
+                                               };
+                                       };
+
+                                       uart_ao_b_8_9_pins: uart-ao-b-8-9 {
+                                               mux {
+                                                       groups = "uart_ao_b_tx_8",
+                                                                "uart_ao_b_rx_9";
+                                                       function = "uart_ao_b";
+                                                       bias-disable;
+                                               };
+                                       };
+
+                                       uart_ao_b_cts_rts_pins: uart-ao-b-cts-rts {
+                                               mux {
+                                                       groups = "uart_ao_b_cts",
+                                                                "uart_ao_b_rts";
+                                                       function = "uart_ao_b";
+                                                       bias-disable;
+                                               };
+                                       };
+
                                        pwm_a_e_pins: pwm-a-e {
                                                mux {
                                                        groups = "pwm_a_e";
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-vero4k-plus.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-vero4k-plus.dts
new file mode 100644 (file)
index 0000000..4b0ff70
--- /dev/null
@@ -0,0 +1,117 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Author: Christian Hewitt <christianshewitt@gmail.com>
+ */
+
+/dts-v1/;
+
+#include "meson-gxl-s905d.dtsi"
+#include "meson-gx-p23x-q20x.dtsi"
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+       compatible = "osmc,vero4k-plus", "amlogic,s905d", "amlogic,meson-gxl";
+       model = "OSMC Vero 4K Plus";
+
+       gpio-keys-polled {
+               compatible = "gpio-keys-polled";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               poll-interval = <20>;
+
+               button@0 {
+                       label = "power";
+                       linux,code = <KEY_POWER>;
+                       gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               led-standby {
+                       color = <LED_COLOR_ID_RED>;
+                       function = LED_FUNCTION_POWER;
+                       gpios = <&gpio_ao GPIOAO_9 GPIO_ACTIVE_LOW>;
+                       default-state = "off";
+                       panic-indicator;
+               };
+       };
+};
+
+&ethmac {
+       pinctrl-0 = <&eth_pins>;
+       pinctrl-names = "default";
+
+       phy-mode = "rgmii-txid";
+       phy-handle = <&external_phy>;
+
+       amlogic,tx-delay-ns = <0>;
+};
+
+&external_mdio {
+       external_phy: ethernet-phy@0 {
+               /* Realtek RTL8211F (0x001cc916) */
+               pinctrl-0 = <&eth_phy_irq_pin>;
+               pinctrl-names = "default";
+
+               reg = <0>;
+               max-speed = <1000>;
+
+               reset-assert-us = <10000>;
+               reset-deassert-us = <80000>;
+               reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
+
+               interrupt-parent = <&gpio_intc>;
+               interrupts = <25 IRQ_TYPE_LEVEL_LOW>;
+       };
+};
+
+&pinctrl_periphs {
+       /* Ensure the phy irq pin is properly configured as input */
+       eth_phy_irq_pin: eth-phy-irq {
+               mux {
+                       groups = "GPIOZ_15";
+                       function = "gpio_periphs";
+                       bias-disable;
+                       output-disable;
+               };
+       };
+};
+
+&sd_emmc_a {
+       brcmf: wifi@1 {
+               reg = <1>;
+               compatible = "brcm,bcm4329-fmac";
+       };
+};
+
+&uart_A {
+       status = "okay";
+       pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
+       pinctrl-names = "default";
+       uart-has-rtscts;
+
+       bluetooth {
+               compatible = "brcm,bcm43438-bt";
+               shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
+               max-speed = <2000000>;
+               clocks = <&wifi32k>;
+               clock-names = "lpo";
+       };
+};
+
+&usb {
+       dr_mode = "host";
+};
+
+&usb2_phy0 {
+       /* HDMI_5V also supplies the USB VBUS */
+       phy-supply = <&hdmi_5v>;
+};
+
+&usb2_phy0 {
+       /* HDMI_5V also supplies the USB VBUS */
+       phy-supply = <&hdmi_5v>;
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts b/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
new file mode 100644 (file)
index 0000000..8ffbcb2
--- /dev/null
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2021 Amlogic, Inc. All rights reserved.
+ */
+
+/dts-v1/;
+
+#include "meson-s4.dtsi"
+
+/ {
+       model = "Amlogic Meson S4 AQ222 Development Board";
+       compatible = "amlogic,aq222", "amlogic,s4";
+       interrupt-parent = <&gic>;
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       aliases {
+               serial0 = &uart_B;
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x0 0x0 0x40000000>;
+       };
+
+};
+
+&uart_B {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
new file mode 100644 (file)
index 0000000..bf9ae1e
--- /dev/null
@@ -0,0 +1,99 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2021 Amlogic, Inc. All rights reserved.
+ */
+
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+       cpus {
+               #address-cells = <2>;
+               #size-cells = <0>;
+
+               cpu0: cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a35","arm,armv8";
+                       reg = <0x0 0x0>;
+                       enable-method = "psci";
+               };
+
+               cpu1: cpu@1 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a35","arm,armv8";
+                       reg = <0x0 0x1>;
+                       enable-method = "psci";
+               };
+
+               cpu2: cpu@2 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a35","arm,armv8";
+                       reg = <0x0 0x2>;
+                       enable-method = "psci";
+               };
+
+               cpu3: cpu@3 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a35","arm,armv8";
+                       reg = <0x0 0x3>;
+                       enable-method = "psci";
+               };
+       };
+
+       timer {
+               compatible = "arm,armv8-timer";
+               interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
+       };
+
+       psci {
+               compatible = "arm,psci-1.0";
+               method = "smc";
+       };
+
+       xtal: xtal-clk {
+               compatible = "fixed-clock";
+               clock-frequency = <24000000>;
+               clock-output-names = "xtal";
+               #clock-cells = <0>;
+       };
+
+       soc {
+               compatible = "simple-bus";
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               gic: interrupt-controller@fff01000 {
+                       compatible = "arm,gic-400";
+                       #interrupt-cells = <3>;
+                       #address-cells = <0>;
+                       interrupt-controller;
+                       reg = <0x0 0xfff01000 0 0x1000>,
+                             <0x0 0xfff02000 0 0x2000>,
+                             <0x0 0xfff04000 0 0x2000>,
+                             <0x0 0xfff06000 0 0x2000>;
+                       interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
+               };
+
+               apb4: apb4@fe000000 {
+                       compatible = "simple-bus";
+                       reg = <0x0 0xfe000000 0x0 0x480000>;
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges = <0x0 0x0 0x0 0xfe000000 0x0 0x480000>;
+
+                       uart_B: serial@7a000 {
+                               compatible = "amlogic,meson-s4-uart",
+                                            "amlogic,meson-ao-uart";
+                               reg = <0x0 0x7a000 0x0 0x18>;
+                               interrupts = <GIC_SPI 169 IRQ_TYPE_EDGE_RISING>;
+                               status = "disabled";
+                               clocks = <&xtal>, <&xtal>, <&xtal>;
+                               clock-names = "xtal", "pclk", "baud";
+                       };
+               };
+       };
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-a95xf3-air-gbit.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-a95xf3-air-gbit.dts
new file mode 100644 (file)
index 0000000..d1debcc
--- /dev/null
@@ -0,0 +1,129 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre SAS. All rights reserved.
+ * Copyright (c) 2020 Christian Hewitt <christianshewitt@gmail.com>
+ */
+
+/dts-v1/;
+
+#include "meson-sm1-ac2xx.dtsi"
+#include <dt-bindings/sound/meson-g12a-tohdmitx.h>
+
+/ {
+       compatible = "cyx,a95xf3-air-gbit", "amlogic,sm1";
+       model = "Shenzhen CYX Industrial Co., Ltd A95XF3-AIR";
+
+       sound {
+               compatible = "amlogic,axg-sound-card";
+               model = "A95XF3-AIR";
+               audio-aux-devs = <&tdmout_b>;
+               audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
+                               "TDMOUT_B IN 1", "FRDDR_B OUT 1",
+                               "TDMOUT_B IN 2", "FRDDR_C OUT 1",
+                               "TDM_B Playback", "TDMOUT_B OUT";
+
+               assigned-clocks = <&clkc CLKID_MPLL2>,
+                                 <&clkc CLKID_MPLL0>,
+                                 <&clkc CLKID_MPLL1>;
+               assigned-clock-parents = <0>, <0>, <0>;
+               assigned-clock-rates = <294912000>,
+                                      <270950400>,
+                                      <393216000>;
+               status = "okay";
+
+               dai-link-0 {
+                       sound-dai = <&frddr_a>;
+               };
+
+               dai-link-1 {
+                       sound-dai = <&frddr_b>;
+               };
+
+               dai-link-2 {
+                       sound-dai = <&frddr_c>;
+               };
+
+               /* 8ch hdmi interface */
+               dai-link-3 {
+                       sound-dai = <&tdmif_b>;
+                       dai-format = "i2s";
+                       dai-tdm-slot-tx-mask-0 = <1 1>;
+                       dai-tdm-slot-tx-mask-1 = <1 1>;
+                       dai-tdm-slot-tx-mask-2 = <1 1>;
+                       dai-tdm-slot-tx-mask-3 = <1 1>;
+                       mclk-fs = <256>;
+
+                       codec {
+                               sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
+                       };
+               };
+
+               /* hdmi glue */
+               dai-link-4 {
+                       sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
+
+                       codec {
+                               sound-dai = <&hdmi_tx>;
+                       };
+               };
+       };
+};
+
+&arb {
+       status = "okay";
+};
+
+&clkc_audio {
+       status = "okay";
+};
+
+&ethmac {
+       status = "okay";
+
+       pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
+       pinctrl-names = "default";
+       phy-mode = "rgmii-txid";
+       phy-handle = <&external_phy>;
+
+       rx-internal-delay-ps = <800>;
+};
+
+&ext_mdio {
+       external_phy: ethernet-phy@0 {
+               /* Realtek RTL8211F (0x001cc916) */
+               reg = <0>;
+               max-speed = <1000>;
+
+               reset-assert-us = <10000>;
+               reset-deassert-us = <80000>;
+               reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
+
+               interrupt-parent = <&gpio_intc>;
+               /* MAC_INTR on GPIOZ_14 */
+               interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
+       };
+};
+
+&frddr_a {
+       status = "okay";
+};
+
+&frddr_b {
+       status = "okay";
+};
+
+&frddr_c {
+       status = "okay";
+};
+
+&tdmif_b {
+       status = "okay";
+};
+
+&tdmout_b {
+       status = "okay";
+};
+
+&tohdmitx {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-a95xf3-air.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-a95xf3-air.dts
new file mode 100644 (file)
index 0000000..c94f287
--- /dev/null
@@ -0,0 +1,108 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre SAS. All rights reserved.
+ * Copyright (c) 2020 Christian Hewitt <christianshewitt@gmail.com>
+ */
+
+/dts-v1/;
+
+#include "meson-sm1-ac2xx.dtsi"
+#include <dt-bindings/sound/meson-g12a-tohdmitx.h>
+
+/ {
+       compatible = "cyx,a95xf3-air", "amlogic,sm1";
+       model = "Shenzhen CYX Industrial Co., Ltd A95XF3-AIR";
+
+       sound {
+               compatible = "amlogic,axg-sound-card";
+               model = "A95XF3-AIR";
+               audio-aux-devs = <&tdmout_b>;
+               audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
+                               "TDMOUT_B IN 1", "FRDDR_B OUT 1",
+                               "TDMOUT_B IN 2", "FRDDR_C OUT 1",
+                               "TDM_B Playback", "TDMOUT_B OUT";
+
+               assigned-clocks = <&clkc CLKID_MPLL2>,
+                                 <&clkc CLKID_MPLL0>,
+                                 <&clkc CLKID_MPLL1>;
+               assigned-clock-parents = <0>, <0>, <0>;
+               assigned-clock-rates = <294912000>,
+                                      <270950400>,
+                                      <393216000>;
+               status = "okay";
+
+               dai-link-0 {
+                       sound-dai = <&frddr_a>;
+               };
+
+               dai-link-1 {
+                       sound-dai = <&frddr_b>;
+               };
+
+               dai-link-2 {
+                       sound-dai = <&frddr_c>;
+               };
+
+               /* 8ch hdmi interface */
+               dai-link-3 {
+                       sound-dai = <&tdmif_b>;
+                       dai-format = "i2s";
+                       dai-tdm-slot-tx-mask-0 = <1 1>;
+                       dai-tdm-slot-tx-mask-1 = <1 1>;
+                       dai-tdm-slot-tx-mask-2 = <1 1>;
+                       dai-tdm-slot-tx-mask-3 = <1 1>;
+                       mclk-fs = <256>;
+
+                       codec {
+                               sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
+                       };
+               };
+
+               /* hdmi glue */
+               dai-link-4 {
+                       sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
+
+                       codec {
+                               sound-dai = <&hdmi_tx>;
+                       };
+               };
+       };
+};
+
+&arb {
+       status = "okay";
+};
+
+&clkc_audio {
+       status = "okay";
+};
+
+&ethmac {
+       status = "okay";
+       phy-handle = <&internal_ephy>;
+       phy-mode = "rmii";
+};
+
+&frddr_a {
+       status = "okay";
+};
+
+&frddr_b {
+       status = "okay";
+};
+
+&frddr_c {
+       status = "okay";
+};
+
+&tdmif_b {
+       status = "okay";
+};
+
+&tdmout_b {
+       status = "okay";
+};
+
+&tohdmitx {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-ac2xx.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1-ac2xx.dtsi
new file mode 100644 (file)
index 0000000..46a3473
--- /dev/null
@@ -0,0 +1,300 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre SAS. All rights reserved.
+ * Copyright (c) 2020 Christian Hewitt <christianshewitt@gmail.com>
+ *
+ * AC200/AC202 = S905D3
+ * AC213/AC214 = S905X3
+ *
+ */
+
+#include "meson-sm1.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/gpio/meson-g12a-gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+       aliases {
+               serial0 = &uart_AO;
+               ethernet0 = &ethmac;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       emmc_pwrseq: emmc-pwrseq {
+               compatible = "mmc-pwrseq-emmc";
+               reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
+       };
+
+       cvbs-connector {
+               compatible = "composite-video-connector";
+
+               port {
+                       cvbs_connector_in: endpoint {
+                               remote-endpoint = <&cvbs_vdac_out>;
+                       };
+               };
+       };
+
+       hdmi-connector {
+               compatible = "hdmi-connector";
+               type = "a";
+
+               port {
+                       hdmi_connector_in: endpoint {
+                               remote-endpoint = <&hdmi_tx_tmds_out>;
+                       };
+               };
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x0 0x0 0x40000000>;
+       };
+
+       ao_5v: regulator-ao_5v {
+               compatible = "regulator-fixed";
+               regulator-name = "AO_5V";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               vin-supply = <&dc_in>;
+               regulator-always-on;
+       };
+
+       dc_in: regulator-dc_in {
+               compatible = "regulator-fixed";
+               regulator-name = "DC_IN";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               regulator-always-on;
+       };
+
+       emmc_1v8: regulator-emmc_1v8 {
+               compatible = "regulator-fixed";
+               regulator-name = "EMMC_1V8";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               vin-supply = <&vddao_3v3>;
+               regulator-always-on;
+       };
+
+       vddao_3v3: regulator-vddao_3v3 {
+               compatible = "regulator-fixed";
+               regulator-name = "VDDAO_3V3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&dc_in>;
+               regulator-always-on;
+       };
+
+       vddcpu: regulator-vddcpu {
+               compatible = "pwm-regulator";
+
+               regulator-name = "VDDCPU";
+               regulator-min-microvolt = <690000>;
+               regulator-max-microvolt = <1050000>;
+
+               vin-supply = <&dc_in>;
+
+               pwms = <&pwm_AO_cd 1 1500 0>;
+               pwm-dutycycle-range = <100 0>;
+
+               regulator-boot-on;
+               regulator-always-on;
+       };
+
+       vddio_ao1v8: regulator-vddio_ao1v8 {
+               compatible = "regulator-fixed";
+               regulator-name = "VDDIO_AO1V8";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               vin-supply = <&vddao_3v3>;
+               regulator-always-on;
+       };
+
+       sdio_pwrseq: sdio-pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
+               clocks = <&wifi32k>;
+               clock-names = "ext_clock";
+       };
+
+       wifi32k: wifi32k {
+               compatible = "pwm-clock";
+               #clock-cells = <0>;
+               clock-frequency = <32768>;
+               pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
+       };
+};
+
+&cec_AO {
+       pinctrl-0 = <&cec_ao_a_h_pins>;
+       pinctrl-names = "default";
+       status = "disabled";
+       hdmi-phandle = <&hdmi_tx>;
+};
+
+&cecb_AO {
+       pinctrl-0 = <&cec_ao_b_h_pins>;
+       pinctrl-names = "default";
+       status = "okay";
+       hdmi-phandle = <&hdmi_tx>;
+};
+
+&cpu0 {
+       cpu-supply = <&vddcpu>;
+       operating-points-v2 = <&cpu_opp_table>;
+       clocks = <&clkc CLKID_CPU_CLK>;
+       clock-latency = <50000>;
+};
+
+&cpu1 {
+       cpu-supply = <&vddcpu>;
+       operating-points-v2 = <&cpu_opp_table>;
+       clocks = <&clkc CLKID_CPU1_CLK>;
+       clock-latency = <50000>;
+};
+
+&cpu2 {
+       cpu-supply = <&vddcpu>;
+       operating-points-v2 = <&cpu_opp_table>;
+       clocks = <&clkc CLKID_CPU2_CLK>;
+       clock-latency = <50000>;
+};
+
+&cpu3 {
+       cpu-supply = <&vddcpu>;
+       operating-points-v2 = <&cpu_opp_table>;
+       clocks = <&clkc CLKID_CPU3_CLK>;
+       clock-latency = <50000>;
+};
+
+&cvbs_vdac_port {
+       cvbs_vdac_out: endpoint {
+               remote-endpoint = <&cvbs_connector_in>;
+       };
+};
+
+&hdmi_tx {
+       status = "okay";
+       pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
+       pinctrl-names = "default";
+};
+
+&hdmi_tx_tmds_port {
+       hdmi_tx_tmds_out: endpoint {
+               remote-endpoint = <&hdmi_connector_in>;
+       };
+};
+
+&ir {
+       status = "okay";
+       pinctrl-0 = <&remote_input_ao_pins>;
+       pinctrl-names = "default";
+};
+
+&pwm_AO_ab {
+       status = "okay";
+       pinctrl-0 = <&pwm_ao_a_pins>;
+       pinctrl-names = "default";
+       clocks = <&xtal>;
+       clock-names = "clkin0";
+};
+
+&pwm_AO_cd {
+       pinctrl-0 = <&pwm_ao_d_e_pins>;
+       pinctrl-names = "default";
+       clocks = <&xtal>;
+       clock-names = "clkin1";
+       status = "okay";
+};
+
+&pwm_ef {
+       status = "okay";
+       pinctrl-0 = <&pwm_e_pins>;
+       pinctrl-names = "default";
+       clocks = <&xtal>;
+       clock-names = "clkin0";
+};
+
+&saradc {
+       status = "okay";
+       vref-supply = <&vddio_ao1v8>;
+};
+
+/* SDIO */
+&sd_emmc_a {
+       status = "okay";
+       pinctrl-0 = <&sdio_pins>;
+       pinctrl-1 = <&sdio_clk_gate_pins>;
+       pinctrl-names = "default", "clk-gate";
+       #address-cells = <1>;
+       #size-cells = <0>;
+
+       bus-width = <4>;
+       cap-sd-highspeed;
+       sd-uhs-sdr104;
+       max-frequency = <200000000>;
+
+       non-removable;
+       disable-wp;
+
+       /* WiFi firmware requires power to be kept while in suspend */
+       keep-power-in-suspend;
+
+       mmc-pwrseq = <&sdio_pwrseq>;
+
+       vmmc-supply = <&vddao_3v3>;
+       vqmmc-supply = <&vddio_ao1v8>;
+};
+
+/* SD Card */
+&sd_emmc_b {
+       status = "okay";
+       pinctrl-0 = <&sdcard_c_pins>;
+       pinctrl-1 = <&sdcard_clk_gate_c_pins>;
+       pinctrl-names = "default", "clk-gate";
+
+       bus-width = <4>;
+       cap-sd-highspeed;
+       /* CRC errors are observed at 50MHz */
+       max-frequency = <35000000>;
+       disable-wp;
+
+       cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
+       vmmc-supply = <&vddao_3v3>;
+       vqmmc-supply = <&vddao_3v3>;
+};
+
+/* eMMC */
+&sd_emmc_c {
+       status = "okay";
+       pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
+       pinctrl-1 = <&emmc_clk_gate_pins>;
+       pinctrl-names = "default", "clk-gate";
+
+       bus-width = <8>;
+       cap-mmc-highspeed;
+       mmc-ddr-1_8v;
+       mmc-hs200-1_8v;
+       max-frequency = <200000000>;
+       non-removable;
+       disable-wp;
+
+       mmc-pwrseq = <&emmc_pwrseq>;
+       vmmc-supply = <&vddao_3v3>;
+       vqmmc-supply = <&emmc_1v8>;
+};
+
+&uart_AO {
+       status = "okay";
+       pinctrl-0 = <&uart_ao_a_pins>;
+       pinctrl-names = "default";
+};
+
+&usb {
+       status = "okay";
+       dr_mode = "otg";
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-h96-max.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-h96-max.dts
new file mode 100644 (file)
index 0000000..0f6660e
--- /dev/null
@@ -0,0 +1,145 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre SAS. All rights reserved.
+ * Copyright (c) 2020 Christian Hewitt <christianshewitt@gmail.com>
+ */
+
+/dts-v1/;
+
+#include "meson-sm1-ac2xx.dtsi"
+#include <dt-bindings/sound/meson-g12a-tohdmitx.h>
+
+/ {
+       compatible = "haochuangyi,h96-max", "amlogic,sm1";
+       model = "Shenzhen Haochuangyi Technology Co., Ltd H96 Max";
+
+       sound {
+               compatible = "amlogic,axg-sound-card";
+               model = "H96-MAX";
+               audio-aux-devs = <&tdmout_b>;
+               audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
+                               "TDMOUT_B IN 1", "FRDDR_B OUT 1",
+                               "TDMOUT_B IN 2", "FRDDR_C OUT 1",
+                               "TDM_B Playback", "TDMOUT_B OUT";
+
+               assigned-clocks = <&clkc CLKID_MPLL2>,
+                                 <&clkc CLKID_MPLL0>,
+                                 <&clkc CLKID_MPLL1>;
+               assigned-clock-parents = <0>, <0>, <0>;
+               assigned-clock-rates = <294912000>,
+                                      <270950400>,
+                                      <393216000>;
+               status = "okay";
+
+               dai-link-0 {
+                       sound-dai = <&frddr_a>;
+               };
+
+               dai-link-1 {
+                       sound-dai = <&frddr_b>;
+               };
+
+               dai-link-2 {
+                       sound-dai = <&frddr_c>;
+               };
+
+               /* 8ch hdmi interface */
+               dai-link-3 {
+                       sound-dai = <&tdmif_b>;
+                       dai-format = "i2s";
+                       dai-tdm-slot-tx-mask-0 = <1 1>;
+                       dai-tdm-slot-tx-mask-1 = <1 1>;
+                       dai-tdm-slot-tx-mask-2 = <1 1>;
+                       dai-tdm-slot-tx-mask-3 = <1 1>;
+                       mclk-fs = <256>;
+
+                       codec {
+                               sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
+                       };
+               };
+
+               /* hdmi glue */
+               dai-link-4 {
+                       sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
+
+                       codec {
+                               sound-dai = <&hdmi_tx>;
+                       };
+               };
+       };
+};
+
+&arb {
+       status = "okay";
+};
+
+&clkc_audio {
+       status = "okay";
+};
+
+&ethmac {
+       status = "okay";
+
+       pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
+       pinctrl-names = "default";
+       phy-mode = "rgmii-txid";
+       phy-handle = <&external_phy>;
+
+       rx-internal-delay-ps = <800>;
+};
+
+&ext_mdio {
+       external_phy: ethernet-phy@0 {
+               /* Realtek RTL8211F (0x001cc916) */
+               reg = <0>;
+               max-speed = <1000>;
+
+               reset-assert-us = <10000>;
+               reset-deassert-us = <80000>;
+               reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
+
+               interrupt-parent = <&gpio_intc>;
+               /* MAC_INTR on GPIOZ_14 */
+               interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
+       };
+};
+
+&frddr_a {
+       status = "okay";
+};
+
+&frddr_b {
+       status = "okay";
+};
+
+&frddr_c {
+       status = "okay";
+};
+
+&tdmif_b {
+       status = "okay";
+};
+
+&tdmout_b {
+       status = "okay";
+};
+
+&tohdmitx {
+       status = "okay";
+};
+
+&uart_A {
+       status = "okay";
+
+       pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
+       pinctrl-names = "default";
+       uart-has-rtscts;
+
+       bluetooth {
+               compatible = "brcm,bcm43438-bt";
+               shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
+               max-speed = <2000000>;
+               clocks = <&wifi32k>;
+               clock-names = "lpo";
+       };
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-x96-air-gbit.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-x96-air-gbit.dts
new file mode 100644 (file)
index 0000000..7e1a740
--- /dev/null
@@ -0,0 +1,133 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre SAS. All rights reserved.
+ * Copyright (c) 2020 Christian Hewitt <christianshewitt@gmail.com>
+ */
+
+/dts-v1/;
+
+#include "meson-sm1-ac2xx.dtsi"
+#include <dt-bindings/sound/meson-g12a-tohdmitx.h>
+
+/ {
+       compatible = "amediatech,x96-air-gbit", "amlogic,sm1";
+       model = "Shenzhen Amediatech Technology Co., Ltd X96 Air";
+
+       sound {
+               compatible = "amlogic,axg-sound-card";
+               model = "X96-AIR";
+               audio-aux-devs = <&tdmout_b>;
+               audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
+                               "TDMOUT_B IN 1", "FRDDR_B OUT 1",
+                               "TDMOUT_B IN 2", "FRDDR_C OUT 1",
+                               "TDM_B Playback", "TDMOUT_B OUT";
+
+               assigned-clocks = <&clkc CLKID_MPLL2>,
+                                 <&clkc CLKID_MPLL0>,
+                                 <&clkc CLKID_MPLL1>;
+               assigned-clock-parents = <0>, <0>, <0>;
+               assigned-clock-rates = <294912000>,
+                                      <270950400>,
+                                      <393216000>;
+               status = "okay";
+
+               dai-link-0 {
+                       sound-dai = <&frddr_a>;
+               };
+
+               dai-link-1 {
+                       sound-dai = <&frddr_b>;
+               };
+
+               dai-link-2 {
+                       sound-dai = <&frddr_c>;
+               };
+
+               /* 8ch hdmi interface */
+               dai-link-3 {
+                       sound-dai = <&tdmif_b>;
+                       dai-format = "i2s";
+                       dai-tdm-slot-tx-mask-0 = <1 1>;
+                       dai-tdm-slot-tx-mask-1 = <1 1>;
+                       dai-tdm-slot-tx-mask-2 = <1 1>;
+                       dai-tdm-slot-tx-mask-3 = <1 1>;
+                       mclk-fs = <256>;
+
+                       codec {
+                               sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
+                       };
+               };
+
+               /* hdmi glue */
+               dai-link-4 {
+                       sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
+
+                       codec {
+                               sound-dai = <&hdmi_tx>;
+                       };
+               };
+       };
+};
+
+&arb {
+       status = "okay";
+};
+
+&clkc_audio {
+       status = "okay";
+};
+
+&ethmac {
+       status = "okay";
+
+       pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
+       pinctrl-names = "default";
+       phy-mode = "rgmii-txid";
+       phy-handle = <&external_phy>;
+
+       rx-internal-delay-ps = <800>;
+};
+
+&ext_mdio {
+       external_phy: ethernet-phy@0 {
+               /* Realtek RTL8211F (0x001cc916) */
+               reg = <0>;
+               max-speed = <1000>;
+
+               reset-assert-us = <10000>;
+               reset-deassert-us = <80000>;
+               reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
+
+               interrupt-parent = <&gpio_intc>;
+               /* MAC_INTR on GPIOZ_14 */
+               interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
+       };
+};
+
+&frddr_a {
+       status = "okay";
+};
+
+&frddr_b {
+       status = "okay";
+};
+
+&frddr_c {
+       status = "okay";
+};
+
+&ir {
+       linux,rc-map-name = "rc-x96max";
+};
+
+&tdmif_b {
+       status = "okay";
+};
+
+&tdmout_b {
+       status = "okay";
+};
+
+&tohdmitx {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-x96-air.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-x96-air.dts
new file mode 100644 (file)
index 0000000..cd93d79
--- /dev/null
@@ -0,0 +1,112 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre SAS. All rights reserved.
+ * Copyright (c) 2020 Christian Hewitt <christianshewitt@gmail.com>
+ */
+
+/dts-v1/;
+
+#include "meson-sm1-ac2xx.dtsi"
+#include <dt-bindings/sound/meson-g12a-tohdmitx.h>
+
+/ {
+       compatible = "amediatech,x96-air", "amlogic,sm1";
+       model = "Shenzhen Amediatech Technology Co., Ltd X96 Air";
+
+       sound {
+               compatible = "amlogic,axg-sound-card";
+               model = "X96-AIR";
+               audio-aux-devs = <&tdmout_b>;
+               audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
+                               "TDMOUT_B IN 1", "FRDDR_B OUT 1",
+                               "TDMOUT_B IN 2", "FRDDR_C OUT 1",
+                               "TDM_B Playback", "TDMOUT_B OUT";
+
+               assigned-clocks = <&clkc CLKID_MPLL2>,
+                                 <&clkc CLKID_MPLL0>,
+                                 <&clkc CLKID_MPLL1>;
+               assigned-clock-parents = <0>, <0>, <0>;
+               assigned-clock-rates = <294912000>,
+                                      <270950400>,
+                                      <393216000>;
+               status = "okay";
+
+               dai-link-0 {
+                       sound-dai = <&frddr_a>;
+               };
+
+               dai-link-1 {
+                       sound-dai = <&frddr_b>;
+               };
+
+               dai-link-2 {
+                       sound-dai = <&frddr_c>;
+               };
+
+               /* 8ch hdmi interface */
+               dai-link-3 {
+                       sound-dai = <&tdmif_b>;
+                       dai-format = "i2s";
+                       dai-tdm-slot-tx-mask-0 = <1 1>;
+                       dai-tdm-slot-tx-mask-1 = <1 1>;
+                       dai-tdm-slot-tx-mask-2 = <1 1>;
+                       dai-tdm-slot-tx-mask-3 = <1 1>;
+                       mclk-fs = <256>;
+
+                       codec {
+                               sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
+                       };
+               };
+
+               /* hdmi glue */
+               dai-link-4 {
+                       sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
+
+                       codec {
+                               sound-dai = <&hdmi_tx>;
+                       };
+               };
+       };
+};
+
+&arb {
+       status = "okay";
+};
+
+&clkc_audio {
+       status = "okay";
+};
+
+&ethmac {
+       status = "okay";
+       phy-handle = <&internal_ephy>;
+       phy-mode = "rmii";
+};
+
+&frddr_a {
+       status = "okay";
+};
+
+&frddr_b {
+       status = "okay";
+};
+
+&frddr_c {
+       status = "okay";
+};
+
+&ir {
+       linux,rc-map-name = "rc-beelink-gs1";
+};
+
+&tdmif_b {
+       status = "okay";
+};
+
+&tdmout_b {
+       status = "okay";
+};
+
+&tohdmitx {
+       status = "okay";
+};
index 3d8b1f4..3c07a89 100644 (file)
                        status = "disabled";
                };
 
+               spdifin: audio-controller@400 {
+                       compatible = "amlogic,g12a-spdifin",
+                                    "amlogic,axg-spdifin";
+                       reg = <0x0 0x400 0x0 0x30>;
+                       #sound-dai-cells = <0>;
+                       sound-name-prefix = "SPDIFIN";
+                       interrupts = <GIC_SPI 151 IRQ_TYPE_EDGE_RISING>;
+                       clocks = <&clkc_audio AUD_CLKID_SPDIFIN>,
+                       <&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
+                       clock-names = "pclk", "refclk";
+                       resets = <&clkc_audio AUD_RESET_SPDIFIN>;
+                       status = "disabled";
+               };
+
+               spdifout_a: audio-controller@480 {
+                       compatible = "amlogic,g12a-spdifout",
+                                    "amlogic,axg-spdifout";
+                       reg = <0x0 0x480 0x0 0x50>;
+                       #sound-dai-cells = <0>;
+                       sound-name-prefix = "SPDIFOUT_A";
+                       clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>,
+                       <&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
+                       clock-names = "pclk", "mclk";
+                       resets = <&clkc_audio AUD_RESET_SPDIFOUT>;
+                       status = "disabled";
+               };
+
                tdmout_a: audio-controller@500 {
                        compatible = "amlogic,sm1-tdmout";
                        reg = <0x0 0x500 0x0 0x40>;
index 800da2e..4382b73 100644 (file)
@@ -2,7 +2,7 @@
 dtb-$(CONFIG_ARCH_VEXPRESS) += \
        foundation-v8.dtb foundation-v8-psci.dtb \
        foundation-v8-gicv3.dtb foundation-v8-gicv3-psci.dtb
-dtb-$(CONFIG_ARCH_VEXPRESS) += juno.dtb juno-r1.dtb juno-r2.dtb
+dtb-$(CONFIG_ARCH_VEXPRESS) += juno.dtb juno-r1.dtb juno-r2.dtb juno-scmi.dtb juno-r1-scmi.dtb juno-r2-scmi.dtb
 dtb-$(CONFIG_ARCH_VEXPRESS) += rtsm_ve-aemv8a.dtb
 dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2f-1xv7-ca53x2.dtb
 dtb-$(CONFIG_ARCH_VEXPRESS) += fvp-base-revc.dtb
index 6288e10..a2635b1 100644 (file)
                         <0x02000000 0x00 0x50000000 0x00 0x50000000 0x0 0x08000000>,
                         <0x42000000 0x40 0x00000000 0x40 0x00000000 0x1 0x00000000>;
                /* Standard AXI Translation entries as programmed by EDK2 */
-               dma-ranges = <0x02000000 0x0 0x2c1c0000 0x0 0x2c1c0000 0x0 0x00040000>,
-                            <0x02000000 0x0 0x80000000 0x0 0x80000000 0x0 0x80000000>,
+               dma-ranges = <0x02000000 0x0 0x80000000 0x0 0x80000000 0x0 0x80000000>,
                             <0x43000000 0x8 0x00000000 0x8 0x00000000 0x2 0x00000000>;
                #interrupt-cells = <1>;
                interrupt-map-mask = <0 0 0 7>;
diff --git a/arch/arm64/boot/dts/arm/juno-r1-scmi.dts b/arch/arm64/boot/dts/arm/juno-r1-scmi.dts
new file mode 100644 (file)
index 0000000..190a0fb
--- /dev/null
@@ -0,0 +1,23 @@
+#include "juno-r1.dts"
+#include "juno-scmi.dtsi"
+
+/ {
+       funnel@20130000 {
+               power-domains = <&scmi_devpd 8>;
+       };
+
+       etf@20140000 {
+               power-domains = <&scmi_devpd 0>;
+       };
+
+       funnel@20150000 {
+               power-domains = <&scmi_devpd 0>;
+       };
+};
+
+&A57_0 {
+       clocks = <&scmi_dvfs 0>;
+};
+&A57_1 {
+       clocks = <&scmi_dvfs 0>;
+};
diff --git a/arch/arm64/boot/dts/arm/juno-r2-scmi.dts b/arch/arm64/boot/dts/arm/juno-r2-scmi.dts
new file mode 100644 (file)
index 0000000..dbf1377
--- /dev/null
@@ -0,0 +1,23 @@
+#include "juno-r2.dts"
+#include "juno-scmi.dtsi"
+
+/ {
+       funnel@20130000 {
+               power-domains = <&scmi_devpd 8>;
+       };
+
+       etf@20140000 {
+               power-domains = <&scmi_devpd 0>;
+       };
+
+       funnel@20150000 {
+               power-domains = <&scmi_devpd 0>;
+       };
+};
+
+&A72_0 {
+       clocks = <&scmi_dvfs 0>;
+};
+&A72_1 {
+       clocks = <&scmi_dvfs 0>;
+};
diff --git a/arch/arm64/boot/dts/arm/juno-scmi.dts b/arch/arm64/boot/dts/arm/juno-scmi.dts
new file mode 100644 (file)
index 0000000..41588fa
--- /dev/null
@@ -0,0 +1,9 @@
+#include "juno.dts"
+#include "juno-scmi.dtsi"
+
+&A57_0 {
+       clocks = <&scmi_dvfs 0>;
+};
+&A57_1 {
+       clocks = <&scmi_dvfs 0>;
+};
diff --git a/arch/arm64/boot/dts/arm/juno-scmi.dtsi b/arch/arm64/boot/dts/arm/juno-scmi.dtsi
new file mode 100644 (file)
index 0000000..d72dcff
--- /dev/null
@@ -0,0 +1,199 @@
+/ {
+       etf@20010000 {
+               power-domains = <&scmi_devpd 8>;
+       };
+
+       tpiu@20030000 {
+               power-domains = <&scmi_devpd 8>;
+       };
+
+       funnel@20040000 {
+               power-domains = <&scmi_devpd 8>;
+       };
+
+       etr@20070000 {
+               power-domains = <&scmi_devpd 8>;
+       };
+
+       stm@20100000 {
+               power-domains = <&scmi_devpd 8>;
+       };
+
+       replicator@20120000 {
+               power-domains = <&scmi_devpd 8>;
+       };
+
+       funnel@220c0000 {
+               power-domains = <&scmi_devpd 8>;
+       };
+
+       funnel@230c0000 {
+               power-domains = <&scmi_devpd 8>;
+       };
+
+       hdlcd@7ff50000 {
+               clocks = <&scmi_clk 3>;
+       };
+
+       hdlcd@7ff60000 {
+               clocks = <&scmi_clk 3>;
+       };
+
+       /delete-node/ scpi;
+
+       firmware {
+               scmi {
+                       compatible = "arm,scmi";
+                       mbox-names = "tx", "rx";
+                       mboxes = <&mailbox 0 0 &mailbox 0 1>;
+                       shmem = <&cpu_scp_lpri0 &cpu_scp_lpri1>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       scmi_devpd: protocol@11 {
+                               reg = <0x11>;
+                               #power-domain-cells = <1>;
+                       };
+
+                       scmi_dvfs: protocol@13 {
+                               reg = <0x13>;
+                               #clock-cells = <1>;
+                               mbox-names = "tx", "rx";
+                               mboxes = <&mailbox 1 0 &mailbox 1 1>;
+                               shmem = <&cpu_scp_hpri0 &cpu_scp_hpri1>;
+                       };
+
+                       scmi_clk: protocol@14 {
+                               reg = <0x14>;
+                               #clock-cells = <1>;
+                       };
+
+                       scmi_sensors0: protocol@15 {
+                               reg = <0x15>;
+                               #thermal-sensor-cells = <1>;
+                       };
+               };
+       };
+
+       thermal-zones {
+               pmic {
+                       thermal-sensors = <&scmi_sensors0 0>;
+               };
+
+               soc {
+                       thermal-sensors = <&scmi_sensors0 3>;
+               };
+
+               big-cluster {
+                       thermal-sensors = <&scmi_sensors0 21>;
+               };
+
+               little-cluster {
+                       thermal-sensors = <&scmi_sensors0 22>;
+               };
+
+               gpu0 {
+                       thermal-sensors = <&scmi_sensors0 23>;
+               };
+
+               gpu1 {
+                       thermal-sensors = <&scmi_sensors0 24>;
+               };
+       };
+
+};
+
+&A53_0 {
+       clocks = <&scmi_dvfs 1>;
+};
+&A53_1 {
+       clocks = <&scmi_dvfs 1>;
+};
+&A53_2 {
+       clocks = <&scmi_dvfs 1>;
+};
+&A53_3 {
+       clocks = <&scmi_dvfs 1>;
+};
+
+&cpu_debug0 {
+       power-domains = <&scmi_devpd 8>;
+};
+&cpu_debug1 {
+       power-domains = <&scmi_devpd 8>;
+};
+&cpu_debug2 {
+       power-domains = <&scmi_devpd 8>;
+};
+&cpu_debug3 {
+       power-domains = <&scmi_devpd 8>;
+};
+&cpu_debug4 {
+       power-domains = <&scmi_devpd 8>;
+};
+&cpu_debug5 {
+       power-domains = <&scmi_devpd 8>;
+};
+
+&etm0 {
+       power-domains = <&scmi_devpd 8>;
+};
+&etm1 {
+       power-domains = <&scmi_devpd 8>;
+};
+&etm2 {
+       power-domains = <&scmi_devpd 8>;
+};
+&etm3 {
+       power-domains = <&scmi_devpd 8>;
+};
+&etm4 {
+       power-domains = <&scmi_devpd 8>;
+};
+&etm5 {
+       power-domains = <&scmi_devpd 8>;
+};
+
+&gpu {
+       clocks = <&scmi_dvfs 2>;
+       power-domains = <&scmi_devpd 9>;
+};
+
+&mailbox {
+       compatible = "arm,mhu-doorbell", "arm,primecell";
+       #mbox-cells = <2>;
+       mbox-name = "ARM-MHU";
+};
+
+&smmu_etr {
+       power-domains = <&scmi_devpd 8>;
+};
+
+&smmu_gpu {
+       power-domains = <&scmi_devpd 9>;
+};
+
+&sram {
+       /delete-node/ scp-sram@0;
+       /delete-node/ scp-sram@200;
+
+       cpu_scp_lpri0: scp-sram@0 {
+               compatible = "arm,scmi-shmem";
+               reg = <0x0 0x80>;
+       };
+
+       cpu_scp_lpri1: scp-sram@80 {
+               compatible = "arm,scmi-shmem";
+               reg = <0x80 0x80>;
+       };
+
+       cpu_scp_hpri0: scp-sram@100 {
+               compatible = "arm,scmi-shmem";
+               reg = <0x100 0x80>;
+       };
+
+       cpu_scp_hpri1: scp-sram@180 {
+               compatible = "arm,scmi-shmem";
+               reg = <0x180 0x80>;
+       };
+};
index b41e86d..6e4ba69 100644 (file)
@@ -1,6 +1,8 @@
 # SPDX-License-Identifier: GPL-2.0
 dtb-$(CONFIG_ARCH_EXYNOS) += \
-       exynos5433-tm2.dtb      \
-       exynos5433-tm2e.dtb     \
-       exynos7-espresso.dtb    \
+       exynos5433-tm2.dtb              \
+       exynos5433-tm2e.dtb             \
+       exynos7-espresso.dtb            \
+       exynos7885-jackpotlte.dtb       \
+       exynos850-e850-96.dtb           \
        exynosautov9-sadk.dtb
index 32a6518..4b46af3 100644 (file)
 
 #include <dt-bindings/pinctrl/samsung.h>
 
-#define PIN(_func, _pin, _pull, _drv)                                  \
-       _pin {                                                          \
+#define PIN(_pin, _func, _pull, _drv)                                  \
+       pin- ## _pin {                                                  \
                samsung,pins = #_pin;                                   \
                samsung,pin-function = <EXYNOS_PIN_FUNC_ ##_func>;      \
                samsung,pin-pud = <EXYNOS_PIN_PULL_ ##_pull>;           \
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_ ##_drv>;         \
        }
 
+#define PIN_IN(_pin, _pull, _drv)                                      \
+       PIN(_pin, INPUT, _pull, _drv)
+
+#define PIN_OT(_pin, _pull, _drv)                                      \
+       PIN(_pin, OUTPUT, _pull, _drv)
+
+#define PIN_F2(_pin, _pull, _drv)                                      \
+       PIN(_pin, 2, _pull, _drv)
+
 &pinctrl_alive {
-       gpa0: gpa0 {
+       gpa0: gpa0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -37,7 +46,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpa1: gpa1 {
+       gpa1: gpa1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -54,7 +63,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpa2: gpa2 {
+       gpa2: gpa2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -62,7 +71,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpa3: gpa3 {
+       gpa3: gpa3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -70,7 +79,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpf1: gpf1 {
+       gpf1: gpf1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -78,7 +87,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpf2: gpf2 {
+       gpf2: gpf2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -86,7 +95,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpf3: gpf3 {
+       gpf3: gpf3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf4: gpf4 {
+       gpf4: gpf4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf5: gpf5 {
+       gpf5: gpf5-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
 };
 
 &pinctrl_aud {
-       gpz0: gpz0 {
+       gpz0: gpz0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpz1: gpz1 {
+       gpz1: gpz1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       i2s0_bus: i2s0-bus {
+       i2s0_bus: i2s0-bus-pins {
                samsung,pins = "gpz0-0", "gpz0-1", "gpz0-2", "gpz0-3",
                                "gpz0-4", "gpz0-5", "gpz0-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       pcm0_bus: pcm0-bus {
+       pcm0_bus: pcm0-bus-pins {
                samsung,pins = "gpz1-0", "gpz1-1", "gpz1-2", "gpz1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       uart_aud_bus: uart-aud-bus {
+       uart_aud_bus: uart-aud-bus-pins {
                samsung,pins = "gpz1-3", "gpz1-2", "gpz1-1", "gpz1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
 };
 
 &pinctrl_cpif {
-       gpv6: gpv6 {
+       gpv6: gpv6-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
 };
 
 &pinctrl_ese {
-       gpj2: gpj2 {
+       gpj2: gpj2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
 };
 
 &pinctrl_finger {
-       gpd5: gpd5 {
+       gpd5: gpd5-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       spi2_bus: spi2-bus {
+       spi2_bus: spi2-bus-pins {
                samsung,pins = "gpd5-0", "gpd5-2", "gpd5-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       hs_i2c6_bus: hs-i2c6-bus {
+       hs_i2c6_bus: hs-i2c6-bus-pins {
                samsung,pins = "gpd5-3", "gpd5-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
 };
 
 &pinctrl_fsys {
-       gph1: gph1 {
+       gph1: gph1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpr4: gpr4 {
+       gpr4: gpr4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpr0: gpr0 {
+       gpr0: gpr0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpr1: gpr1 {
+       gpr1: gpr1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpr2: gpr2 {
+       gpr2: gpr2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpr3: gpr3 {
+       gpr3: gpr3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       sd0_clk: sd0-clk {
+       sd0_clk: sd0-clk-pins {
                samsung,pins = "gpr0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
        };
 
-       sd0_cmd: sd0-cmd {
+       sd0_cmd: sd0-cmd-pins {
                samsung,pins = "gpr0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
        };
 
-       sd0_rdqs: sd0-rdqs {
+       sd0_rdqs: sd0-rdqs-pins {
                samsung,pins = "gpr0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
        };
 
-       sd0_qrdy: sd0-qrdy {
+       sd0_qrdy: sd0-qrdy-pins {
                samsung,pins = "gpr0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
        };
 
-       sd0_bus1: sd0-bus-width1 {
+       sd0_bus1: sd0-bus-width1-pins {
                samsung,pins = "gpr1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
        };
 
-       sd0_bus4: sd0-bus-width4 {
+       sd0_bus4: sd0-bus-width4-pins {
                samsung,pins = "gpr1-1", "gpr1-2", "gpr1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
        };
 
-       sd0_bus8: sd0-bus-width8 {
+       sd0_bus8: sd0-bus-width8-pins {
                samsung,pins = "gpr1-4", "gpr1-5", "gpr1-6", "gpr1-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
        };
 
-       sd1_clk: sd1-clk {
+       sd1_clk: sd1-clk-pins {
                samsung,pins = "gpr2-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
        };
 
-       sd1_cmd: sd1-cmd {
+       sd1_cmd: sd1-cmd-pins {
                samsung,pins = "gpr2-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
        };
 
-       sd1_bus1: sd1-bus-width1 {
+       sd1_bus1: sd1-bus-width1-pins {
                samsung,pins = "gpr3-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
        };
 
-       sd1_bus4: sd1-bus-width4 {
+       sd1_bus4: sd1-bus-width4-pins {
                samsung,pins = "gpr3-1", "gpr3-2", "gpr3-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
        };
 
-       sd1_bus8: sd1-bus-width8 {
+       sd1_bus8: sd1-bus-width8-pins {
                samsung,pins = "gpr3-4", "gpr3-5", "gpr3-6", "gpr3-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
        };
 
-       pcie_bus: pcie_bus {
+       pcie_bus: pcie-bus-pins {
                samsung,pins = "gpr3-4", "gpr3-5", "gpr3-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
        };
 
-       sd2_clk: sd2-clk {
+       sd2_clk: sd2-clk-pins {
                samsung,pins = "gpr4-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
        };
 
-       sd2_cmd: sd2-cmd {
+       sd2_cmd: sd2-cmd-pins {
                samsung,pins = "gpr4-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
        };
 
-       sd2_cd: sd2-cd {
+       sd2_cd: sd2-cd-pins {
                samsung,pins = "gpr4-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
        };
 
-       sd2_bus1: sd2-bus-width1 {
+       sd2_bus1: sd2-bus-width1-pins {
                samsung,pins = "gpr4-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
        };
 
-       sd2_bus4: sd2-bus-width4 {
+       sd2_bus4: sd2-bus-width4-pins {
                samsung,pins = "gpr4-4", "gpr4-5", "gpr4-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
        };
 
-       sd2_clk_output: sd2-clk-output {
+       sd2_clk_output: sd2-clk-output-pins {
                samsung,pins = "gpr4-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR3>;
        };
 
-       sd2_cmd_output: sd2-cmd-output {
+       sd2_cmd_output: sd2-cmd-output-pins {
                samsung,pins = "gpr4-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
 };
 
 &pinctrl_imem {
-       gpf0: gpf0 {
+       gpf0: gpf0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
 };
 
 &pinctrl_nfc {
-       gpj0: gpj0 {
+       gpj0: gpj0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       hs_i2c4_bus: hs-i2c4-bus {
+       hs_i2c4_bus: hs-i2c4-bus-pins {
                samsung,pins = "gpj0-1", "gpj0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
 };
 
 &pinctrl_peric {
-       gpv7: gpv7 {
+       gpv7: gpv7-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpb0: gpb0 {
+       gpb0: gpb0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpc0: gpc0 {
+       gpc0: gpc0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpc1: gpc1 {
+       gpc1: gpc1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpc2: gpc2 {
+       gpc2: gpc2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpc3: gpc3 {
+       gpc3: gpc3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpg0: gpg0 {
+       gpg0: gpg0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpd0: gpd0 {
+       gpd0: gpd0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpd1: gpd1 {
+       gpd1: gpd1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpd2: gpd2 {
+       gpd2: gpd2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpd4: gpd4 {
+       gpd4: gpd4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpd8: gpd8 {
+       gpd8: gpd8-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpd6: gpd6 {
+       gpd6: gpd6-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpd7: gpd7 {
+       gpd7: gpd7-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpg1: gpg1 {
+       gpg1: gpg1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpg2: gpg2 {
+       gpg2: gpg2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpg3: gpg3 {
+       gpg3: gpg3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       hs_i2c8_bus: hs-i2c8-bus {
+       hs_i2c8_bus: hs-i2c8-bus-pins {
                samsung,pins = "gpb0-1", "gpb0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       hs_i2c9_bus: hs-i2c9-bus {
+       hs_i2c9_bus: hs-i2c9-bus-pins {
                samsung,pins = "gpb0-3", "gpb0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       i2s1_bus: i2s1-bus {
+       i2s1_bus: i2s1-bus-pins {
                samsung,pins = "gpd4-0", "gpd4-1", "gpd4-2",
                                "gpd4-3", "gpd4-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       pcm1_bus: pcm1-bus {
+       pcm1_bus: pcm1-bus-pins {
                samsung,pins = "gpd4-0", "gpd4-1", "gpd4-2",
                                "gpd4-3", "gpd4-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       spdif_bus: spdif-bus {
+       spdif_bus: spdif-bus-pins {
                samsung,pins = "gpd4-3", "gpd4-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       fimc_is_spi_pin0: fimc-is-spi-pin0 {
+       fimc_is_spi_pin0: fimc-is-spi-pin0-pins {
                samsung,pins = "gpc3-3", "gpc3-2", "gpc3-1", "gpc3-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       fimc_is_spi_pin1: fimc-is-spi-pin1 {
+       fimc_is_spi_pin1: fimc-is-spi-pin1-pins {
                samsung,pins = "gpc3-7", "gpc3-6", "gpc3-5", "gpc3-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       uart0_bus: uart0-bus {
+       uart0_bus: uart0-bus-pins {
                samsung,pins = "gpd0-3", "gpd0-2", "gpd0-1", "gpd0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       hs_i2c2_bus: hs-i2c2-bus {
+       hs_i2c2_bus: hs-i2c2-bus-pins {
                samsung,pins = "gpd0-3", "gpd0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       uart2_bus: uart2-bus {
+       uart2_bus: uart2-bus-pins {
                samsung,pins = "gpd1-5", "gpd1-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       uart1_bus: uart1-bus {
+       uart1_bus: uart1-bus-pins {
                samsung,pins = "gpd1-3", "gpd1-2", "gpd1-1", "gpd1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
-       hs_i2c3_bus: hs-i2c3-bus {
+       hs_i2c3_bus: hs-i2c3-bus-pins {
                samsung,pins = "gpd1-3", "gpd1-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       hs_i2c0_bus: hs-i2c0-bus {
+       hs_i2c0_bus: hs-i2c0-bus-pins {
                samsung,pins = "gpd2-1", "gpd2-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       hs_i2c1_bus: hs-i2c1-bus {
+       hs_i2c1_bus: hs-i2c1-bus-pins {
                samsung,pins = "gpd2-3", "gpd2-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       pwm0_out: pwm0-out {
+       pwm0_out: pwm0-out-pins {
                samsung,pins = "gpd2-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       pwm1_out: pwm1-out {
+       pwm1_out: pwm1-out-pins {
                samsung,pins = "gpd2-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       pwm2_out: pwm2-out {
+       pwm2_out: pwm2-out-pins {
                samsung,pins = "gpd2-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       pwm3_out: pwm3-out {
+       pwm3_out: pwm3-out-pins {
                samsung,pins = "gpd2-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       spi1_bus: spi1-bus {
+       spi1_bus: spi1-bus-pins {
                samsung,pins = "gpd6-2", "gpd6-4", "gpd6-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       hs_i2c7_bus: hs-i2c7-bus {
+       hs_i2c7_bus: hs-i2c7-bus-pins {
                samsung,pins = "gpd2-7", "gpd2-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       spi0_bus: spi0-bus {
+       spi0_bus: spi0-bus-pins {
                samsung,pins = "gpd8-0", "gpd6-0", "gpd6-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       hs_i2c10_bus: hs-i2c10-bus {
+       hs_i2c10_bus: hs-i2c10-bus-pins {
                samsung,pins = "gpg3-1", "gpg3-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       hs_i2c11_bus: hs-i2c11-bus {
+       hs_i2c11_bus: hs-i2c11-bus-pins {
                samsung,pins = "gpg3-3", "gpg3-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       spi3_bus: spi3-bus {
+       spi3_bus: spi3-bus-pins {
                samsung,pins = "gpg3-4", "gpg3-6", "gpg3-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       spi4_bus: spi4-bus {
+       spi4_bus: spi4-bus-pins {
                samsung,pins = "gpv7-1", "gpv7-3", "gpv7-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       fimc_is_uart: fimc-is-uart {
+       fimc_is_uart: fimc-is-uart-pins {
                samsung,pins = "gpc1-1", "gpc0-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       fimc_is_ch0_i2c: fimc-is-ch0_i2c {
+       fimc_is_ch0_i2c: fimc-is-ch0-i2c-pins {
                samsung,pins = "gpc2-1", "gpc2-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       fimc_is_ch0_mclk: fimc-is-ch0_mclk {
+       fimc_is_ch0_mclk: fimc-is-ch0-mclk-pins {
                samsung,pins = "gpd7-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       fimc_is_ch1_i2c: fimc-is-ch1-i2c {
+       fimc_is_ch1_i2c: fimc-is-ch1-i2c-pins {
                samsung,pins = "gpc2-3", "gpc2-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       fimc_is_ch1_mclk: fimc-is-ch1-mclk {
+       fimc_is_ch1_mclk: fimc-is-ch1-mclk-pins {
                samsung,pins = "gpd7-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       fimc_is_ch2_i2c: fimc-is-ch2-i2c {
+       fimc_is_ch2_i2c: fimc-is-ch2-i2c-pins {
                samsung,pins = "gpc2-5", "gpc2-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
        };
 
-       fimc_is_ch2_mclk: fimc-is-ch2-mclk {
+       fimc_is_ch2_mclk: fimc-is-ch2-mclk-pins {
                samsung,pins = "gpd7-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
 };
 
 &pinctrl_touch {
-       gpj1: gpj1 {
+       gpj1: gpj1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       hs_i2c5_bus: hs-i2c5-bus {
+       hs_i2c5_bus: hs-i2c5-bus-pins {
                samsung,pins = "gpj1-1", "gpj1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
index cbcc01a..91c9bd1 100644 (file)
                interrupts = <5 IRQ_TYPE_EDGE_FALLING>;
                reg = <0x66>;
 
-               muic: max77843-muic {
+               muic: extcon {
                        compatible = "maxim,max77843-muic";
 
-                       musb_con: musb-connector {
+                       musb_con: connector {
                                compatible = "samsung,usb-connector-11pin",
                                             "usb-b-connector";
                                label = "micro-USB";
                                        #address-cells = <1>;
                                        #size-cells = <0>;
 
+                                       port@0 {
+                                               /*
+                                                * TODO: The DTS this is based on does not have
+                                                * port@0 which is a required property. The ports
+                                                * look incomplete and need fixing.
+                                                * Add a disabled port just to satisfy dtschema.
+                                                */
+                                               reg = <0>;
+                                               status = "disabled";
+                                       };
+
                                        port@3 {
                                                reg = <3>;
                                                musb_con_to_mhl: endpoint {
                        };
                };
 
-               haptic: max77843-haptic {
+               haptic: motor-driver {
                        compatible = "maxim,max77843-haptic";
                        haptic-supply = <&ldo38_reg>;
                        pwms = <&pwm 0 33670 0>;
        pinctrl-0 = <&initial_alive>;
 
        initial_alive: initial-state {
-               PIN(INPUT, gpa0-0, DOWN, FAST_SR1);
-               PIN(INPUT, gpa0-1, NONE, FAST_SR1);
-               PIN(INPUT, gpa0-2, DOWN, FAST_SR1);
-               PIN(INPUT, gpa0-3, NONE, FAST_SR1);
-               PIN(INPUT, gpa0-4, NONE, FAST_SR1);
-               PIN(INPUT, gpa0-5, DOWN, FAST_SR1);
-               PIN(INPUT, gpa0-6, NONE, FAST_SR1);
-               PIN(INPUT, gpa0-7, NONE, FAST_SR1);
-
-               PIN(INPUT, gpa1-0, UP, FAST_SR1);
-               PIN(INPUT, gpa1-1, UP, FAST_SR1);
-               PIN(INPUT, gpa1-2, NONE, FAST_SR1);
-               PIN(INPUT, gpa1-3, DOWN, FAST_SR1);
-               PIN(INPUT, gpa1-4, DOWN, FAST_SR1);
-               PIN(INPUT, gpa1-5, NONE, FAST_SR1);
-               PIN(INPUT, gpa1-6, NONE, FAST_SR1);
-               PIN(INPUT, gpa1-7, NONE, FAST_SR1);
-
-               PIN(INPUT, gpa2-0, NONE, FAST_SR1);
-               PIN(INPUT, gpa2-1, NONE, FAST_SR1);
-               PIN(INPUT, gpa2-2, NONE, FAST_SR1);
-               PIN(INPUT, gpa2-3, DOWN, FAST_SR1);
-               PIN(INPUT, gpa2-4, NONE, FAST_SR1);
-               PIN(INPUT, gpa2-5, DOWN, FAST_SR1);
-               PIN(INPUT, gpa2-6, DOWN, FAST_SR1);
-               PIN(INPUT, gpa2-7, NONE, FAST_SR1);
-
-               PIN(INPUT, gpa3-0, DOWN, FAST_SR1);
-               PIN(INPUT, gpa3-1, DOWN, FAST_SR1);
-               PIN(INPUT, gpa3-2, NONE, FAST_SR1);
-               PIN(INPUT, gpa3-3, DOWN, FAST_SR1);
-               PIN(INPUT, gpa3-4, NONE, FAST_SR1);
-               PIN(INPUT, gpa3-5, DOWN, FAST_SR1);
-               PIN(INPUT, gpa3-6, DOWN, FAST_SR1);
-               PIN(INPUT, gpa3-7, DOWN, FAST_SR1);
-
-               PIN(INPUT, gpf1-0, NONE, FAST_SR1);
-               PIN(INPUT, gpf1-1, NONE, FAST_SR1);
-               PIN(INPUT, gpf1-2, DOWN, FAST_SR1);
-               PIN(INPUT, gpf1-4, UP, FAST_SR1);
-               PIN(OUTPUT, gpf1-5, NONE, FAST_SR1);
-               PIN(INPUT, gpf1-6, DOWN, FAST_SR1);
-               PIN(INPUT, gpf1-7, DOWN, FAST_SR1);
-
-               PIN(INPUT, gpf2-0, DOWN, FAST_SR1);
-               PIN(INPUT, gpf2-1, DOWN, FAST_SR1);
-               PIN(INPUT, gpf2-2, DOWN, FAST_SR1);
-               PIN(INPUT, gpf2-3, DOWN, FAST_SR1);
-
-               PIN(INPUT, gpf3-0, DOWN, FAST_SR1);
-               PIN(INPUT, gpf3-1, DOWN, FAST_SR1);
-               PIN(INPUT, gpf3-2, NONE, FAST_SR1);
-               PIN(INPUT, gpf3-3, DOWN, FAST_SR1);
-
-               PIN(INPUT, gpf4-0, DOWN, FAST_SR1);
-               PIN(INPUT, gpf4-1, DOWN, FAST_SR1);
-               PIN(INPUT, gpf4-2, DOWN, FAST_SR1);
-               PIN(INPUT, gpf4-3, DOWN, FAST_SR1);
-               PIN(INPUT, gpf4-4, DOWN, FAST_SR1);
-               PIN(INPUT, gpf4-5, DOWN, FAST_SR1);
-               PIN(INPUT, gpf4-6, DOWN, FAST_SR1);
-               PIN(INPUT, gpf4-7, DOWN, FAST_SR1);
-
-               PIN(INPUT, gpf5-0, DOWN, FAST_SR1);
-               PIN(INPUT, gpf5-1, DOWN, FAST_SR1);
-               PIN(INPUT, gpf5-2, DOWN, FAST_SR1);
-               PIN(INPUT, gpf5-3, DOWN, FAST_SR1);
-               PIN(OUTPUT, gpf5-4, NONE, FAST_SR1);
-               PIN(INPUT, gpf5-5, DOWN, FAST_SR1);
-               PIN(INPUT, gpf5-6, DOWN, FAST_SR1);
-               PIN(INPUT, gpf5-7, DOWN, FAST_SR1);
+               PIN_IN(gpa0-0, DOWN, FAST_SR1);
+               PIN_IN(gpa0-1, NONE, FAST_SR1);
+               PIN_IN(gpa0-2, DOWN, FAST_SR1);
+               PIN_IN(gpa0-3, NONE, FAST_SR1);
+               PIN_IN(gpa0-4, NONE, FAST_SR1);
+               PIN_IN(gpa0-5, DOWN, FAST_SR1);
+               PIN_IN(gpa0-6, NONE, FAST_SR1);
+               PIN_IN(gpa0-7, NONE, FAST_SR1);
+
+               PIN_IN(gpa1-0, UP, FAST_SR1);
+               PIN_IN(gpa1-1, UP, FAST_SR1);
+               PIN_IN(gpa1-2, NONE, FAST_SR1);
+               PIN_IN(gpa1-3, DOWN, FAST_SR1);
+               PIN_IN(gpa1-4, DOWN, FAST_SR1);
+               PIN_IN(gpa1-5, NONE, FAST_SR1);
+               PIN_IN(gpa1-6, NONE, FAST_SR1);
+               PIN_IN(gpa1-7, NONE, FAST_SR1);
+
+               PIN_IN(gpa2-0, NONE, FAST_SR1);
+               PIN_IN(gpa2-1, NONE, FAST_SR1);
+               PIN_IN(gpa2-2, NONE, FAST_SR1);
+               PIN_IN(gpa2-3, DOWN, FAST_SR1);
+               PIN_IN(gpa2-4, NONE, FAST_SR1);
+               PIN_IN(gpa2-5, DOWN, FAST_SR1);
+               PIN_IN(gpa2-6, DOWN, FAST_SR1);
+               PIN_IN(gpa2-7, NONE, FAST_SR1);
+
+               PIN_IN(gpa3-0, DOWN, FAST_SR1);
+               PIN_IN(gpa3-1, DOWN, FAST_SR1);
+               PIN_IN(gpa3-2, NONE, FAST_SR1);
+               PIN_IN(gpa3-3, DOWN, FAST_SR1);
+               PIN_IN(gpa3-4, NONE, FAST_SR1);
+               PIN_IN(gpa3-5, DOWN, FAST_SR1);
+               PIN_IN(gpa3-6, DOWN, FAST_SR1);
+               PIN_IN(gpa3-7, DOWN, FAST_SR1);
+
+               PIN_IN(gpf1-0, NONE, FAST_SR1);
+               PIN_IN(gpf1-1, NONE, FAST_SR1);
+               PIN_IN(gpf1-2, DOWN, FAST_SR1);
+               PIN_IN(gpf1-4, UP, FAST_SR1);
+               PIN_OT(gpf1-5, NONE, FAST_SR1);
+               PIN_IN(gpf1-6, DOWN, FAST_SR1);
+               PIN_IN(gpf1-7, DOWN, FAST_SR1);
+
+               PIN_IN(gpf2-0, DOWN, FAST_SR1);
+               PIN_IN(gpf2-1, DOWN, FAST_SR1);
+               PIN_IN(gpf2-2, DOWN, FAST_SR1);
+               PIN_IN(gpf2-3, DOWN, FAST_SR1);
+
+               PIN_IN(gpf3-0, DOWN, FAST_SR1);
+               PIN_IN(gpf3-1, DOWN, FAST_SR1);
+               PIN_IN(gpf3-2, NONE, FAST_SR1);
+               PIN_IN(gpf3-3, DOWN, FAST_SR1);
+
+               PIN_IN(gpf4-0, DOWN, FAST_SR1);
+               PIN_IN(gpf4-1, DOWN, FAST_SR1);
+               PIN_IN(gpf4-2, DOWN, FAST_SR1);
+               PIN_IN(gpf4-3, DOWN, FAST_SR1);
+               PIN_IN(gpf4-4, DOWN, FAST_SR1);
+               PIN_IN(gpf4-5, DOWN, FAST_SR1);
+               PIN_IN(gpf4-6, DOWN, FAST_SR1);
+               PIN_IN(gpf4-7, DOWN, FAST_SR1);
+
+               PIN_IN(gpf5-0, DOWN, FAST_SR1);
+               PIN_IN(gpf5-1, DOWN, FAST_SR1);
+               PIN_IN(gpf5-2, DOWN, FAST_SR1);
+               PIN_IN(gpf5-3, DOWN, FAST_SR1);
+               PIN_OT(gpf5-4, NONE, FAST_SR1);
+               PIN_IN(gpf5-5, DOWN, FAST_SR1);
+               PIN_IN(gpf5-6, DOWN, FAST_SR1);
+               PIN_IN(gpf5-7, DOWN, FAST_SR1);
        };
 
-       te_irq: te-irq {
+       te_irq: te-irq-pins {
                samsung,pins = "gpf1-3";
                samsung,pin-function = <0xf>;
        };
        pinctrl-0 = <&initial_cpif>;
 
        initial_cpif: initial-state {
-               PIN(INPUT, gpv6-0, DOWN, FAST_SR1);
-               PIN(INPUT, gpv6-1, DOWN, FAST_SR1);
+               PIN_IN(gpv6-0, DOWN, FAST_SR1);
+               PIN_IN(gpv6-1, DOWN, FAST_SR1);
        };
 };
 
        pinctrl-names = "default";
        pinctrl-0 = <&initial_ese>;
 
-       pcie_wlanen: pcie-wlanen {
-               PIN(INPUT, gpj2-0, UP, FAST_SR4);
+       pcie_wlanen: pcie-wlanen-pins {
+               samsung,pins = "gpj2-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
        };
 
        initial_ese: initial-state {
-               PIN(INPUT, gpj2-1, DOWN, FAST_SR1);
-               PIN(INPUT, gpj2-2, DOWN, FAST_SR1);
+               PIN_IN(gpj2-1, DOWN, FAST_SR1);
+               PIN_IN(gpj2-2, DOWN, FAST_SR1);
        };
 };
 
        pinctrl-0 = <&initial_fsys>;
 
        initial_fsys: initial-state {
-               PIN(INPUT, gpr3-0, NONE, FAST_SR1);
-               PIN(INPUT, gpr3-1, DOWN, FAST_SR1);
-               PIN(INPUT, gpr3-2, DOWN, FAST_SR1);
-               PIN(INPUT, gpr3-3, DOWN, FAST_SR1);
-               PIN(INPUT, gpr3-7, NONE, FAST_SR1);
+               PIN_IN(gpr3-0, NONE, FAST_SR1);
+               PIN_IN(gpr3-1, DOWN, FAST_SR1);
+               PIN_IN(gpr3-2, DOWN, FAST_SR1);
+               PIN_IN(gpr3-3, DOWN, FAST_SR1);
+               PIN_IN(gpr3-7, NONE, FAST_SR1);
        };
 };
 
        pinctrl-0 = <&initial_imem>;
 
        initial_imem: initial-state {
-               PIN(INPUT, gpf0-0, UP, FAST_SR1);
-               PIN(INPUT, gpf0-1, UP, FAST_SR1);
-               PIN(INPUT, gpf0-2, DOWN, FAST_SR1);
-               PIN(INPUT, gpf0-3, UP, FAST_SR1);
-               PIN(INPUT, gpf0-4, DOWN, FAST_SR1);
-               PIN(INPUT, gpf0-5, NONE, FAST_SR1);
-               PIN(INPUT, gpf0-6, DOWN, FAST_SR1);
-               PIN(INPUT, gpf0-7, UP, FAST_SR1);
+               PIN_IN(gpf0-0, UP, FAST_SR1);
+               PIN_IN(gpf0-1, UP, FAST_SR1);
+               PIN_IN(gpf0-2, DOWN, FAST_SR1);
+               PIN_IN(gpf0-3, UP, FAST_SR1);
+               PIN_IN(gpf0-4, DOWN, FAST_SR1);
+               PIN_IN(gpf0-5, NONE, FAST_SR1);
+               PIN_IN(gpf0-6, DOWN, FAST_SR1);
+               PIN_IN(gpf0-7, UP, FAST_SR1);
        };
 };
 
        pinctrl-0 = <&initial_nfc>;
 
        initial_nfc: initial-state {
-               PIN(INPUT, gpj0-2, DOWN, FAST_SR1);
+               PIN_IN(gpj0-2, DOWN, FAST_SR1);
        };
 };
 
        pinctrl-0 = <&initial_peric>;
 
        initial_peric: initial-state {
-               PIN(INPUT, gpv7-0, DOWN, FAST_SR1);
-               PIN(INPUT, gpv7-1, DOWN, FAST_SR1);
-               PIN(INPUT, gpv7-2, NONE, FAST_SR1);
-               PIN(INPUT, gpv7-3, DOWN, FAST_SR1);
-               PIN(INPUT, gpv7-4, DOWN, FAST_SR1);
-               PIN(INPUT, gpv7-5, DOWN, FAST_SR1);
+               PIN_IN(gpv7-0, DOWN, FAST_SR1);
+               PIN_IN(gpv7-1, DOWN, FAST_SR1);
+               PIN_IN(gpv7-2, NONE, FAST_SR1);
+               PIN_IN(gpv7-3, DOWN, FAST_SR1);
+               PIN_IN(gpv7-4, DOWN, FAST_SR1);
+               PIN_IN(gpv7-5, DOWN, FAST_SR1);
 
-               PIN(INPUT, gpb0-4, DOWN, FAST_SR1);
+               PIN_IN(gpb0-4, DOWN, FAST_SR1);
 
-               PIN(INPUT, gpc0-2, DOWN, FAST_SR1);
-               PIN(INPUT, gpc0-5, DOWN, FAST_SR1);
-               PIN(INPUT, gpc0-7, DOWN, FAST_SR1);
+               PIN_IN(gpc0-2, DOWN, FAST_SR1);
+               PIN_IN(gpc0-5, DOWN, FAST_SR1);
+               PIN_IN(gpc0-7, DOWN, FAST_SR1);
 
-               PIN(INPUT, gpc1-1, DOWN, FAST_SR1);
+               PIN_IN(gpc1-1, DOWN, FAST_SR1);
 
-               PIN(INPUT, gpc3-4, NONE, FAST_SR1);
-               PIN(INPUT, gpc3-5, NONE, FAST_SR1);
-               PIN(INPUT, gpc3-6, NONE, FAST_SR1);
-               PIN(INPUT, gpc3-7, NONE, FAST_SR1);
+               PIN_IN(gpc3-4, NONE, FAST_SR1);
+               PIN_IN(gpc3-5, NONE, FAST_SR1);
+               PIN_IN(gpc3-6, NONE, FAST_SR1);
+               PIN_IN(gpc3-7, NONE, FAST_SR1);
 
-               PIN(OUTPUT, gpg0-0, NONE, FAST_SR1);
-               PIN(2, gpg0-1, DOWN, FAST_SR1);
+               PIN_OT(gpg0-0, NONE, FAST_SR1);
+               PIN_F2(gpg0-1, DOWN, FAST_SR1);
 
-               PIN(INPUT, gpd2-5, DOWN, FAST_SR1);
+               PIN_IN(gpd2-5, DOWN, FAST_SR1);
 
-               PIN(INPUT, gpd4-0, NONE, FAST_SR1);
-               PIN(INPUT, gpd4-1, DOWN, FAST_SR1);
-               PIN(INPUT, gpd4-2, DOWN, FAST_SR1);
-               PIN(INPUT, gpd4-3, DOWN, FAST_SR1);
-               PIN(INPUT, gpd4-4, DOWN, FAST_SR1);
+               PIN_IN(gpd4-0, NONE, FAST_SR1);
+               PIN_IN(gpd4-1, DOWN, FAST_SR1);
+               PIN_IN(gpd4-2, DOWN, FAST_SR1);
+               PIN_IN(gpd4-3, DOWN, FAST_SR1);
+               PIN_IN(gpd4-4, DOWN, FAST_SR1);
 
-               PIN(INPUT, gpd6-3, DOWN, FAST_SR1);
+               PIN_IN(gpd6-3, DOWN, FAST_SR1);
 
-               PIN(INPUT, gpd8-1, UP, FAST_SR1);
+               PIN_IN(gpd8-1, UP, FAST_SR1);
 
-               PIN(INPUT, gpg1-0, DOWN, FAST_SR1);
-               PIN(INPUT, gpg1-1, DOWN, FAST_SR1);
-               PIN(INPUT, gpg1-2, DOWN, FAST_SR1);
-               PIN(INPUT, gpg1-3, DOWN, FAST_SR1);
-               PIN(INPUT, gpg1-4, DOWN, FAST_SR1);
+               PIN_IN(gpg1-0, DOWN, FAST_SR1);
+               PIN_IN(gpg1-1, DOWN, FAST_SR1);
+               PIN_IN(gpg1-2, DOWN, FAST_SR1);
+               PIN_IN(gpg1-3, DOWN, FAST_SR1);
+               PIN_IN(gpg1-4, DOWN, FAST_SR1);
 
-               PIN(INPUT, gpg2-0, DOWN, FAST_SR1);
-               PIN(INPUT, gpg2-1, DOWN, FAST_SR1);
+               PIN_IN(gpg2-0, DOWN, FAST_SR1);
+               PIN_IN(gpg2-1, DOWN, FAST_SR1);
 
-               PIN(INPUT, gpg3-0, DOWN, FAST_SR1);
-               PIN(INPUT, gpg3-1, DOWN, FAST_SR1);
-               PIN(INPUT, gpg3-5, DOWN, FAST_SR1);
+               PIN_IN(gpg3-0, DOWN, FAST_SR1);
+               PIN_IN(gpg3-1, DOWN, FAST_SR1);
+               PIN_IN(gpg3-5, DOWN, FAST_SR1);
        };
 };
 
        pinctrl-0 = <&initial_touch>;
 
        initial_touch: initial-state {
-               PIN(INPUT, gpj1-2, DOWN, FAST_SR1);
+               PIN_IN(gpj1-2, DOWN, FAST_SR1);
        };
 };
 
index bfe4ed8..661567d 100644 (file)
                        status = "disabled";
                };
 
-               pdma0: pdma@15610000 {
+               pdma0: dma-controller@15610000 {
                        compatible = "arm,pl330", "arm,primecell";
                        reg = <0x15610000 0x1000>;
                        interrupts = <GIC_SPI 228 IRQ_TYPE_LEVEL_HIGH>;
                        #dma-requests = <32>;
                };
 
-               pdma1: pdma@15600000 {
+               pdma1: dma-controller@15600000 {
                        compatible = "arm,pl330", "arm,primecell";
                        reg = <0x15600000 0x1000>;
                        interrupts = <GIC_SPI 246 IRQ_TYPE_LEVEL_HIGH>;
                        reg = <0x11400000 0x100>, <0x11500000 0x08>;
                        clocks = <&cmu_aud CLK_PCLK_SFR0_CTRL>;
                        clock-names = "sfr0_ctrl";
-                       samsung,pmu-syscon = <&pmu_system_controller>;
                        power-domains = <&pd_aud>;
                        #address-cells = <1>;
                        #size-cells = <1>;
                        ranges;
 
-                       adma: adma@11420000 {
+                       adma: dma-controller@11420000 {
                                compatible = "arm,pl330", "arm,primecell";
                                reg = <0x11420000 0x1000>;
                                interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
index 125c03f..0895e81 100644 (file)
 };
 
 &pinctrl_alive {
-       pmic_irq: pmic-irq {
+       pmic_irq: pmic-irq-pins {
                samsung,pins = "gpa0-2";
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
 };
 
 &pinctrl_bus1 {
-       usb30_vbus_en: usb30-vbus-en {
+       usb30_vbus_en: usb30-vbus-en-pins {
                samsung,pins = "gph1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       usb3drd_boost_en: usb3drd-boost-en {
+       usb3drd_boost_en: usb3drd-boost-en-pins {
                samsung,pins = "gpf4-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        status = "okay";
 };
 
+&usbdrd {
+       vdd10-supply = <&ldo4_reg>;
+       vdd33-supply = <&ldo6_reg>;
+};
+
 &usbdrd_phy {
        vbus-supply = <&usb30_vbus_reg>;
        vbus-boost-supply = <&usb3drd_boost_5v>;
index 472dd64..be9b971 100644 (file)
@@ -12,7 +12,7 @@
 #include <dt-bindings/pinctrl/samsung.h>
 
 &pinctrl_alive {
-       gpa0: gpa0 {
+       gpa0: gpa0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -29,7 +29,7 @@
                             <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
        };
 
-       gpa1: gpa1 {
+       gpa1: gpa1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -46,7 +46,7 @@
                             <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;
        };
 
-       gpa2: gpa2 {
+       gpa2: gpa2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -54,7 +54,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpa3: gpa3 {
+       gpa3: gpa3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -64,7 +64,7 @@
 };
 
 &pinctrl_bus0 {
-       gpb0: gpb0 {
+       gpb0: gpb0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -72,7 +72,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpc0: gpc0 {
+       gpc0: gpc0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -80,7 +80,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpc1: gpc1 {
+       gpc1: gpc1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -88,7 +88,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpc2: gpc2 {
+       gpc2: gpc2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -96,7 +96,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpc3: gpc3 {
+       gpc3: gpc3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpd0: gpd0 {
+       gpd0: gpd0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpd1: gpd1 {
+       gpd1: gpd1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpd2: gpd2 {
+       gpd2: gpd2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpd4: gpd4 {
+       gpd4: gpd4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpd5: gpd5 {
+       gpd5: gpd5-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpd6: gpd6 {
+       gpd6: gpd6-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpd7: gpd7 {
+       gpd7: gpd7-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpd8: gpd8 {
+       gpd8: gpd8-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpg0: gpg0 {
+       gpg0: gpg0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpg3: gpg3 {
+       gpg3: gpg3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       hs_i2c10_bus: hs-i2c10-bus {
+       hs_i2c10_bus: hs-i2c10-bus-pins {
                samsung,pins = "gpb0-1", "gpb0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       hs_i2c11_bus: hs-i2c11-bus {
+       hs_i2c11_bus: hs-i2c11-bus-pins {
                samsung,pins = "gpb0-3", "gpb0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       hs_i2c2_bus: hs-i2c2-bus {
+       hs_i2c2_bus: hs-i2c2-bus-pins {
                samsung,pins = "gpd0-3", "gpd0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart0_data: uart0-data {
+       uart0_data: uart0-data-pins {
                samsung,pins = "gpd0-0", "gpd0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart0_fctl: uart0-fctl {
+       uart0_fctl: uart0-fctl-pins {
                samsung,pins = "gpd0-2", "gpd0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart2_data: uart2-data {
+       uart2_data: uart2-data-pins {
                samsung,pins = "gpd1-4", "gpd1-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       hs_i2c3_bus: hs-i2c3-bus {
+       hs_i2c3_bus: hs-i2c3-bus-pins {
                samsung,pins = "gpd1-3", "gpd1-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart1_data: uart1-data {
+       uart1_data: uart1-data-pins {
                samsung,pins = "gpd1-0", "gpd1-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart1_fctl: uart1-fctl {
+       uart1_fctl: uart1-fctl-pins {
                samsung,pins = "gpd1-2", "gpd1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       hs_i2c0_bus: hs-i2c0-bus {
+       hs_i2c0_bus: hs-i2c0-bus-pins {
                samsung,pins = "gpd2-1", "gpd2-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       hs_i2c1_bus: hs-i2c1-bus {
+       hs_i2c1_bus: hs-i2c1-bus-pins {
                samsung,pins = "gpd2-3", "gpd2-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       hs_i2c9_bus: hs-i2c9-bus {
+       hs_i2c9_bus: hs-i2c9-bus-pins {
                samsung,pins = "gpd2-7", "gpd2-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pwm0_out: pwm0-out {
+       pwm0_out: pwm0-out-pins {
                samsung,pins = "gpd2-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pwm1_out: pwm1-out {
+       pwm1_out: pwm1-out-pins {
                samsung,pins = "gpd2-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pwm2_out: pwm2-out {
+       pwm2_out: pwm2-out-pins {
                samsung,pins = "gpd2-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       pwm3_out: pwm3-out {
+       pwm3_out: pwm3-out-pins {
                samsung,pins = "gpd2-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       hs_i2c8_bus: hs-i2c8-bus {
+       hs_i2c8_bus: hs-i2c8-bus-pins {
                samsung,pins = "gpd5-3", "gpd5-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       uart3_data: uart3-data {
+       uart3_data: uart3-data-pins {
                samsung,pins = "gpd5-0", "gpd5-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       spi2_bus: spi2-bus {
+       spi2_bus: spi2-bus-pins {
                samsung,pins = "gpd5-0", "gpd5-1", "gpd5-2", "gpd5-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       spi1_bus: spi1-bus {
+       spi1_bus: spi1-bus-pins {
                samsung,pins = "gpd6-2", "gpd6-3", "gpd6-4", "gpd6-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       spi0_bus: spi0-bus {
+       spi0_bus: spi0-bus-pins {
                samsung,pins = "gpd8-0", "gpd8-1", "gpd6-0", "gpd6-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       hs_i2c4_bus: hs-i2c4-bus {
+       hs_i2c4_bus: hs-i2c4-bus-pins {
                samsung,pins = "gpg3-1", "gpg3-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       hs_i2c5_bus: hs-i2c5-bus {
+       hs_i2c5_bus: hs-i2c5-bus-pins {
                samsung,pins = "gpg3-3", "gpg3-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
 };
 
 &pinctrl_nfc {
-       gpj0: gpj0 {
+       gpj0: gpj0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       hs_i2c6_bus: hs-i2c6-bus {
+       hs_i2c6_bus: hs-i2c6-bus-pins {
                samsung,pins = "gpj0-1", "gpj0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
 };
 
 &pinctrl_touch {
-       gpj1: gpj1 {
+       gpj1: gpj1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       hs_i2c7_bus: hs-i2c7-bus {
+       hs_i2c7_bus: hs-i2c7-bus-pins {
                samsung,pins = "gpj1-1", "gpj1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
 };
 
 &pinctrl_ff {
-       gpg4: gpg4 {
+       gpg4: gpg4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       spi3_bus: spi3-bus {
+       spi3_bus: spi3-bus-pins {
                samsung,pins = "gpg4-0", "gpg4-1", "gpg4-2", "gpg4-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
 };
 
 &pinctrl_ese {
-       gpv7: gpv7 {
+       gpv7: gpv7-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       spi4_bus: spi4-bus {
+       spi4_bus: spi4-bus-pins {
                samsung,pins = "gpv7-0", "gpv7-1", "gpv7-2", "gpv7-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
 };
 
 &pinctrl_fsys0 {
-       gpr4: gpr4 {
+       gpr4: gpr4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       sd2_clk: sd2-clk {
+       sd2_clk: sd2-clk-pins {
                samsung,pins = "gpr4-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_cmd: sd2-cmd {
+       sd2_cmd: sd2-cmd-pins {
                samsung,pins = "gpr4-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_cd: sd2-cd {
+       sd2_cd: sd2-cd-pins {
                samsung,pins = "gpr4-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_bus1: sd2-bus-width1 {
+       sd2_bus1: sd2-bus-width1-pins {
                samsung,pins = "gpr4-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
        };
 
-       sd2_bus4: sd2-bus-width4 {
+       sd2_bus4: sd2-bus-width4-pins {
                samsung,pins = "gpr4-4", "gpr4-5", "gpr4-6";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
 };
 
 &pinctrl_fsys1 {
-       gpr0: gpr0 {
+       gpr0: gpr0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpr1: gpr1 {
+       gpr1: gpr1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpr2: gpr2 {
+       gpr2: gpr2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpr3: gpr3 {
+       gpr3: gpr3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       sd0_clk: sd0-clk {
+       sd0_clk: sd0-clk-pins {
                samsung,pins = "gpr0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS7_FSYS1_PIN_DRV_LV2>;
        };
 
-       sd0_cmd: sd0-cmd {
+       sd0_cmd: sd0-cmd-pins {
                samsung,pins = "gpr0-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS7_FSYS1_PIN_DRV_LV2>;
        };
 
-       sd0_ds: sd0-ds {
+       sd0_ds: sd0-ds-pins {
                samsung,pins = "gpr0-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
                samsung,pin-drv = <EXYNOS7_FSYS1_PIN_DRV_LV2>;
        };
 
-       sd0_qrdy: sd0-qrdy {
+       sd0_qrdy: sd0-qrdy-pins {
                samsung,pins = "gpr0-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
                samsung,pin-drv = <EXYNOS7_FSYS1_PIN_DRV_LV2>;
        };
 
-       sd0_bus1: sd0-bus-width1 {
+       sd0_bus1: sd0-bus-width1-pins {
                samsung,pins = "gpr1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS7_FSYS1_PIN_DRV_LV2>;
        };
 
-       sd0_bus4: sd0-bus-width4 {
+       sd0_bus4: sd0-bus-width4-pins {
                samsung,pins = "gpr1-1", "gpr1-2", "gpr1-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS7_FSYS1_PIN_DRV_LV2>;
        };
 
-       sd0_bus8: sd0-bus-width8 {
+       sd0_bus8: sd0-bus-width8-pins {
                samsung,pins = "gpr1-4", "gpr1-5", "gpr1-6", "gpr1-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS7_FSYS1_PIN_DRV_LV2>;
        };
 
-       sd1_clk: sd1-clk {
+       sd1_clk: sd1-clk-pins {
                samsung,pins = "gpr2-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS7_FSYS1_PIN_DRV_LV3>;
        };
 
-       sd1_cmd: sd1-cmd {
+       sd1_cmd: sd1-cmd-pins {
                samsung,pins = "gpr2-1";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS7_FSYS1_PIN_DRV_LV3>;
        };
 
-       sd1_ds: sd1-ds {
+       sd1_ds: sd1-ds-pins {
                samsung,pins = "gpr2-2";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
                samsung,pin-drv = <EXYNOS7_FSYS1_PIN_DRV_LV4>;
        };
 
-       sd1_qrdy: sd1-qrdy {
+       sd1_qrdy: sd1-qrdy-pins {
                samsung,pins = "gpr2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
                samsung,pin-drv = <EXYNOS7_FSYS1_PIN_DRV_LV4>;
        };
 
-       sd1_int: sd1-int {
+       sd1_int: sd1-int-pins {
                samsung,pins = "gpr2-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
                samsung,pin-drv = <EXYNOS7_FSYS1_PIN_DRV_LV4>;
        };
 
-       sd1_bus1: sd1-bus-width1 {
+       sd1_bus1: sd1-bus-width1-pins {
                samsung,pins = "gpr3-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS7_FSYS1_PIN_DRV_LV3>;
        };
 
-       sd1_bus4: sd1-bus-width4 {
+       sd1_bus4: sd1-bus-width4-pins {
                samsung,pins = "gpr3-1", "gpr3-2", "gpr3-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS7_FSYS1_PIN_DRV_LV3>;
        };
 
-       sd1_bus8: sd1-bus-width8 {
+       sd1_bus8: sd1-bus-width8-pins {
                samsung,pins = "gpr3-4", "gpr3-5", "gpr3-6", "gpr3-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
 };
 
 &pinctrl_bus1 {
-       gpf0: gpf0 {
+       gpf0: gpf0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf1: gpf1 {
+       gpf1: gpf1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf2: gpf2 {
+       gpf2: gpf2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf3: gpf3 {
+       gpf3: gpf3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf4: gpf4 {
+       gpf4: gpf4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf5: gpf5 {
+       gpf5: gpf5-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpg1: gpg1 {
+       gpg1: gpg1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpg2: gpg2 {
+       gpg2: gpg2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gph1: gph1 {
+       gph1: gph1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpv6: gpv6 {
+       gpv6: gpv6-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       spi5_bus: spi5-bus {
+       spi5_bus: spi5-bus-pins {
                samsung,pins = "gpf2-0", "gpf2-1", "gpf2-2", "gpf2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
        };
 
-       ufs_refclk_out: ufs-refclk-out {
+       ufs_refclk_out: ufs-refclk-out-pins {
                samsung,pins = "gpg2-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV2>;
        };
 
-       ufs_rst_n: ufs-rst-n {
+       ufs_rst_n: ufs-rst-n-pins {
                samsung,pins = "gph1-5";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
index c3efbc8..e38bb02 100644 (file)
                                <0x11006000 0x2000>;
                };
 
-               pdma0: pdma@10e10000 {
+               pdma0: dma-controller@10e10000 {
                        compatible = "arm,pl330", "arm,primecell";
                        reg = <0x10E10000 0x1000>;
                        interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>;
                        #dma-requests = <32>;
                };
 
-               pdma1: pdma@10eb0000 {
+               pdma1: dma-controller@10eb0000 {
                        compatible = "arm,pl330", "arm,primecell";
                        reg = <0x10EB0000 0x1000>;
                        interrupts = <GIC_SPI 226 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&fin_pll>, <&clock_topc DOUT_SCLK_BUS0_PLL>,
                                 <&clock_topc DOUT_SCLK_BUS1_PLL>,
                                 <&clock_topc DOUT_SCLK_CC_PLL>,
-                                <&clock_topc DOUT_SCLK_MFC_PLL>;
+                                <&clock_topc DOUT_SCLK_MFC_PLL>,
+                                <&clock_topc DOUT_SCLK_AUD_PLL>;
                        clock-names = "fin_pll", "dout_sclk_bus0_pll",
                                      "dout_sclk_bus1_pll", "dout_sclk_cc_pll",
-                                     "dout_sclk_mfc_pll";
+                                     "dout_sclk_mfc_pll", "dout_sclk_aud_pll";
                };
 
                clock_top1: clock-controller@105e0000 {
                        compatible = "samsung,exynos7-clock-peric1";
                        reg = <0x14c80000 0xd00>;
                        #clock-cells = <1>;
-                       clocks = <&fin_pll>, <&clock_top0 DOUT_ACLK_PERIC1>,
+                       clocks = <&fin_pll>,
+                                <&clock_top0 DOUT_ACLK_PERIC1>,
                                 <&clock_top0 CLK_SCLK_UART1>,
                                 <&clock_top0 CLK_SCLK_UART2>,
-                                <&clock_top0 CLK_SCLK_UART3>;
-                       clock-names = "fin_pll", "dout_aclk_peric1_66",
-                                     "sclk_uart1", "sclk_uart2", "sclk_uart3";
+                                <&clock_top0 CLK_SCLK_UART3>,
+                                <&clock_top0 CLK_SCLK_SPI0>,
+                                <&clock_top0 CLK_SCLK_SPI1>,
+                                <&clock_top0 CLK_SCLK_SPI2>,
+                                <&clock_top0 CLK_SCLK_SPI3>,
+                                <&clock_top0 CLK_SCLK_SPI4>,
+                                <&clock_top0 CLK_SCLK_I2S1>,
+                                <&clock_top0 CLK_SCLK_PCM1>,
+                                <&clock_top0 CLK_SCLK_SPDIF>;
+                       clock-names = "fin_pll",
+                                     "dout_aclk_peric1_66",
+                                     "sclk_uart1",
+                                     "sclk_uart2",
+                                     "sclk_uart3",
+                                     "sclk_spi0",
+                                     "sclk_spi1",
+                                     "sclk_spi2",
+                                     "sclk_spi3",
+                                     "sclk_spi4",
+                                     "sclk_i2s1",
+                                     "sclk_pcm1",
+                                     "sclk_spdif";
                };
 
                clock_peris: clock-controller@10040000 {
                        reg = <0x15500000 0x100>;
                        clocks = <&clock_fsys0 ACLK_USBDRD300>,
                               <&clock_fsys0 OSCCLK_PHY_CLKOUT_USB30_PHY>,
-                              <&clock_fsys0 PHYCLK_USBDRD300_UDRD30_PIPE_PCLK_USER>,
                               <&clock_fsys0 PHYCLK_USBDRD300_UDRD30_PHYCLK_USER>,
+                              <&clock_fsys0 PHYCLK_USBDRD300_UDRD30_PIPE_PCLK_USER>,
                               <&clock_fsys0 SCLK_USBDRD300_REFCLK>;
-                       clock-names = "phy", "ref", "phy_pipe",
-                               "phy_utmi", "itp";
+                       clock-names = "phy", "ref", "phy_utmi", "phy_pipe", "itp";
                        samsung,pmu-syscon = <&pmu_system_controller>;
                        #phy-cells = <1>;
                };
 
-               usbdrd3 {
+               usbdrd: usb {
                        compatible = "samsung,exynos7-dwusb3";
                        clocks = <&clock_fsys0 ACLK_USBDRD300>,
                               <&clock_fsys0 SCLK_USBDRD300_SUSPENDCLK>,
diff --git a/arch/arm64/boot/dts/exynos/exynos7885-jackpotlte.dts b/arch/arm64/boot/dts/exynos/exynos7885-jackpotlte.dts
new file mode 100644 (file)
index 0000000..4cf9aa2
--- /dev/null
@@ -0,0 +1,92 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Samsung Galaxy A8 2018 (jackpotlte/SM-A530F) device tree source
+ *
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Dávid Virág
+ */
+
+/dts-v1/;
+#include "exynos7885.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+       model = "Samsung Galaxy A8 (2018)";
+       compatible = "samsung,jackpotlte", "samsung,exynos7885";
+       chassis-type = "handset";
+
+       aliases {
+               serial0 = &serial_0;
+               serial1 = &serial_1;
+               serial2 = &serial_2;
+       };
+
+       chosen {
+               stdout-path = &serial_2;
+       };
+
+       memory@80000000 {
+               device_type = "memory";
+               reg = <0x0 0x80000000 0x3da00000>,
+                     <0x0 0xc0000000 0x40000000>,
+                     <0x8 0x80000000 0x40000000>;
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               pinctrl-names = "default";
+               pinctrl-0 = <&key_volup &key_voldown &key_power>;
+
+               volup-key {
+                       label = "Volume Up";
+                       linux,code = <KEY_VOLUMEUP>;
+                       gpios = <&gpa1 5 GPIO_ACTIVE_LOW>;
+               };
+
+               voldown-key {
+                       label = "Volume Down";
+                       linux,code = <KEY_VOLUMEDOWN>;
+                       gpios = <&gpa1 6 GPIO_ACTIVE_LOW>;
+               };
+
+               power-key {
+                       label = "Power";
+                       linux,code = <KEY_POWER>;
+                       gpios = <&gpa1 7 GPIO_ACTIVE_LOW>;
+                       wakeup-source;
+               };
+       };
+};
+
+&oscclk {
+       clock-frequency = <26000000>;
+};
+
+&pinctrl_alive {
+       key_volup: key-volup-pins {
+               samsung,pins = "gpa1-5";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       key_voldown: key-voldown-pins {
+               samsung,pins = "gpa1-6";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       key_power: key-power-pins {
+               samsung,pins = "gpa1-7";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+};
+
+&serial_2 {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/exynos/exynos7885-pinctrl.dtsi b/arch/arm64/boot/dts/exynos/exynos7885-pinctrl.dtsi
new file mode 100644 (file)
index 0000000..a50c1db
--- /dev/null
@@ -0,0 +1,855 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Samsung Exynos7885 SoC pin-mux and pin-config device tree source
+ *
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Dávid Virág
+ *
+ * Samsung's Exynos7885 SoC pin-mux and pin-config options are listed as
+ * device tree nodes in this file.
+ */
+
+#include <dt-bindings/pinctrl/samsung.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+&pinctrl_alive {
+       etc0: etc0-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       etc1: etc1-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpa0: gpa0-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+               interrupt-parent = <&gic>;
+               interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
+       };
+
+       gpa1: gpa1-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+               interrupt-parent = <&gic>;
+               interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;
+       };
+
+       gpa2: gpa2-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpq0: gpq0-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       sim1_det_gpio: sim1-det-gpio-pins {
+               samsung,pins = "gpa2-5";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+       };
+
+       sim0_det_gpio: sim0-det-gpio-pins {
+               samsung,pins = "gpa2-6";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+       };
+
+       speedy_bus: speedy-bus-pins {
+               samsung,pins = "gpq0-2";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-con-pdn = <EXYNOS_PIN_PDN_PREV>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       /* UART_DEBUG */
+       uart2_bus: uart2-bus-pins {
+               samsung,pins = "gpq0-4", "gpq0-3";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+       };
+};
+
+&pinctrl_dispaud {
+       gpb0: gpb0-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpb1: gpb1-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpb2: gpb2-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       aud_codec_mclk: aud-codec-mclk-pins {
+               samsung,pins = "gpb0-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+       };
+
+       aud_codec_mclk_idle: aud-codec-mclk-idle-pins {
+               samsung,pins = "gpb0-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+       };
+
+       aud_codec_bus: aud-codec-bus-pins {
+               samsung,pins = "gpb0-1", "gpb0-2", "gpb0-3", "gpb0-4";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+       };
+
+       aud_codec_bus_idle: aud-codec-bus-idle-pins {
+               samsung,pins = "gpb0-1", "gpb0-2", "gpb0-3", "gpb0-4";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+       };
+
+       aud_loopback_bus: aud-loopback-bus-pins {
+               samsung,pins = "gpb1-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+       };
+
+       aud_loopback_bus_idle: aud-loopback-bus-idle-pins {
+               samsung,pins = "gpb1-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+       };
+
+       aud_fm_bus: aud-fm-bus-pins {
+               samsung,pins = "gpb1-1", "gpb1-2", "gpb1-3";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+       };
+
+       aud_fm_bus_idle: aud-fm-bus-idle-pins {
+               samsung,pins = "gpb1-1", "gpb1-2", "gpb1-3";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+       };
+
+       aud_spk_bus: aud-spk-bus-pins {
+               samsung,pins = "gpb2-0", "gpb2-1", "gpb2-2", "gpb2-3";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+       };
+
+       aud_spk_bus_idle: aud-spk-bus-idle-pins {
+               samsung,pins = "gpb2-0", "gpb2-1", "gpb2-2", "gpb2-3";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+       };
+};
+
+&pinctrl_fsys {
+       gpf0: gpf0-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpf2: gpf2-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpf3: gpf3-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpf4: gpf4-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       sd0_clk: sd0-clk-pins {
+               samsung,pins = "gpf0-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
+       };
+
+       sd0_clk_fast_slew_rate_1x: sd0-clk-fast-slew-rate-1x-pins {
+               samsung,pins = "gpf0-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       sd0_clk_fast_slew_rate_2x: sd0-clk-fast-slew-rate-2x-pins {
+               samsung,pins = "gpf0-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV2>;
+       };
+
+       sd0_clk_fast_slew_rate_3x: sd0-clk-fast-slew-rate-3x-pins {
+               samsung,pins = "gpf0-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+       };
+
+       sd0_clk_fast_slew_rate_4x: sd0-clk-fast-slew-rate-4x-pins {
+               samsung,pins = "gpf0-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
+       };
+
+       sd0_cmd: sd0-cmd-pins {
+               samsung,pins = "gpf0-1";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
+       };
+
+       sd0_rdqs: sd0-rdqs-pins {
+               samsung,pins = "gpf0-2";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
+       };
+
+       sd0_bus1: sd0-bus-width1-pins {
+               samsung,pins = "gpf2-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
+       };
+
+       sd0_bus4: sd0-bus-width4-pins {
+               samsung,pins = "gpf2-1", "gpf2-2", "gpf2-3";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
+       };
+
+       sd0_bus8: sd0-bus-width8-pins {
+               samsung,pins = "gpf2-4", "gpf2-5", "gpf2-6", "gpf2-7";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
+       };
+
+       sd1_clk: sd1-clk-pins {
+               samsung,pins = "gpf3-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+       };
+
+       sd1_clk_fast_slew_rate_1x: sd1-clk-fast-slew-rate-1x-pins {
+               samsung,pins = "gpf3-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       sd1_clk_fast_slew_rate_2x: sd1-clk-fast-slew-rate-2x-pins {
+               samsung,pins = "gpf3-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV2>;
+       };
+
+       sd1_clk_fast_slew_rate_3x: sd1-clk-fast-slew-rate-3x-pins {
+               samsung,pins = "gpf3-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+       };
+
+       sd1_clk_fast_slew_rate_4x: sd1-clk-fast-slew-rate-4x-pins {
+               samsung,pins = "gpf3-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
+       };
+
+       sd1_cmd: sd1-cmd-pins {
+               samsung,pins = "gpf3-1";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+       };
+
+       sd1_bus1: sd1-bus-width1-pins {
+               samsung,pins = "gpf3-2";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+       };
+
+       sd1_bus4: sd1-bus-width4-pins {
+               samsung,pins = "gpf3-3", "gpf3-5";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+       };
+
+       sd2_clk: sd2-clk-pins {
+               samsung,pins = "gpf4-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+       };
+
+       sd2_clk_fast_slew_rate_1x: sd2-clk-fast-slew-rate-1x-pins {
+               samsung,pins = "gpf4-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       sd2_clk_fast_slew_rate_2x: sd2-clk-fast-slew-rate-2x-pins {
+               samsung,pins = "gpf4-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV2>;
+       };
+
+       sd2_clk_fast_slew_rate_3x: sd2-clk-fast-slew-rate-3x-pins {
+               samsung,pins = "gpf4-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+       };
+
+       sd2_clk_fast_slew_rate_4x: sd2-clk-fast-slew-rate-4x-pins {
+               samsung,pins = "gpf4-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
+       };
+
+       sd2_cmd: sd2-cmd-pins {
+               samsung,pins = "gpf4-1";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+       };
+
+       sd2_bus1: sd2-bus-width1-pins {
+               samsung,pins = "gpf4-2";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+       };
+
+       sd2_bus4: sd2-bus-width4-pins {
+               samsung,pins = "gpf4-3", "gpf4-4", "gpf4-5";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+       };
+};
+
+&pinctrl_top {
+       gpc0: gpc0-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpc1: gpc1-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpc2: gpc2-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpg0: gpg0-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpg1: gpg1-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpg2: gpg2-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpg3: gpg3-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpg4: gpg4-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpp0: gpp0-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpp1: gpp1-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpp2: gpp2-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpp3: gpp3-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpp4: gpp4-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpp5: gpp5-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpp6: gpp6-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpp7: gpp7-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpp8: gpp8-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       hs_i2c0_bus: hs-i2c0-bus-pins {
+               samsung,pins = "gpc1-1", "gpc1-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-con-pdn = <EXYNOS_PIN_PDN_OUT1>;
+               samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       hs_i2c1_bus: hs-i2c1-bus-pins {
+               samsung,pins = "gpc1-3", "gpc1-2";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+               samsung,pin-con-pdn = <EXYNOS_PIN_PDN_OUT1>;
+               samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_UP>;
+       };
+
+       hs_i2c2_bus: hs-i2c2-bus-pins {
+               samsung,pins = "gpc1-5", "gpc1-4";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+               samsung,pin-con-pdn = <EXYNOS_PIN_PDN_OUT1>;
+               samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_UP>;
+       };
+
+       hs_i2c3_bus: hs-i2c3-bus-pins {
+               samsung,pins = "gpc1-7", "gpc1-6";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+               samsung,pin-con-pdn = <EXYNOS_PIN_PDN_OUT1>;
+               samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_UP>;
+       };
+
+       /* USI0 UART */
+       uart3_bus_single: uart3-bus-single-pins {
+               samsung,pins = "gpc2-3", "gpc2-2", "gpc2-1", "gpc2-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+       };
+
+       /* USI0 UART_HSI2C1 */
+       uart3_bus_dual: uart3-bus-dual-pins {
+               samsung,pins = "gpc2-1", "gpc2-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+       };
+
+       /* USI0 HSI2C0 */
+       hs_i2c4_bus: hs-i2c4-bus-pins {
+               samsung,pins = "gpc2-1", "gpc2-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+               samsung,pin-con-pdn = <EXYNOS_PIN_PDN_OUT1>;
+               samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_UP>;
+       };
+
+       /* USI0 HSI2C1 */
+       hs_i2c5_bus: hs-i2c5-bus-pins {
+               samsung,pins = "gpc2-3", "gpc2-2";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+               samsung,pin-con-pdn = <EXYNOS_PIN_PDN_OUT1>;
+               samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_UP>;
+       };
+
+       /* USI0 SPI */
+       spi2_bus: spi2-bus-pins {
+               samsung,pins = "gpc2-1", "gpc2-0", "gpc2-3";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       spi2_cs: spi2-cs-pins {
+               samsung,pins = "gpc2-2";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       /* USI1 UART */
+       uart4_bus_single: uart4-bus-single-pins {
+               samsung,pins = "gpc2-7", "gpc2-6", "gpc2-5", "gpc2-4";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+       };
+
+       /* USI1 UART_HSI2C1*/
+       uart4_bus_dual: uart4-bus-dual-pins {
+               samsung,pins = "gpc2-5", "gpc2-4";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+       };
+
+       /* USI1 HSI2C0 */
+       hs_i2c6_bus: hs-i2c6-bus-pins {
+               samsung,pins = "gpc2-5", "gpc2-4";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+               samsung,pin-con-pdn = <EXYNOS_PIN_PDN_OUT1>;
+               samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_UP>;
+       };
+
+       /* USI1 HSI2C1 */
+       hs_i2c7_bus: hs-i2c7-bus-pins {
+               samsung,pins = "gpc2-7", "gpc2-6";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+               samsung,pin-con-pdn = <EXYNOS_PIN_PDN_OUT1>;
+               samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_UP>;
+       };
+
+       /* USI1 SPI */
+       spi3_bus: spi3-bus-pins {
+               samsung,pins = "gpc2-5", "gpc2-4", "gpc2-7";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       spi3_cs: spi3-cs-pins {
+               samsung,pins = "gpc2-6";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       fm_lna_en: fm-lna-en-pins {
+               samsung,pins = "gpg0-2";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+               samsung,pin-con-pdn = <EXYNOS_PIN_PDN_PREV>;
+               samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-val = <1>;
+       };
+
+       uart1_bus: uart1-bus-pins {
+               samsung,pins = "gpg1-3", "gpg1-2", "gpg1-1", "gpg1-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+       };
+
+       i2c7_bus: i2c7-bus-pins {
+               samsung,pins = "gpg1-5", "gpg1-4";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       aud_dmic_on: aud-dmic-on-pins {
+               samsung,pins = "gpg2-1";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
+               samsung,pin-con-pdn = <EXYNOS_PIN_PDN_PREV>;
+               samsung,pin-val = <1>;
+       };
+
+       aud_dmic_off: aud-dmic-off-pins {
+               samsung,pins = "gpg2-1";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
+               samsung,pin-con-pdn = <EXYNOS_PIN_PDN_PREV>;
+               samsung,pin-val = <0>;
+       };
+
+       /* UART_HEALTH */
+       uart0_bus: uart0-bus-pins {
+               samsung,pins = "gpp0-3", "gpp0-2", "gpp0-1", "gpp0-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+       };
+
+       i2c0_bus: i2c0-bus-pins {
+               samsung,pins = "gpp1-1", "gpp1-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-con-pdn = <EXYNOS_PIN_PDN_PREV>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       i2c1_bus: i2c1-bus-pins {
+               samsung,pins = "gpp1-3", "gpp1-2";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-con-pdn = <EXYNOS_PIN_PDN_PREV>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       i2c2_bus: i2c2-bus-pins {
+               samsung,pins = "gpp2-1", "gpp2-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       i2c3_bus: i2c3-bus-pins {
+               samsung,pins = "gpp3-1", "gpp3-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       i2c4_bus: i2c4-bus-pins {
+               samsung,pins = "gpp4-1", "gpp4-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       i2c5_bus: i2c5-bus-pins {
+               samsung,pins = "gpp4-3", "gpp4-2";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       i2c6_bus: i2c6-bus-pins {
+               samsung,pins = "gpp4-5", "gpp4-4";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       /* SPI_ESE */
+       spi0_bus: spi0-bus-pins {
+               samsung,pins = "gpp5-3", "gpp5-2", "gpp5-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       spi0_cs: spi0-cs-pins {
+               samsung,pins = "gpp5-1";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       /* SPI_FP */
+       spi1_bus: spi1-bus-pins {
+               samsung,pins = "gpp6-3", "gpp6-2", "gpp6-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       spi1_cs: spi1-cs-pins {
+               samsung,pins = "gpp6-1";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       /* USI2 UART */
+       uart5_bus_single: uart5-bus-single-pins {
+               samsung,pins = "gpp8-1", "gpp8-0", "gpp7-1", "gpp7-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+         };
+
+       /* USI2 UART_HSI2C1 */
+       uart5_bus_dual: uart5-bus-dual-pins {
+               samsung,pins = "gpp7-1", "gpp7-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+       };
+
+       /* USI2 HSI2C0 */
+       hs_i2c8_bus: hs-i2c8-bus-pins {
+               samsung,pins = "gpp7-1", "gpp7-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+               samsung,pin-con-pdn = <EXYNOS_PIN_PDN_OUT1>;
+               samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_UP>;
+       };
+
+       /* USI2 HSI2C1 */
+       hs_i2c9_bus: hs-i2c9-bus-pins {
+               samsung,pins = "gpp8-1", "gpp8-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+               samsung,pin-con-pdn = <EXYNOS_PIN_PDN_OUT1>;
+               samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_UP>;
+       };
+
+       /* USI2 SPI */
+       spi4_bus: spi4-bus-pins {
+               samsung,pins = "gpp7-1", "gpp7-0", "gpp8-1";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       spi4_cs: spi4-cs-pins {
+               samsung,pins = "gpp8-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+};
diff --git a/arch/arm64/boot/dts/exynos/exynos7885.dtsi b/arch/arm64/boot/dts/exynos/exynos7885.dtsi
new file mode 100644 (file)
index 0000000..3170661
--- /dev/null
@@ -0,0 +1,423 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Samsung Exynos7885 SoC device tree source
+ *
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Dávid Virág
+ */
+
+#include <dt-bindings/clock/exynos7885.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+       compatible = "samsung,exynos7885";
+       #address-cells = <2>;
+       #size-cells = <1>;
+
+       interrupt-parent = <&gic>;
+
+       aliases {
+               pinctrl0 = &pinctrl_alive;
+               pinctrl1 = &pinctrl_dispaud;
+               pinctrl2 = &pinctrl_fsys;
+               pinctrl3 = &pinctrl_top;
+       };
+
+       arm-a53-pmu {
+               compatible = "arm,cortex-a53-pmu";
+               interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 218 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-affinity = <&cpu0>,
+                                    <&cpu1>,
+                                    <&cpu2>,
+                                    <&cpu3>,
+                                    <&cpu4>,
+                                    <&cpu5>;
+       };
+
+       arm-a73-pmu {
+               compatible = "arm,cortex-a73-pmu";
+               interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-affinity = <&cpu6>,
+                                    <&cpu7>;
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu-map {
+                       cluster0 {
+                               core0 {
+                                       cpu = <&cpu0>;
+                               };
+                               core1 {
+                                       cpu = <&cpu1>;
+                               };
+                               core2 {
+                                       cpu = <&cpu2>;
+                               };
+                               core3 {
+                                       cpu = <&cpu3>;
+                               };
+                               core4 {
+                                       cpu = <&cpu4>;
+                               };
+                               core5 {
+                                       cpu = <&cpu5>;
+                               };
+                       };
+
+                       cluster1 {
+                               core0 {
+                                       cpu = <&cpu6>;
+                               };
+                               core1 {
+                                       cpu = <&cpu7>;
+                               };
+                       };
+               };
+
+               cpu0: cpu@100 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       reg = <0x100>;
+                       enable-method = "psci";
+               };
+
+               cpu1: cpu@101 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       reg = <0x101>;
+                       enable-method = "psci";
+               };
+
+               cpu2: cpu@102 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       reg = <0x102>;
+                       enable-method = "psci";
+               };
+
+               cpu3: cpu@103 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       reg = <0x103>;
+                       enable-method = "psci";
+               };
+
+               cpu4: cpu@200 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       reg = <0x200>;
+                       enable-method = "psci";
+               };
+
+               cpu5: cpu@201 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       reg = <0x201>;
+                       enable-method = "psci";
+               };
+
+               cpu6: cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a73";
+                       reg = <0x0>;
+                       enable-method = "psci";
+               };
+
+               cpu7: cpu@1 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a73";
+                       reg = <0x1>;
+                       enable-method = "psci";
+               };
+       };
+
+       psci {
+               compatible = "arm,psci";
+               method = "smc";
+               cpu_suspend = <0xc4000001>;
+               cpu_off = <0x84000002>;
+               cpu_on = <0xc4000003>;
+       };
+
+       timer {
+               compatible = "arm,armv8-timer";
+               /* Hypervisor Virtual Timer interrupt is not wired to GIC */
+               interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>;
+       };
+
+       fixed-rate-clocks {
+               oscclk: osc-clock {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-output-names = "oscclk";
+               };
+       };
+
+       soc: soc@0 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0x0 0x0 0x0 0x20000000>;
+
+               chipid@10000000 {
+                       compatible = "samsung,exynos850-chipid";
+                       reg = <0x10000000 0x24>;
+               };
+
+               gic: interrupt-controller@12301000 {
+                       compatible = "arm,gic-400";
+                       #interrupt-cells = <3>;
+                       #address-cells = <0>;
+                       interrupt-controller;
+                       reg = <0x12301000 0x1000>,
+                             <0x12302000 0x2000>,
+                             <0x12304000 0x2000>,
+                             <0x12306000 0x2000>;
+                       interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(8) |
+                                                IRQ_TYPE_LEVEL_HIGH)>;
+               };
+
+               cmu_peri: clock-controller@10010000 {
+                       compatible = "samsung,exynos7885-cmu-peri";
+                       reg = <0x10010000 0x8000>;
+                       #clock-cells = <1>;
+
+                       clocks = <&oscclk>,
+                                <&cmu_top CLK_DOUT_PERI_BUS>,
+                                <&cmu_top CLK_DOUT_PERI_SPI0>,
+                                <&cmu_top CLK_DOUT_PERI_SPI1>,
+                                <&cmu_top CLK_DOUT_PERI_UART0>,
+                                <&cmu_top CLK_DOUT_PERI_UART1>,
+                                <&cmu_top CLK_DOUT_PERI_UART2>,
+                                <&cmu_top CLK_DOUT_PERI_USI0>,
+                                <&cmu_top CLK_DOUT_PERI_USI1>,
+                                <&cmu_top CLK_DOUT_PERI_USI2>;
+                       clock-names = "oscclk",
+                                     "dout_peri_bus",
+                                     "dout_peri_spi0",
+                                     "dout_peri_spi1",
+                                     "dout_peri_uart0",
+                                     "dout_peri_uart1",
+                                     "dout_peri_uart2",
+                                     "dout_peri_usi0",
+                                     "dout_peri_usi1",
+                                     "dout_peri_usi2";
+               };
+
+               cmu_core: clock-controller@12000000 {
+                       compatible = "samsung,exynos7885-cmu-core";
+                       reg = <0x12000000 0x8000>;
+                       #clock-cells = <1>;
+
+                       clocks = <&oscclk>,
+                                <&cmu_top CLK_DOUT_CORE_BUS>,
+                                <&cmu_top CLK_DOUT_CORE_CCI>,
+                                <&cmu_top CLK_DOUT_CORE_G3D>;
+                       clock-names = "oscclk",
+                                     "dout_core_bus",
+                                     "dout_core_cci",
+                                     "dout_core_g3d";
+               };
+
+               cmu_top: clock-controller@12060000 {
+                       compatible = "samsung,exynos7885-cmu-top";
+                       reg = <0x12060000 0x8000>;
+                       #clock-cells = <1>;
+
+                       clocks = <&oscclk>;
+                       clock-names = "oscclk";
+               };
+
+               pinctrl_alive: pinctrl@11cb0000 {
+                       compatible = "samsung,exynos7885-pinctrl";
+                       reg = <0x11cb0000 0x1000>;
+
+                       wakeup-interrupt-controller {
+                               compatible = "samsung,exynos7-wakeup-eint";
+                               interrupt-parent = <&gic>;
+                               interrupts = <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>;
+                       };
+               };
+
+               pinctrl_fsys: pinctrl@13430000 {
+                       compatible = "samsung,exynos7885-pinctrl";
+                       reg = <0x13430000 0x1000>;
+                       interrupts = <GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>;
+               };
+
+               pinctrl_top: pinctrl@139b0000 {
+                       compatible = "samsung,exynos7885-pinctrl";
+                       reg = <0x139b0000 0x1000>;
+                       interrupts = <GIC_SPI 266 IRQ_TYPE_LEVEL_HIGH>;
+               };
+
+               pinctrl_dispaud: pinctrl@148f0000 {
+                       compatible = "samsung,exynos7885-pinctrl";
+                       reg = <0x148f0000 0x1000>;
+                       interrupts = <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>;
+               };
+
+               pmu_system_controller: system-controller@11c80000 {
+                       compatible = "samsung,exynos7-pmu", "syscon";
+                       reg = <0x11c80000 0x10000>;
+               };
+
+               serial_0: serial@13800000 {
+                       compatible = "samsung,exynos5433-uart";
+                       reg = <0x13800000 0x100>;
+                       interrupts = <GIC_SPI 246 IRQ_TYPE_LEVEL_HIGH>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&uart0_bus>;
+                       clocks = <&cmu_peri CLK_GOUT_UART0_EXT_UCLK>,
+                                <&cmu_peri CLK_GOUT_UART0_PCLK>;
+                       clock-names = "uart", "clk_uart_baud0";
+                       samsung,uart-fifosize = <64>;
+                       status = "disabled";
+               };
+
+               serial_1: serial@13810000 {
+                       compatible = "samsung,exynos5433-uart";
+                       reg = <0x13810000 0x100>;
+                       interrupts = <GIC_SPI 247 IRQ_TYPE_LEVEL_HIGH>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&uart1_bus>;
+                       clocks = <&cmu_peri CLK_GOUT_UART1_EXT_UCLK>,
+                                <&cmu_peri CLK_GOUT_UART1_PCLK>;
+                       clock-names = "uart", "clk_uart_baud0";
+                       samsung,uart-fifosize = <256>;
+                       status = "disabled";
+               };
+
+               serial_2: serial@13820000 {
+                       compatible = "samsung,exynos5433-uart";
+                       reg = <0x13820000 0x100>;
+                       interrupts = <GIC_SPI 279 IRQ_TYPE_LEVEL_HIGH>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&uart2_bus>;
+                       clocks = <&cmu_peri CLK_GOUT_UART2_EXT_UCLK>,
+                                <&cmu_peri CLK_GOUT_UART2_PCLK>;
+                       clock-names = "uart", "clk_uart_baud0";
+                       samsung,uart-fifosize = <256>;
+                       status = "disabled";
+               };
+
+               i2c_0: i2c@13830000 {
+                       compatible = "samsung,s3c2440-i2c";
+                       reg = <0x13830000 0x100>;
+                       interrupts = <GIC_SPI 248 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&i2c0_bus>;
+                       clocks = <&cmu_peri CLK_GOUT_I2C0_PCLK>;
+                       clock-names = "i2c";
+                       status = "disabled";
+               };
+
+               i2c_1: i2c@13840000 {
+                       compatible = "samsung,s3c2440-i2c";
+                       reg = <0x13840000 0x100>;
+                       interrupts = <GIC_SPI 249 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&i2c1_bus>;
+                       clocks = <&cmu_peri CLK_GOUT_I2C1_PCLK>;
+                       clock-names = "i2c";
+                       status = "disabled";
+               };
+
+               i2c_2: i2c@13850000 {
+                       compatible = "samsung,s3c2440-i2c";
+                       reg = <0x13850000 0x100>;
+                       interrupts = <GIC_SPI 250 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&i2c2_bus>;
+                       clocks = <&cmu_peri CLK_GOUT_I2C2_PCLK>;
+                       clock-names = "i2c";
+                       status = "disabled";
+               };
+
+               i2c_3: i2c@13860000 {
+                       compatible = "samsung,s3c2440-i2c";
+                       reg = <0x13860000 0x100>;
+                       interrupts = <GIC_SPI 251 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&i2c3_bus>;
+                       clocks = <&cmu_peri CLK_GOUT_I2C3_PCLK>;
+                       clock-names = "i2c";
+                       status = "disabled";
+               };
+
+               i2c_4: i2c@13870000 {
+                       compatible = "samsung,s3c2440-i2c";
+                       reg = <0x13870000 0x100>;
+                       interrupts = <GIC_SPI 252 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&i2c4_bus>;
+                       clocks = <&cmu_peri CLK_GOUT_I2C4_PCLK>;
+                       clock-names = "i2c";
+                       status = "disabled";
+               };
+
+               i2c_5: i2c@13880000 {
+                       compatible = "samsung,s3c2440-i2c";
+                       reg = <0x13880000 0x100>;
+                       interrupts = <GIC_SPI 253 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&i2c5_bus>;
+                       clocks = <&cmu_peri CLK_GOUT_I2C5_PCLK>;
+                       clock-names = "i2c";
+                       status = "disabled";
+               };
+
+               i2c_6: i2c@13890000 {
+                       compatible = "samsung,s3c2440-i2c";
+                       reg = <0x13890000 0x100>;
+                       interrupts = <GIC_SPI 254 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&i2c6_bus>;
+                       clocks = <&cmu_peri CLK_GOUT_I2C6_PCLK>;
+                       clock-names = "i2c";
+                       status = "disabled";
+               };
+
+               i2c_7: i2c@11cd0000 {
+                       compatible = "samsung,s3c2440-i2c";
+                       reg = <0x11cd0000 0x100>;
+                       interrupts = <GIC_SPI 255 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&i2c7_bus>;
+                       clocks = <&cmu_peri CLK_GOUT_I2C7_PCLK>;
+                       clock-names = "i2c";
+                       status = "disabled";
+               };
+       };
+};
+
+#include "exynos7885-pinctrl.dtsi"
+#include "arm/exynos-syscon-restart.dtsi"
diff --git a/arch/arm64/boot/dts/exynos/exynos850-e850-96.dts b/arch/arm64/boot/dts/exynos/exynos850-e850-96.dts
new file mode 100644 (file)
index 0000000..7b5a61d
--- /dev/null
@@ -0,0 +1,195 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * WinLink E850-96 board device tree source
+ *
+ * Copyright (C) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (C) 2021 Linaro Ltd.
+ *
+ * Device tree source file for WinLink's E850-96 board which is based on
+ * Samsung Exynos850 SoC.
+ */
+
+/dts-v1/;
+
+#include "exynos850.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+       model = "WinLink E850-96 board";
+       compatible = "winlink,e850-96", "samsung,exynos850";
+
+       chosen {
+               stdout-path = &serial_0;
+       };
+
+       /*
+        * RAM: 4 GiB (eMCP):
+        *   - 2 GiB at 0x80000000
+        *   - 2 GiB at 0x880000000
+        *
+        * 0xbab00000..0xbfffffff: secure memory (85 MiB).
+        */
+       memory@80000000 {
+               device_type = "memory";
+               reg = <0x0 0x80000000 0x3ab00000>,
+                     <0x0 0xc0000000 0x40000000>,
+                     <0x8 0x80000000 0x80000000>;
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               pinctrl-names = "default";
+               pinctrl-0 = <&key_voldown_pins &key_volup_pins>;
+
+               volume-down-key {
+                       label = "Volume Down";
+                       linux,code = <KEY_VOLUMEDOWN>;
+                       gpios = <&gpa1 0 GPIO_ACTIVE_LOW>;
+               };
+
+               volume-up-key {
+                       label = "Volume Up";
+                       linux,code = <KEY_VOLUMEUP>;
+                       gpios = <&gpa0 7 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               /* HEART_BEAT_LED */
+               user_led1: led-1 {
+                       label = "yellow:user1";
+                       gpios = <&gpg2 2 GPIO_ACTIVE_HIGH>;
+                       color = <LED_COLOR_ID_YELLOW>;
+                       function = LED_FUNCTION_HEARTBEAT;
+                       linux,default-trigger = "heartbeat";
+               };
+
+               /* eMMC_LED */
+               user_led2: led-2 {
+                       label = "yellow:user2";
+                       gpios = <&gpg2 3 GPIO_ACTIVE_HIGH>;
+                       color = <LED_COLOR_ID_YELLOW>;
+                       linux,default-trigger = "mmc0";
+               };
+
+               /* SD_LED */
+               user_led3: led-3 {
+                       label = "white:user3";
+                       gpios = <&gpg2 4 GPIO_ACTIVE_HIGH>;
+                       color = <LED_COLOR_ID_WHITE>;
+                       function = LED_FUNCTION_SD;
+                       linux,default-trigger = "mmc2";
+               };
+
+               /* WIFI_LED */
+               wlan_active_led: led-4 {
+                       label = "yellow:wlan";
+                       gpios = <&gpg2 6 GPIO_ACTIVE_HIGH>;
+                       color = <LED_COLOR_ID_YELLOW>;
+                       function = LED_FUNCTION_WLAN;
+                       linux,default-trigger = "phy0tx";
+                       default-state = "off";
+               };
+
+               /* BLUETOOTH_LED */
+               bt_active_led: led-5 {
+                       label = "blue:bt";
+                       gpios = <&gpg2 7 GPIO_ACTIVE_HIGH>;
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_BLUETOOTH;
+                       linux,default-trigger = "hci0rx";
+                       default-state = "off";
+               };
+       };
+
+       /*
+        * RTC clock (XrtcXTI); external, must be 32.768 kHz.
+        *
+        * TODO: Remove this once RTC clock is implemented properly as part of
+        *       PMIC driver.
+        */
+       rtcclk: clock-rtcclk {
+               compatible = "fixed-clock";
+               clock-output-names = "rtcclk";
+               #clock-cells = <0>;
+               clock-frequency = <32768>;
+       };
+};
+
+&cmu_hsi {
+       clocks = <&oscclk>, <&rtcclk>,
+                <&cmu_top CLK_DOUT_HSI_BUS>,
+                <&cmu_top CLK_DOUT_HSI_MMC_CARD>,
+                <&cmu_top CLK_DOUT_HSI_USB20DRD>;
+       clock-names = "oscclk", "rtcclk", "dout_hsi_bus",
+                     "dout_hsi_mmc_card", "dout_hsi_usb20drd";
+};
+
+&mmc_0 {
+       status = "okay";
+       mmc-hs200-1_8v;
+       mmc-hs400-1_8v;
+       cap-mmc-highspeed;
+       non-removable;
+       mmc-hs400-enhanced-strobe;
+       card-detect-delay = <200>;
+       clock-frequency = <800000000>;
+       bus-width = <8>;
+       samsung,dw-mshc-ciu-div = <3>;
+       samsung,dw-mshc-sdr-timing = <0 4>;
+       samsung,dw-mshc-ddr-timing = <2 4>;
+       samsung,dw-mshc-hs400-timing = <0 2>;
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&sd0_clk_pins &sd0_cmd_pins &sd0_rdqs_pins &sd0_nreset_pins
+                    &sd0_bus1_pins &sd0_bus4_pins &sd0_bus8_pins>;
+};
+
+&oscclk {
+       clock-frequency = <26000000>;
+};
+
+&pinctrl_alive {
+       key_voldown_pins: key-voldown-pins {
+               samsung,pins = "gpa1-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_EINT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       key_volup_pins: key-volup-pins {
+               samsung,pins = "gpa0-7";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_EINT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+};
+
+&rtc {
+       status = "okay";
+       clocks = <&cmu_apm CLK_GOUT_RTC_PCLK>, <&rtcclk>;
+       clock-names = "rtc", "rtc_src";
+};
+
+&serial_0 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart1_pins>;
+};
+
+&usi_uart {
+       samsung,clkreq-on; /* needed for UART mode */
+       status = "okay";
+};
+
+&watchdog_cl0 {
+       status = "okay";
+};
+
+&watchdog_cl1 {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/exynos/exynos850-pinctrl.dtsi b/arch/arm64/boot/dts/exynos/exynos850-pinctrl.dtsi
new file mode 100644 (file)
index 0000000..f43e4a2
--- /dev/null
@@ -0,0 +1,663 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Samsung's Exynos850 SoC pin-mux and pin-config device tree source
+ *
+ * Copyright (C) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (C) 2021 Linaro Ltd.
+ *
+ * Samsung's Exynos850 SoC pin-mux and pin-config options are listed as device
+ * tree nodes in this file.
+ */
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/pinctrl/samsung.h>
+
+&pinctrl_alive {
+       gpa0: gpa0-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+               interrupt-parent = <&gic>;
+               interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
+       };
+
+       gpa1: gpa1-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+               interrupt-parent = <&gic>;
+               interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
+       };
+
+       gpa2: gpa2-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+               interrupt-parent = <&gic>;
+               interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>;
+       };
+
+       gpa3: gpa3-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+               interrupt-parent = <&gic>;
+               interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+       };
+
+       gpa4: gpa4-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+               interrupt-parent = <&gic>;
+               interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
+       };
+
+       gpq0: gpq0-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       /* I2C5 (also called CAM_PMIC_I2C in TRM) */
+       i2c5_pins: i2c5-pins {
+               samsung,pins = "gpa3-5", "gpa3-6";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       /* I2C6 (also called MOTOR_I2C in TRM) */
+       i2c6_pins: i2c6-pins {
+               samsung,pins = "gpa3-7", "gpa4-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       /* USI: UART_DEBUG_0 pins */
+       uart0_pins: uart0-pins {
+               samsung,pins = "gpq0-0", "gpq0-1";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+       };
+
+       /* USI: UART_DEBUG_1 pins */
+       uart1_pins: uart1-pins {
+               samsung,pins = "gpa3-7", "gpa4-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+       };
+};
+
+&pinctrl_cmgp {
+       gpm0: gpm0-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+               interrupt-parent = <&gic>;
+               interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
+       };
+
+       gpm1: gpm1-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+               interrupt-parent = <&gic>;
+               interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
+       };
+
+       gpm2: gpm2-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+               interrupt-parent = <&gic>;
+               interrupts = <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
+       };
+
+       gpm3: gpm3-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+               interrupt-parent = <&gic>;
+               interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
+       };
+
+       gpm4: gpm4-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+               interrupt-parent = <&gic>;
+               interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>;
+       };
+
+       gpm5: gpm5-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+               interrupt-parent = <&gic>;
+               interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
+       };
+
+       gpm6: gpm6-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+               interrupt-parent = <&gic>;
+               interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
+       };
+
+       gpm7: gpm7-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+               interrupt-parent = <&gic>;
+               interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
+       };
+
+       /* USI_CMGP0: HSI2C function */
+       hsi2c3_pins: hsi2c3-pins {
+               samsung,pins = "gpm0-0", "gpm1-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       /* USI_CMGP0: UART function (4 pins, Auto Flow Control) */
+       uart1_single_pins: uart1-single-pins {
+               samsung,pins = "gpm0-0", "gpm1-0", "gpm2-0", "gpm3-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+       };
+
+       /* USI_CMGP0: UART function (2 pins, Non-Auto Flow Control) */
+       uart1_dual_pins: uart1-dual-pins {
+               samsung,pins = "gpm0-0", "gpm1-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+       };
+
+       /* USI_CMGP0: SPI function */
+       spi1_pins: spi1-pins {
+               samsung,pins = "gpm0-0", "gpm1-0", "gpm2-0", "gpm3-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       /* USI_CMGP1: HSI2C function */
+       hsi2c4_pins: hsi2c4-pins {
+               samsung,pins = "gpm4-0", "gpm5-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       /* USI_CMGP1: UART function (4 pins, Auto Flow Control) */
+       uart2_single_pins: uart2-single-pins {
+               samsung,pins = "gpm4-0", "gpm5-0", "gpm6-0", "gpm7-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+       };
+
+       /* USI_CMGP1: UART function (2 pins, Non-Auto Flow Control) */
+       uart2_dual_pins: uart2-dual-pins {
+               samsung,pins = "gpm4-0", "gpm5-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+       };
+
+       /* USI_CMGP1: SPI function */
+       spi2_pins: spi2-pins {
+               samsung,pins = "gpm4-0", "gpm5-0", "gpm6-0", "gpm7-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+};
+
+&pinctrl_aud {
+       gpb0: gpb0-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpb1: gpb1-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       aud_codec_mclk_pins: aud-codec-mclk-pins {
+               samsung,pins = "gpb0-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+       };
+
+       aud_codec_mclk_idle_pins: aud-codec-mclk-idle-pins {
+               samsung,pins = "gpb0-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+       };
+
+       aud_i2s0_pins: aud-i2s0-pins {
+               samsung,pins = "gpb0-1", "gpb0-2", "gpb0-3", "gpb0-4";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+       };
+
+       aud_i2s0_idle_pins: aud-i2s0-idle-pins {
+               samsung,pins = "gpb0-1", "gpb0-2", "gpb0-3", "gpb0-4";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+       };
+
+       aud_i2s1_pins: aud-i2s1-pins {
+               samsung,pins = "gpb1-0", "gpb1-1", "gpb1-2", "gpb1-3";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+       };
+
+       aud_i2s1_idle_pins: aud-i2s1-idle-pins {
+               samsung,pins = "gpb1-0", "gpb1-1", "gpb1-2", "gpb1-3";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+       };
+
+       aud_fm_pins: aud-fm-pins {
+               samsung,pins = "gpb1-4";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+       };
+
+       aud_fm_idle_pins: aud-fm-idle-pins {
+               samsung,pins = "gpb1-4";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+       };
+};
+
+&pinctrl_hsi {
+       gpf2: gpf2-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       sd2_clk_pins: sd2-clk-pins {
+               samsung,pins = "gpf2-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS850_HSI_PIN_DRV_LV2>;
+       };
+
+       sd2_cmd_pins: sd2-cmd-pins {
+               samsung,pins = "gpf2-1";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS850_HSI_PIN_DRV_LV2>;
+        };
+
+       sd2_bus1_pins: sd2-bus1-pins {
+               samsung,pins = "gpf2-2";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS850_HSI_PIN_DRV_LV2>;
+       };
+
+       sd2_bus4_pins: sd2-bus4-pins {
+               samsung,pins = "gpf2-3", "gpf2-4", "gpf2-5";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS850_HSI_PIN_DRV_LV2>;
+       };
+
+       sd2_pdn_pins: sd2-pdn-pins {
+               samsung,pins = "gpf2-0", "gpf2-1", "gpf2-2", "gpf2-3",
+                              "gpf2-4", "gpf2-5";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+       };
+};
+
+&pinctrl_core {
+       gpf0: gpf0-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpf1: gpf1-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       sd0_clk_pins: sd0-clk-pins {
+               samsung,pins = "gpf0-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
+       };
+
+       sd0_cmd_pins: sd0-cmd-pins {
+               samsung,pins = "gpf0-1";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
+       };
+
+       sd0_rdqs_pins: sd0-rdqs-pins {
+               samsung,pins = "gpf0-2";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
+       };
+
+       sd0_nreset_pins: sd0-nreset-pins {
+               samsung,pins = "gpf0-3";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
+       };
+
+       sd0_bus1_pins: sd0-bus1-pins {
+               samsung,pins = "gpf1-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
+       };
+
+       sd0_bus4_pins: sd0-bus4-pins {
+               samsung,pins = "gpf1-1", "gpf1-2", "gpf1-3";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
+       };
+
+       sd0_bus8_pins: sd0-bus8-pins {
+               samsung,pins = "gpf1-4", "gpf1-5", "gpf1-6", "gpf1-7";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV4>;
+       };
+};
+
+&pinctrl_peri {
+       gpc0: gpc0-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpc1: gpc1-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpg0: gpg0-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpg1: gpg1-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpg2: gpg2-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpg3: gpg3-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpp0: gpp0-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+       gpp1: gpp1-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpp2: gpp2-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       sensor_mclk0_in_pins: sensor-mclk0-in-pins {
+               samsung,pins = "gpc0-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+       };
+
+       sensor_mclk0_out_pins: sensor-mclk0-out-pins {
+               samsung,pins = "gpc0-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+       };
+
+       sensor_mclk0_fn_pins: sensor-mclk0-fn-pins {
+               samsung,pins = "gpc0-0";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+       };
+
+       sensor_mclk1_in_pins: sensor-mclk1-in-pins {
+               samsung,pins = "gpc0-1";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+       };
+
+       sensor_mclk1_out_pins: sensor-mclk1-out-pins {
+               samsung,pins = "gpc0-1";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+       };
+
+       sensor_mclk1_fn_pins: sensor-mclk1-fn-pins {
+               samsung,pins = "gpc0-1";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+       };
+
+       sensor_mclk2_in_pins: sensor-mclk2-in-pins {
+               samsung,pins = "gpc0-2";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+       };
+
+       sensor_mclk2_out_pins: sensor-mclk2-out-pins {
+               samsung,pins = "gpc0-2";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+       };
+
+       sensor_mclk2_fn_pins: sensor-mclk2-fn-pins {
+               samsung,pins = "gpc0-2";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV3>;
+       };
+
+       /* USI: HSI2C0 */
+       hsi2c0_pins: hsi2c0-pins {
+               samsung,pins = "gpc1-0", "gpc1-1";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       /* USI: HSI2C1 */
+       hsi2c1_pins: hsi2c1-pins {
+               samsung,pins = "gpc1-2", "gpc1-3";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       /* USI: HSI2C2 */
+       hsi2c2_pins: hsi2c2-pins {
+               samsung,pins = "gpc1-4", "gpc1-5";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       /* USI: SPI */
+       spi0_pins: spi0-pins {
+               samsung,pins = "gpp2-0", "gpp2-1", "gpp2-2", "gpp2-3";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       i2c0_pins: i2c0-pins {
+               samsung,pins = "gpp0-0", "gpp0-1";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       i2c1_pins: i2c1-pins {
+               samsung,pins = "gpp0-2", "gpp0-3";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       i2c2_pins: i2c2-pins {
+               samsung,pins = "gpp0-4", "gpp0-5";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       i2c3_pins: i2c3-pins {
+               samsung,pins = "gpp1-0", "gpp1-1";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       i2c4_pins: i2c4-pins {
+               samsung,pins = "gpp1-2", "gpp1-3";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
+       };
+
+       xclkout_pins: xclkout-pins {
+               samsung,pins = "gpq0-2";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+       };
+};
diff --git a/arch/arm64/boot/dts/exynos/exynos850.dtsi b/arch/arm64/boot/dts/exynos/exynos850.dtsi
new file mode 100644 (file)
index 0000000..d1700e9
--- /dev/null
@@ -0,0 +1,701 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Samsung Exynos850 SoC device tree source
+ *
+ * Copyright (C) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (C) 2021 Linaro Ltd.
+ *
+ * Samsung Exynos850 SoC device nodes are listed in this file.
+ * Exynos850 based board files can include this file and provide
+ * values for board specific bindings.
+ */
+
+#include <dt-bindings/clock/exynos850.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/soc/samsung,exynos-usi.h>
+
+/ {
+       /* Also known under engineering name Exynos3830 */
+       compatible = "samsung,exynos850";
+       #address-cells = <2>;
+       #size-cells = <1>;
+
+       interrupt-parent = <&gic>;
+
+       aliases {
+               pinctrl0 = &pinctrl_alive;
+               pinctrl1 = &pinctrl_cmgp;
+               pinctrl2 = &pinctrl_aud;
+               pinctrl3 = &pinctrl_hsi;
+               pinctrl4 = &pinctrl_core;
+               pinctrl5 = &pinctrl_peri;
+               mmc0 = &mmc_0;
+               serial0 = &serial_0;
+               serial1 = &serial_1;
+               serial2 = &serial_2;
+               i2c0 = &i2c_0;
+               i2c1 = &i2c_1;
+               i2c2 = &i2c_2;
+               i2c3 = &i2c_3;
+               i2c4 = &i2c_4;
+               i2c5 = &i2c_5;
+               i2c6 = &i2c_6;
+               i2c7 = &hsi2c_0;
+               i2c8 = &hsi2c_1;
+               i2c9 = &hsi2c_2;
+               i2c10 = &hsi2c_3;
+               i2c11 = &hsi2c_4;
+       };
+
+       arm-pmu {
+               compatible = "arm,cortex-a55-pmu";
+               interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 111 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-affinity = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>,
+                                    <&cpu4>, <&cpu5>, <&cpu6>, <&cpu7>;
+       };
+
+       /* Main system clock (XTCXO); external, must be 26 MHz */
+       oscclk: clock-oscclk {
+               compatible = "fixed-clock";
+               clock-output-names = "oscclk";
+               #clock-cells = <0>;
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu-map {
+                       cluster0 {
+                               core0 {
+                                       cpu = <&cpu0>;
+                               };
+                               core1 {
+                                       cpu = <&cpu1>;
+                               };
+                               core2 {
+                                       cpu = <&cpu2>;
+                               };
+                               core3 {
+                                       cpu = <&cpu3>;
+                               };
+                       };
+
+                       cluster1 {
+                               core0 {
+                                       cpu = <&cpu4>;
+                               };
+                               core1 {
+                                       cpu = <&cpu5>;
+                               };
+                               core2 {
+                                       cpu = <&cpu6>;
+                               };
+                               core3 {
+                                       cpu = <&cpu7>;
+                               };
+                       };
+               };
+
+               cpu0: cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a55";
+                       reg = <0x0>;
+                       enable-method = "psci";
+               };
+               cpu1: cpu@1 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a55";
+                       reg = <0x1>;
+                       enable-method = "psci";
+               };
+               cpu2: cpu@2 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a55";
+                       reg = <0x2>;
+                       enable-method = "psci";
+               };
+               cpu3: cpu@3 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a55";
+                       reg = <0x3>;
+                       enable-method = "psci";
+               };
+               cpu4: cpu@100 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a55";
+                       reg = <0x100>;
+                       enable-method = "psci";
+               };
+               cpu5: cpu@101 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a55";
+                       reg = <0x101>;
+                       enable-method = "psci";
+               };
+               cpu6: cpu@102 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a55";
+                       reg = <0x102>;
+                       enable-method = "psci";
+               };
+               cpu7: cpu@103 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a55";
+                       reg = <0x103>;
+                       enable-method = "psci";
+               };
+       };
+
+       psci {
+               compatible = "arm,psci-1.0";
+               method = "smc";
+       };
+
+       timer {
+               compatible = "arm,armv8-timer";
+               /* Hypervisor Virtual Timer interrupt is not wired to GIC */
+               interrupts =
+                    <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
+                    <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
+                    <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
+                    <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>;
+       };
+
+       soc: soc@0 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0x0 0x0 0x0 0x20000000>;
+
+               chipid@10000000 {
+                       compatible = "samsung,exynos850-chipid";
+                       reg = <0x10000000 0x100>;
+               };
+
+               timer@10040000 {
+                       compatible = "samsung,exynos4210-mct";
+                       reg = <0x10040000 0x800>;
+                       interrupts = <GIC_SPI 203 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 204 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 207 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 210 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 211 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 212 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 213 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 214 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&oscclk>, <&cmu_peri CLK_GOUT_MCT_PCLK>;
+                       clock-names = "fin_pll", "mct";
+               };
+
+               gic: interrupt-controller@12a01000 {
+                       compatible = "arm,gic-400";
+                       #interrupt-cells = <3>;
+                       #address-cells = <0>;
+                       reg = <0x12a01000 0x1000>,
+                             <0x12a02000 0x2000>,
+                             <0x12a04000 0x2000>,
+                             <0x12a06000 0x2000>;
+                       interrupt-controller;
+                       interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(8) |
+                                                IRQ_TYPE_LEVEL_HIGH)>;
+               };
+
+               pmu_system_controller: system-controller@11860000 {
+                       compatible = "samsung,exynos850-pmu", "syscon";
+                       reg = <0x11860000 0x10000>;
+                       clocks = <&cmu_apm CLK_GOUT_PMU_ALIVE_PCLK>;
+
+                       reboot: syscon-reboot {
+                               compatible = "syscon-reboot";
+                               regmap = <&pmu_system_controller>;
+                               offset = <0x3a00>; /* SYSTEM_CONFIGURATION */
+                               mask = <0x2>; /* SWRESET_SYSTEM */
+                               value = <0x2>; /* reset value */
+                       };
+               };
+
+               watchdog_cl0: watchdog@10050000 {
+                       compatible = "samsung,exynos850-wdt";
+                       reg = <0x10050000 0x100>;
+                       interrupts = <GIC_SPI 228 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cmu_peri CLK_GOUT_WDT0_PCLK>, <&oscclk>;
+                       clock-names = "watchdog", "watchdog_src";
+                       samsung,syscon-phandle = <&pmu_system_controller>;
+                       samsung,cluster-index = <0>;
+                       status = "disabled";
+               };
+
+               watchdog_cl1: watchdog@10060000 {
+                       compatible = "samsung,exynos850-wdt";
+                       reg = <0x10060000 0x100>;
+                       interrupts = <GIC_SPI 229 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cmu_peri CLK_GOUT_WDT1_PCLK>, <&oscclk>;
+                       clock-names = "watchdog", "watchdog_src";
+                       samsung,syscon-phandle = <&pmu_system_controller>;
+                       samsung,cluster-index = <1>;
+                       status = "disabled";
+               };
+
+               cmu_peri: clock-controller@10030000 {
+                       compatible = "samsung,exynos850-cmu-peri";
+                       reg = <0x10030000 0x8000>;
+                       #clock-cells = <1>;
+
+                       clocks = <&oscclk>, <&cmu_top CLK_DOUT_PERI_BUS>,
+                                <&cmu_top CLK_DOUT_PERI_UART>,
+                                <&cmu_top CLK_DOUT_PERI_IP>;
+                       clock-names = "oscclk", "dout_peri_bus",
+                                     "dout_peri_uart", "dout_peri_ip";
+               };
+
+               cmu_apm: clock-controller@11800000 {
+                       compatible = "samsung,exynos850-cmu-apm";
+                       reg = <0x11800000 0x8000>;
+                       #clock-cells = <1>;
+
+                       clocks = <&oscclk>, <&cmu_top CLK_DOUT_CLKCMU_APM_BUS>;
+                       clock-names = "oscclk", "dout_clkcmu_apm_bus";
+               };
+
+               cmu_cmgp: clock-controller@11c00000 {
+                       compatible = "samsung,exynos850-cmu-cmgp";
+                       reg = <0x11c00000 0x8000>;
+                       #clock-cells = <1>;
+
+                       clocks = <&oscclk>, <&cmu_apm CLK_GOUT_CLKCMU_CMGP_BUS>;
+                       clock-names = "oscclk", "gout_clkcmu_cmgp_bus";
+               };
+
+               cmu_core: clock-controller@12000000 {
+                       compatible = "samsung,exynos850-cmu-core";
+                       reg = <0x12000000 0x8000>;
+                       #clock-cells = <1>;
+
+                       clocks = <&oscclk>, <&cmu_top CLK_DOUT_CORE_BUS>,
+                                <&cmu_top CLK_DOUT_CORE_CCI>,
+                                <&cmu_top CLK_DOUT_CORE_MMC_EMBD>,
+                                <&cmu_top CLK_DOUT_CORE_SSS>;
+                       clock-names = "oscclk", "dout_core_bus",
+                                     "dout_core_cci", "dout_core_mmc_embd",
+                                     "dout_core_sss";
+               };
+
+               cmu_top: clock-controller@120e0000 {
+                       compatible = "samsung,exynos850-cmu-top";
+                       reg = <0x120e0000 0x8000>;
+                       #clock-cells = <1>;
+
+                       clocks = <&oscclk>;
+                       clock-names = "oscclk";
+               };
+
+               cmu_dpu: clock-controller@13000000 {
+                       compatible = "samsung,exynos850-cmu-dpu";
+                       reg = <0x13000000 0x8000>;
+                       #clock-cells = <1>;
+
+                       clocks = <&oscclk>, <&cmu_top CLK_DOUT_DPU>;
+                       clock-names = "oscclk", "dout_dpu";
+               };
+
+               cmu_hsi: clock-controller@13400000 {
+                       compatible = "samsung,exynos850-cmu-hsi";
+                       reg = <0x13400000 0x8000>;
+                       #clock-cells = <1>;
+
+                       clocks = <&oscclk>,
+                                <&cmu_top CLK_DOUT_HSI_BUS>,
+                                <&cmu_top CLK_DOUT_HSI_MMC_CARD>,
+                                <&cmu_top CLK_DOUT_HSI_USB20DRD>;
+                       clock-names = "oscclk", "dout_hsi_bus",
+                                     "dout_hsi_mmc_card", "dout_hsi_usb20drd";
+               };
+
+               pinctrl_alive: pinctrl@11850000 {
+                       compatible = "samsung,exynos850-pinctrl";
+                       reg = <0x11850000 0x1000>;
+
+                       wakeup-interrupt-controller {
+                               compatible = "samsung,exynos850-wakeup-eint";
+                       };
+               };
+
+               pinctrl_cmgp: pinctrl@11c30000 {
+                       compatible = "samsung,exynos850-pinctrl";
+                       reg = <0x11c30000 0x1000>;
+
+                       wakeup-interrupt-controller {
+                               compatible = "samsung,exynos850-wakeup-eint";
+                       };
+               };
+
+               pinctrl_core: pinctrl@12070000 {
+                       compatible = "samsung,exynos850-pinctrl";
+                       reg = <0x12070000 0x1000>;
+                       interrupts = <GIC_SPI 451 IRQ_TYPE_LEVEL_HIGH>;
+               };
+
+               pinctrl_hsi: pinctrl@13430000 {
+                       compatible = "samsung,exynos850-pinctrl";
+                       reg = <0x13430000 0x1000>;
+                       interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>;
+               };
+
+               pinctrl_peri: pinctrl@139b0000 {
+                       compatible = "samsung,exynos850-pinctrl";
+                       reg = <0x139b0000 0x1000>;
+                       interrupts = <GIC_SPI 192 IRQ_TYPE_LEVEL_HIGH>;
+               };
+
+               pinctrl_aud: pinctrl@14a60000 {
+                       compatible = "samsung,exynos850-pinctrl";
+                       reg = <0x14a60000 0x1000>;
+               };
+
+               rtc: rtc@11a30000 {
+                       compatible = "samsung,s3c6410-rtc";
+                       reg = <0x11a30000 0x100>;
+                       interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cmu_apm CLK_GOUT_RTC_PCLK>;
+                       clock-names = "rtc";
+                       status = "disabled";
+               };
+
+               mmc_0: mmc@12100000 {
+                       compatible = "samsung,exynos7-dw-mshc-smu";
+                       reg = <0x12100000 0x2000>;
+                       interrupts = <GIC_SPI 452 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       clocks = <&cmu_core CLK_GOUT_MMC_EMBD_ACLK>,
+                                <&cmu_core CLK_GOUT_MMC_EMBD_SDCLKIN>;
+                       clock-names = "biu", "ciu";
+                       fifo-depth = <0x40>;
+                       status = "disabled";
+               };
+
+               i2c_0: i2c@13830000 {
+                       compatible = "samsung,s3c2440-i2c";
+                       reg = <0x13830000 0x100>;
+                       interrupts = <GIC_SPI 196 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&i2c0_pins>;
+                       clocks = <&cmu_peri CLK_GOUT_I2C0_PCLK>;
+                       clock-names = "i2c";
+                       status = "disabled";
+               };
+
+               i2c_1: i2c@13840000 {
+                       compatible = "samsung,s3c2440-i2c";
+                       reg = <0x13840000 0x100>;
+                       interrupts = <GIC_SPI 197 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&i2c1_pins>;
+                       clocks = <&cmu_peri CLK_GOUT_I2C1_PCLK>;
+                       clock-names = "i2c";
+                       status = "disabled";
+               };
+
+               i2c_2: i2c@13850000 {
+                       compatible = "samsung,s3c2440-i2c";
+                       reg = <0x13850000 0x100>;
+                       interrupts = <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&i2c2_pins>;
+                       clocks = <&cmu_peri CLK_GOUT_I2C2_PCLK>;
+                       clock-names = "i2c";
+                       status = "disabled";
+               };
+
+               i2c_3: i2c@13860000 {
+                       compatible = "samsung,s3c2440-i2c";
+                       reg = <0x13860000 0x100>;
+                       interrupts = <GIC_SPI 199 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&i2c3_pins>;
+                       clocks = <&cmu_peri CLK_GOUT_I2C3_PCLK>;
+                       clock-names = "i2c";
+                       status = "disabled";
+               };
+
+               i2c_4: i2c@13870000 {
+                       compatible = "samsung,s3c2440-i2c";
+                       reg = <0x13870000 0x100>;
+                       interrupts = <GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&i2c4_pins>;
+                       clocks = <&cmu_peri CLK_GOUT_I2C4_PCLK>;
+                       clock-names = "i2c";
+                       status = "disabled";
+               };
+
+               /* I2C_5 (also called CAM_PMIC_I2C in TRM) */
+               i2c_5: i2c@13880000 {
+                       compatible = "samsung,s3c2440-i2c";
+                       reg = <0x13880000 0x100>;
+                       interrupts = <GIC_SPI 201 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&i2c5_pins>;
+                       clocks = <&cmu_peri CLK_GOUT_I2C5_PCLK>;
+                       clock-names = "i2c";
+                       status = "disabled";
+               };
+
+               /* I2C_6 (also called MOTOR_I2C in TRM) */
+               i2c_6: i2c@13890000 {
+                       compatible = "samsung,s3c2440-i2c";
+                       reg = <0x13890000 0x100>;
+                       interrupts = <GIC_SPI 202 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&i2c6_pins>;
+                       clocks = <&cmu_peri CLK_GOUT_I2C6_PCLK>;
+                       clock-names = "i2c";
+                       status = "disabled";
+               };
+
+               sysreg_peri: syscon@10020000 {
+                       compatible = "samsung,exynos850-sysreg", "syscon";
+                       reg = <0x10020000 0x10000>;
+                       clocks = <&cmu_peri CLK_GOUT_SYSREG_PERI_PCLK>;
+               };
+
+               sysreg_cmgp: syscon@11c20000 {
+                       compatible = "samsung,exynos850-sysreg", "syscon";
+                       reg = <0x11c20000 0x10000>;
+                       clocks = <&cmu_cmgp CLK_GOUT_SYSREG_CMGP_PCLK>;
+               };
+
+               usi_uart: usi@138200c0 {
+                       compatible = "samsung,exynos850-usi";
+                       reg = <0x138200c0 0x20>;
+                       samsung,sysreg = <&sysreg_peri 0x1010>;
+                       samsung,mode = <USI_V2_UART>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peri CLK_GOUT_UART_PCLK>,
+                                <&cmu_peri CLK_GOUT_UART_IPCLK>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       serial_0: serial@13820000 {
+                               compatible = "samsung,exynos850-uart";
+                               reg = <0x13820000 0xc0>;
+                               interrupts = <GIC_SPI 227 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&uart0_pins>;
+                               clocks = <&cmu_peri CLK_GOUT_UART_PCLK>,
+                                        <&cmu_peri CLK_GOUT_UART_IPCLK>;
+                               clock-names = "uart", "clk_uart_baud0";
+                               status = "disabled";
+                       };
+               };
+
+               usi_hsi2c_0: usi@138a00c0 {
+                       compatible = "samsung,exynos850-usi";
+                       reg = <0x138a00c0 0x20>;
+                       samsung,sysreg = <&sysreg_peri 0x1020>;
+                       samsung,mode = <USI_V2_I2C>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peri CLK_GOUT_HSI2C0_PCLK>,
+                                <&cmu_peri CLK_GOUT_HSI2C0_IPCLK>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       hsi2c_0: i2c@138a0000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x138a0000 0xc0>;
+                               interrupts = <GIC_SPI 193 IRQ_TYPE_LEVEL_HIGH>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c0_pins>;
+                               clocks = <&cmu_peri CLK_GOUT_HSI2C0_IPCLK>,
+                                        <&cmu_peri CLK_GOUT_HSI2C0_PCLK>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               status = "disabled";
+                       };
+               };
+
+               usi_hsi2c_1: usi@138b00c0 {
+                       compatible = "samsung,exynos850-usi";
+                       reg = <0x138b00c0 0x20>;
+                       samsung,sysreg = <&sysreg_peri 0x1030>;
+                       samsung,mode = <USI_V2_I2C>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peri CLK_GOUT_HSI2C1_PCLK>,
+                                <&cmu_peri CLK_GOUT_HSI2C1_IPCLK>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       hsi2c_1: i2c@138b0000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x138b0000 0xc0>;
+                               interrupts = <GIC_SPI 194 IRQ_TYPE_LEVEL_HIGH>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c1_pins>;
+                               clocks = <&cmu_peri CLK_GOUT_HSI2C1_IPCLK>,
+                                        <&cmu_peri CLK_GOUT_HSI2C1_PCLK>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               status = "disabled";
+                       };
+               };
+
+               usi_hsi2c_2: usi@138c00c0 {
+                       compatible = "samsung,exynos850-usi";
+                       reg = <0x138c00c0 0x20>;
+                       samsung,sysreg = <&sysreg_peri 0x1040>;
+                       samsung,mode = <USI_V2_I2C>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peri CLK_GOUT_HSI2C2_PCLK>,
+                                <&cmu_peri CLK_GOUT_HSI2C2_IPCLK>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       hsi2c_2: i2c@138c0000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x138c0000 0xc0>;
+                               interrupts = <GIC_SPI 195 IRQ_TYPE_LEVEL_HIGH>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c2_pins>;
+                               clocks = <&cmu_peri CLK_GOUT_HSI2C2_IPCLK>,
+                                        <&cmu_peri CLK_GOUT_HSI2C2_PCLK>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               status = "disabled";
+                       };
+               };
+
+               usi_spi_0: usi@139400c0 {
+                       compatible = "samsung,exynos850-usi";
+                       reg = <0x139400c0 0x20>;
+                       samsung,sysreg = <&sysreg_peri 0x1050>;
+                       samsung,mode = <USI_V2_SPI>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peri CLK_GOUT_SPI0_PCLK>,
+                                <&cmu_peri CLK_GOUT_SPI0_IPCLK>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+               };
+
+               usi_cmgp0: usi@11d000c0 {
+                       compatible = "samsung,exynos850-usi";
+                       reg = <0x11d000c0 0x20>;
+                       samsung,sysreg = <&sysreg_cmgp 0x2000>;
+                       samsung,mode = <USI_V2_I2C>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_cmgp CLK_GOUT_CMGP_USI0_PCLK>,
+                                <&cmu_cmgp CLK_GOUT_CMGP_USI0_IPCLK>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       hsi2c_3: i2c@11d00000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x11d00000 0xc0>;
+                               interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c3_pins>;
+                               clocks = <&cmu_cmgp CLK_GOUT_CMGP_USI0_IPCLK>,
+                                        <&cmu_cmgp CLK_GOUT_CMGP_USI0_PCLK>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               status = "disabled";
+                       };
+
+                       serial_1: serial@11d00000 {
+                               compatible = "samsung,exynos850-uart";
+                               reg = <0x11d00000 0xc0>;
+                               interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&uart1_single_pins>;
+                               clocks = <&cmu_cmgp CLK_GOUT_CMGP_USI0_PCLK>,
+                                        <&cmu_cmgp CLK_GOUT_CMGP_USI0_IPCLK>;
+                               clock-names = "uart", "clk_uart_baud0";
+                               status = "disabled";
+                       };
+               };
+
+               usi_cmgp1: usi@11d200c0 {
+                       compatible = "samsung,exynos850-usi";
+                       reg = <0x11d200c0 0x20>;
+                       samsung,sysreg = <&sysreg_cmgp 0x2010>;
+                       samsung,mode = <USI_V2_I2C>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_cmgp CLK_GOUT_CMGP_USI1_PCLK>,
+                                <&cmu_cmgp CLK_GOUT_CMGP_USI1_IPCLK>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       hsi2c_4: i2c@11d20000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x11d20000 0xc0>;
+                               interrupts = <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c4_pins>;
+                               clocks = <&cmu_cmgp CLK_GOUT_CMGP_USI1_IPCLK>,
+                                        <&cmu_cmgp CLK_GOUT_CMGP_USI1_PCLK>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               status = "disabled";
+                       };
+
+                       serial_2: serial@11d20000 {
+                               compatible = "samsung,exynos850-uart";
+                               reg = <0x11d20000 0xc0>;
+                               interrupts = <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&uart2_single_pins>;
+                               clocks = <&cmu_cmgp CLK_GOUT_CMGP_USI1_PCLK>,
+                                        <&cmu_cmgp CLK_GOUT_CMGP_USI1_IPCLK>;
+                               clock-names = "uart", "clk_uart_baud0";
+                               status = "disabled";
+                       };
+               };
+       };
+};
+
+#include "exynos850-pinctrl.dtsi"
index 2407b03..ef0349d 100644 (file)
@@ -11,7 +11,7 @@
 #include <dt-bindings/pinctrl/samsung.h>
 
 &pinctrl_alive {
-       gpa0: gpa0 {
+       gpa0: gpa0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
                interrupt-controller;
@@ -27,7 +27,7 @@
                             <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
        };
 
-       gpa1: gpa1 {
+       gpa1: gpa1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
                interrupt-controller;
@@ -47,7 +47,7 @@
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
        };
 
-       gpq0: gpq0 {
+       gpq0: gpq0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -69,7 +69,7 @@
 };
 
 &pinctrl_aud {
-       gpb0: gpb0 {
+       gpb0: gpb0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -77,7 +77,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpb1: gpb1 {
+       gpb1: gpb1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -85,7 +85,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpb2: gpb2 {
+       gpb2: gpb2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
@@ -93,7 +93,7 @@
                #interrupt-cells = <2>;
        };
 
-       gpb3: gpb3 {
+       gpb3: gpb3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
 };
 
 &pinctrl_fsys0 {
-       gpf0: gpf0 {
+       gpf0: gpf0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf1: gpf1 {
+       gpf1: gpf1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
 };
 
 &pinctrl_fsys1 {
-       gpf8: gpf8 {
+       gpf8: gpf8-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
 };
 
 &pinctrl_fsys2 {
-       gpf2: gpf2 {
+       gpf2: gpf2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf3: gpf3 {
+       gpf3: gpf3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf4: gpf4 {
+       gpf4: gpf4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf5: gpf5 {
+       gpf5: gpf5-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpf6: gpf6 {
+       gpf6: gpf6-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
 };
 
 &pinctrl_peric0 {
-       gpp0: gpp0 {
+       gpp0: gpp0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpp1: gpp1 {
+       gpp1: gpp1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpp2: gpp2 {
+       gpp2: gpp2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpg0: gpg0 {
+       gpg0: gpg0-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
 };
 
 &pinctrl_peric1 {
-       gpp3: gpp3 {
+       gpp3: gpp3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpp4: gpp4 {
+       gpp4: gpp4-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpp5: gpp5 {
+       gpp5: gpp5-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpg1: gpg1 {
+       gpg1: gpg1-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpg2: gpg2 {
+       gpg2: gpg2-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
                #interrupt-cells = <2>;
        };
 
-       gpg3: gpg3 {
+       gpg3: gpg3-gpio-bank {
                gpio-controller;
                #gpio-cells = <2>;
 
index de8fcb8..807d500 100644 (file)
                        reg = <0x10450000 0x1000>;
 
                        wakeup-interrupt-controller {
-                               compatible = "samsung,exynos7-wakeup-eint";
+                               compatible = "samsung,exynosautov9-wakeup-eint";
                        };
                };
 
index 6d8f0a5..7f51b53 100644 (file)
@@ -1,14 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
 
-# required for overlay support
-DTC_FLAGS_fsl-ls1028a-qds := -@
-DTC_FLAGS_fsl-ls1028a-qds-13bb := -@
-DTC_FLAGS_fsl-ls1028a-qds-65bb := -@
-DTC_FLAGS_fsl-ls1028a-qds-7777 := -@
-DTC_FLAGS_fsl-ls1028a-qds-85bb := -@
-DTC_FLAGS_fsl-ls1028a-qds-899b := -@
-DTC_FLAGS_fsl-ls1028a-qds-9999 := -@
-
 dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1012a-frdm.dtb
 dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1012a-frwy.dtb
 dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1012a-oxalis.dtb
@@ -21,12 +12,6 @@ dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-kontron-sl28-var2.dtb
 dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-kontron-sl28-var3-ads2.dtb
 dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-kontron-sl28-var4.dtb
 dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds.dtb
-dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds-13bb.dtb
-dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds-65bb.dtb
-dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds-7777.dtb
-dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds-85bb.dtb
-dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds-899b.dtb
-dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds-9999.dtb
 dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-rdb.dtb
 dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1043a-qds.dtb
 dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1043a-rdb.dtb
@@ -49,9 +34,24 @@ dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-lx2160a-qds.dtb
 dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-lx2160a-rdb.dtb
 dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-lx2162a-qds.dtb
 
+fsl-ls1028a-qds-13bb-dtbs := fsl-ls1028a-qds.dtb fsl-ls1028a-qds-13bb.dtbo
+fsl-ls1028a-qds-65bb-dtbs := fsl-ls1028a-qds.dtb fsl-ls1028a-qds-65bb.dtbo
+fsl-ls1028a-qds-7777-dtbs := fsl-ls1028a-qds.dtb fsl-ls1028a-qds-7777.dtbo
+fsl-ls1028a-qds-85bb-dtbs := fsl-ls1028a-qds.dtb fsl-ls1028a-qds-85bb.dtbo
+fsl-ls1028a-qds-899b-dtbs := fsl-ls1028a-qds.dtb fsl-ls1028a-qds-899b.dtbo
+fsl-ls1028a-qds-9999-dtbs := fsl-ls1028a-qds.dtb fsl-ls1028a-qds-9999.dtbo
+
+dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds-13bb.dtb
+dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds-65bb.dtb
+dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds-7777.dtb
+dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds-85bb.dtb
+dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds-899b.dtb
+dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds-9999.dtb
+
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-beacon-kit.dtb
-dtb-$(CONFIG_ARCH_MXC) += imx8mm-evk.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-ddr4-evk.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx8mm-emcon-avari.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx8mm-evk.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-icore-mx8mm-ctouch2.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-icore-mx8mm-edimm2.2.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-kontron-n801x-s.dtb
@@ -63,6 +63,11 @@ dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw72xx-0x.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw73xx-0x.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw7901.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw7902.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw7903.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx8mm-verdin-nonwifi-dahlia.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx8mm-verdin-nonwifi-dev.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx8mm-verdin-wifi-dahlia.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx8mm-verdin-wifi-dev.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mn-beacon-kit.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mn-bsh-smm-s2.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mn-bsh-smm-s2pro.dtb
@@ -94,6 +99,24 @@ dtb-$(CONFIG_ARCH_MXC) += imx8qxp-colibri-eval-v3.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8qxp-mek.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8ulp-evk.dtb
 
+imx8mm-venice-gw72xx-0x-imx219-dtbs    := imx8mm-venice-gw73xx-0x.dtb imx8mm-venice-gw73xx-0x-imx219.dtbo
+imx8mm-venice-gw72xx-0x-rs232-rts-dtbs := imx8mm-venice-gw72xx-0x.dtb imx8mm-venice-gw72xx-0x-rs232-rts.dtbo
+imx8mm-venice-gw72xx-0x-rs422-dtbs     := imx8mm-venice-gw72xx-0x.dtb imx8mm-venice-gw72xx-0x-rs422.dtbo
+imx8mm-venice-gw72xx-0x-rs485-dtbs     := imx8mm-venice-gw72xx-0x.dtb imx8mm-venice-gw72xx-0x-rs485.dtbo
+imx8mm-venice-gw73xx-0x-imx219-dtbs    := imx8mm-venice-gw73xx-0x.dtb imx8mm-venice-gw73xx-0x-imx219.dtbo
+imx8mm-venice-gw73xx-0x-rs232-rts-dtbs := imx8mm-venice-gw73xx-0x.dtb imx8mm-venice-gw73xx-0x-rs232-rts.dtbo
+imx8mm-venice-gw73xx-0x-rs422-dtbs     := imx8mm-venice-gw73xx-0x.dtb imx8mm-venice-gw73xx-0x-rs422.dtbo
+imx8mm-venice-gw73xx-0x-rs485-dtbs     := imx8mm-venice-gw73xx-0x.dtb imx8mm-venice-gw73xx-0x-rs485.dtbo
+
+dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw72xx-0x-imx219.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw72xx-0x-rs232-rts.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw72xx-0x-rs422.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw72xx-0x-rs485.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw73xx-0x-imx219.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw73xx-0x-rs232-rts.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw73xx-0x-rs422.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw73xx-0x-rs485.dtb
+
 dtb-$(CONFIG_ARCH_S32) += s32g274a-evb.dtb
 dtb-$(CONFIG_ARCH_S32) += s32g274a-rdb2.dtb
 dtb-$(CONFIG_ARCH_S32) += s32v234-evb.dtb
index f748a2c..f826392 100644 (file)
 /dts-v1/;
 /plugin/;
 
-/ {
-       fragment@0 {
-               target = <&mdio_slot1>;
-
-               __overlay__ {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-
-                       slot1_sgmii: ethernet-phy@2 {
-                               /* AQR112 */
-                               reg = <0x2>;
-                               compatible = "ethernet-phy-ieee802.3-c45";
-                       };
-               };
-       };
-
-       fragment@1 {
-               target = <&enetc_port0>;
-
-               __overlay__ {
-                       phy-handle = <&slot1_sgmii>;
-                       phy-mode = "usxgmii";
-                       managed = "in-band-status";
-                       status = "okay";
-               };
+&mdio_slot1 {
+       #address-cells = <1>;
+       #size-cells = <0>;
+
+       slot1_sgmii: ethernet-phy@2 {
+               /* AQR112 */
+               reg = <0x2>;
+               compatible = "ethernet-phy-ieee802.3-c45";
        };
+};
 
-       fragment@2 {
-               target = <&mdio_slot2>;
-
-               __overlay__ {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-
-                       /* 4 ports on AQR412 */
-                       slot2_qxgmii0: ethernet-phy@0 {
-                               reg = <0x0>;
-                               compatible = "ethernet-phy-ieee802.3-c45";
-                       };
-
-                       slot2_qxgmii1: ethernet-phy@1 {
-                               reg = <0x1>;
-                               compatible = "ethernet-phy-ieee802.3-c45";
-                       };
+&enetc_port0 {
+       phy-handle = <&slot1_sgmii>;
+       phy-mode = "usxgmii";
+       managed = "in-band-status";
+       status = "okay";
+};
 
-                       slot2_qxgmii2: ethernet-phy@2 {
-                               reg = <0x2>;
-                               compatible = "ethernet-phy-ieee802.3-c45";
-                       };
+&mdio_slot2 {
+       #address-cells = <1>;
+       #size-cells = <0>;
 
-                       slot2_qxgmii3: ethernet-phy@3 {
-                               reg = <0x3>;
-                               compatible = "ethernet-phy-ieee802.3-c45";
-                       };
-               };
+       /* 4 ports on AQR412 */
+       slot2_qxgmii0: ethernet-phy@0 {
+               reg = <0x0>;
+               compatible = "ethernet-phy-ieee802.3-c45";
        };
 
-       fragment@3 {
-               target = <&mscc_felix_ports>;
+       slot2_qxgmii1: ethernet-phy@1 {
+               reg = <0x1>;
+               compatible = "ethernet-phy-ieee802.3-c45";
+       };
 
-               __overlay__ {
-                       port@0 {
-                               status = "okay";
-                               phy-handle = <&slot2_qxgmii0>;
-                               phy-mode = "usxgmii";
-                               managed = "in-band-status";
-                       };
+       slot2_qxgmii2: ethernet-phy@2 {
+               reg = <0x2>;
+               compatible = "ethernet-phy-ieee802.3-c45";
+       };
 
-                       port@1 {
-                               status = "okay";
-                               phy-handle = <&slot2_qxgmii1>;
-                               phy-mode = "usxgmii";
-                               managed = "in-band-status";
-                       };
+       slot2_qxgmii3: ethernet-phy@3 {
+               reg = <0x3>;
+               compatible = "ethernet-phy-ieee802.3-c45";
+       };
+};
 
-                       port@2 {
-                               status = "okay";
-                               phy-handle = <&slot2_qxgmii2>;
-                               phy-mode = "usxgmii";
-                               managed = "in-band-status";
-                       };
+&mscc_felix_ports {
+       port@0 {
+               status = "okay";
+               phy-handle = <&slot2_qxgmii0>;
+               phy-mode = "usxgmii";
+               managed = "in-band-status";
+       };
 
-                       port@3 {
-                               status = "okay";
-                               phy-handle = <&slot2_qxgmii3>;
-                               phy-mode = "usxgmii";
-                               managed = "in-band-status";
-                       };
-               };
+       port@1 {
+               status = "okay";
+               phy-handle = <&slot2_qxgmii1>;
+               phy-mode = "usxgmii";
+               managed = "in-band-status";
        };
 
-       fragment@4 {
-               target = <&mscc_felix>;
+       port@2 {
+               status = "okay";
+               phy-handle = <&slot2_qxgmii2>;
+               phy-mode = "usxgmii";
+               managed = "in-band-status";
+       };
 
-               __overlay__ {
-                       status = "okay";
-               };
+       port@3 {
+               status = "okay";
+               phy-handle = <&slot2_qxgmii3>;
+               phy-mode = "usxgmii";
+               managed = "in-band-status";
        };
 };
+
+&mscc_felix {
+       status = "okay";
+};
index 8ffb707..40d34c8 100644 (file)
 /dts-v1/;
 /plugin/;
 
-/ {
-       fragment@0 {
-               target = <&mdio_slot1>;
-
-               __overlay__ {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-
-                       slot1_sgmii: ethernet-phy@2 {
-                               /* AQR112 */
-                               reg = <0x2>;
-                               compatible = "ethernet-phy-ieee802.3-c45";
-                       };
-               };
-       };
-
-       fragment@1 {
-               target = <&enetc_port0>;
-
-               __overlay__ {
-                       phy-handle = <&slot1_sgmii>;
-                       phy-mode = "2500base-x";
-                       managed = "in-band-status";
-                       status = "okay";
-               };
+&mdio_slot1 {
+       #address-cells = <1>;
+       #size-cells = <0>;
+
+       slot1_sgmii: ethernet-phy@2 {
+               /* AQR112 */
+               reg = <0x2>;
+               compatible = "ethernet-phy-ieee802.3-c45";
        };
+};
 
-       fragment@2 {
-               target = <&mdio_slot2>;
-
-               __overlay__ {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-
-                       /* 4 ports on VSC8514 */
-                       slot2_qsgmii0: ethernet-phy@8 {
-                               reg = <0x8>;
-                       };
-
-                       slot2_qsgmii1: ethernet-phy@9 {
-                               reg = <0x9>;
-                       };
+&enetc_port0 {
+       phy-handle = <&slot1_sgmii>;
+       phy-mode = "2500base-x";
+       managed = "in-band-status";
+       status = "okay";
+};
 
-                       slot2_qsgmii2: ethernet-phy@a {
-                               reg = <0xa>;
-                       };
+&mdio_slot2 {
+       #address-cells = <1>;
+       #size-cells = <0>;
 
-                       slot2_qsgmii3: ethernet-phy@b {
-                               reg = <0xb>;
-                       };
-               };
+       /* 4 ports on VSC8514 */
+       slot2_qsgmii0: ethernet-phy@8 {
+               reg = <0x8>;
        };
 
-       fragment@3 {
-               target = <&mscc_felix_ports>;
+       slot2_qsgmii1: ethernet-phy@9 {
+               reg = <0x9>;
+       };
 
-               __overlay__ {
-                       port@0 {
-                               status = "okay";
-                               phy-handle = <&slot2_qsgmii0>;
-                               phy-mode = "qsgmii";
-                               managed = "in-band-status";
-                       };
+       slot2_qsgmii2: ethernet-phy@a {
+               reg = <0xa>;
+       };
 
-                       port@1 {
-                               status = "okay";
-                               phy-handle = <&slot2_qsgmii1>;
-                               phy-mode = "qsgmii";
-                               managed = "in-band-status";
-                       };
+       slot2_qsgmii3: ethernet-phy@b {
+               reg = <0xb>;
+       };
+};
 
-                       port@2 {
-                               status = "okay";
-                               phy-handle = <&slot2_qsgmii2>;
-                               phy-mode = "qsgmii";
-                               managed = "in-band-status";
-                       };
+&mscc_felix_ports {
+       port@0 {
+               status = "okay";
+               phy-handle = <&slot2_qsgmii0>;
+               phy-mode = "qsgmii";
+               managed = "in-band-status";
+       };
 
-                       port@3 {
-                               status = "okay";
-                               phy-handle = <&slot2_qsgmii3>;
-                               phy-mode = "qsgmii";
-                               managed = "in-band-status";
-                       };
-               };
+       port@1 {
+               status = "okay";
+               phy-handle = <&slot2_qsgmii1>;
+               phy-mode = "qsgmii";
+               managed = "in-band-status";
        };
 
-       fragment@4 {
-               target = <&mscc_felix>;
+       port@2 {
+               status = "okay";
+               phy-handle = <&slot2_qsgmii2>;
+               phy-mode = "qsgmii";
+               managed = "in-band-status";
+       };
 
-               __overlay__ {
-                       status = "okay";
-               };
+       port@3 {
+               status = "okay";
+               phy-handle = <&slot2_qsgmii3>;
+               phy-mode = "qsgmii";
+               managed = "in-band-status";
        };
 };
+
+&mscc_felix {
+       status = "okay";
+};
index eb6a1e6..1dff68d 100644 (file)
 /dts-v1/;
 /plugin/;
 
-/ {
-       fragment@0 {
-               target = <&mdio_slot1>;
+&mdio_slot1 {
+       #address-cells = <1>;
+       #size-cells = <0>;
 
-               __overlay__ {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-
-                       /* 4 ports on AQR412 */
-                       slot1_sxgmii0: ethernet-phy@0 {
-                               reg = <0x0>;
-                               compatible = "ethernet-phy-ieee802.3-c45";
-                       };
-
-                       slot1_sxgmii1: ethernet-phy@1 {
-                               reg = <0x1>;
-                               compatible = "ethernet-phy-ieee802.3-c45";
-                       };
-
-                       slot1_sxgmii2: ethernet-phy@2 {
-                               reg = <0x2>;
-                               compatible = "ethernet-phy-ieee802.3-c45";
-                       };
+       /* 4 ports on AQR412 */
+       slot1_sxgmii0: ethernet-phy@0 {
+               reg = <0x0>;
+               compatible = "ethernet-phy-ieee802.3-c45";
+       };
 
-                       slot1_sxgmii3: ethernet-phy@3 {
-                               reg = <0x3>;
-                               compatible = "ethernet-phy-ieee802.3-c45";
-                       };
-               };
+       slot1_sxgmii1: ethernet-phy@1 {
+               reg = <0x1>;
+               compatible = "ethernet-phy-ieee802.3-c45";
        };
 
-       fragment@1 {
-               target = <&mscc_felix_ports>;
+       slot1_sxgmii2: ethernet-phy@2 {
+               reg = <0x2>;
+               compatible = "ethernet-phy-ieee802.3-c45";
+       };
 
-               __overlay__ {
-                       port@0 {
-                               status = "okay";
-                               phy-handle = <&slot1_sxgmii0>;
-                               phy-mode = "2500base-x";
-                       };
+       slot1_sxgmii3: ethernet-phy@3 {
+               reg = <0x3>;
+               compatible = "ethernet-phy-ieee802.3-c45";
+       };
+};
 
-                       port@1 {
-                               status = "okay";
-                               phy-handle = <&slot1_sxgmii1>;
-                               phy-mode = "2500base-x";
-                       };
+&mscc_felix_ports {
+       port@0 {
+               status = "okay";
+               phy-handle = <&slot1_sxgmii0>;
+               phy-mode = "2500base-x";
+       };
 
-                       port@2 {
-                               status = "okay";
-                               phy-handle = <&slot1_sxgmii2>;
-                               phy-mode = "2500base-x";
-                       };
+       port@1 {
+               status = "okay";
+               phy-handle = <&slot1_sxgmii1>;
+               phy-mode = "2500base-x";
+       };
 
-                       port@3 {
-                               status = "okay";
-                               phy-handle = <&slot1_sxgmii3>;
-                               phy-mode = "2500base-x";
-                       };
-               };
+       port@2 {
+               status = "okay";
+               phy-handle = <&slot1_sxgmii2>;
+               phy-mode = "2500base-x";
        };
 
-       fragment@2 {
-               target = <&mscc_felix>;
-               __overlay__ {
-                       status = "okay";
-               };
+       port@3 {
+               status = "okay";
+               phy-handle = <&slot1_sxgmii3>;
+               phy-mode = "2500base-x";
        };
 };
+
+&mscc_felix {
+       status = "okay";
+};
index 8e90c30..19424d3 100644 (file)
 /dts-v1/;
 /plugin/;
 
-/ {
-       fragment@0 {
-               target = <&mdio_slot1>;
+&mdio_slot1 {
+       #address-cells = <1>;
+       #size-cells = <0>;
 
-               __overlay__ {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-
-                       slot1_sgmii: ethernet-phy@1c {
-                               /* 1st port on VSC8234 */
-                               reg = <0x1c>;
-                       };
-               };
+       slot1_sgmii: ethernet-phy@1c {
+               /* 1st port on VSC8234 */
+               reg = <0x1c>;
        };
+};
 
-       fragment@1 {
-               target = <&enetc_port0>;
-
-               __overlay__ {
-                       phy-handle = <&slot1_sgmii>;
-                       phy-mode = "sgmii";
-                       managed = "in-band-status";
-                       status = "okay";
-               };
-       };
-
-       fragment@2 {
-               target = <&mdio_slot2>;
-
-               __overlay__ {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-
-                       /* 4 ports on VSC8514 */
-                       slot2_qsgmii0: ethernet-phy@8 {
-                               reg = <0x8>;
-                       };
-
-                       slot2_qsgmii1: ethernet-phy@9 {
-                               reg = <0x9>;
-                       };
+&enetc_port0 {
+       phy-handle = <&slot1_sgmii>;
+       phy-mode = "sgmii";
+       managed = "in-band-status";
+       status = "okay";
+};
 
-                       slot2_qsgmii2: ethernet-phy@a {
-                               reg = <0xa>;
-                       };
+&mdio_slot2 {
+       #address-cells = <1>;
+       #size-cells = <0>;
 
-                       slot2_qsgmii3: ethernet-phy@b {
-                               reg = <0xb>;
-                       };
-               };
+       /* 4 ports on VSC8514 */
+       slot2_qsgmii0: ethernet-phy@8 {
+               reg = <0x8>;
        };
 
-       fragment@3 {
-               target = <&mscc_felix_ports>;
+       slot2_qsgmii1: ethernet-phy@9 {
+               reg = <0x9>;
+       };
 
-               __overlay__ {
-                       port@0 {
-                               status = "okay";
-                               phy-handle = <&slot2_qsgmii0>;
-                               phy-mode = "qsgmii";
-                               managed = "in-band-status";
-                       };
+       slot2_qsgmii2: ethernet-phy@a {
+               reg = <0xa>;
+       };
 
-                       port@1 {
-                               status = "okay";
-                               phy-handle = <&slot2_qsgmii1>;
-                               phy-mode = "qsgmii";
-                               managed = "in-band-status";
-                       };
+       slot2_qsgmii3: ethernet-phy@b {
+               reg = <0xb>;
+       };
+};
 
-                       port@2 {
-                               status = "okay";
-                               phy-handle = <&slot2_qsgmii2>;
-                               phy-mode = "qsgmii";
-                               managed = "in-band-status";
-                       };
+&mscc_felix_ports {
+       port@0 {
+               status = "okay";
+               phy-handle = <&slot2_qsgmii0>;
+               phy-mode = "qsgmii";
+               managed = "in-band-status";
+       };
 
-                       port@3 {
-                               status = "okay";
-                               phy-handle = <&slot2_qsgmii3>;
-                               phy-mode = "qsgmii";
-                               managed = "in-band-status";
-                       };
-               };
+       port@1 {
+               status = "okay";
+               phy-handle = <&slot2_qsgmii1>;
+               phy-mode = "qsgmii";
+               managed = "in-band-status";
        };
 
-       fragment@4 {
-               target = <&mscc_felix>;
+       port@2 {
+               status = "okay";
+               phy-handle = <&slot2_qsgmii2>;
+               phy-mode = "qsgmii";
+               managed = "in-band-status";
+       };
 
-               __overlay__ {
-                       status = "okay";
-               };
+       port@3 {
+               status = "okay";
+               phy-handle = <&slot2_qsgmii3>;
+               phy-mode = "qsgmii";
+               managed = "in-band-status";
        };
 };
+
+&mscc_felix {
+       status = "okay";
+};
index 5d0a094..fb85847 100644 (file)
 /dts-v1/;
 /plugin/;
 
-/ {
-       fragment@0 {
-               target = <&mdio_slot1>;
-               __overlay__ {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
+&mdio_slot1 {
+       #address-cells = <1>;
+       #size-cells = <0>;
 
-                       /* VSC8234 */
-                       slot1_sgmii0: ethernet-phy@1c {
-                               reg = <0x1c>;
-                       };
-
-                       slot1_sgmii1: ethernet-phy@1d {
-                               reg = <0x1d>;
-                       };
+       /* VSC8234 */
+       slot1_sgmii0: ethernet-phy@1c {
+               reg = <0x1c>;
+       };
 
-                       slot1_sgmii2: ethernet-phy@1e {
-                               reg = <0x1e>;
-                       };
+       slot1_sgmii1: ethernet-phy@1d {
+               reg = <0x1d>;
+       };
 
-                       slot1_sgmii3: ethernet-phy@1f {
-                               reg = <0x1f>;
-                       };
-               };
+       slot1_sgmii2: ethernet-phy@1e {
+               reg = <0x1e>;
        };
 
-       fragment@1 {
-               target = <&enetc_port0>;
-               __overlay__ {
-                       phy-handle = <&slot1_sgmii0>;
-                       phy-mode = "sgmii";
-                       managed = "in-band-status";
-                       status = "okay";
-               };
+       slot1_sgmii3: ethernet-phy@1f {
+               reg = <0x1f>;
        };
+};
 
-       fragment@2 {
-               target = <&mscc_felix_ports>;
-               __overlay__ {
-                       port@1 {
-                               status = "okay";
-                               phy-handle = <&slot1_sgmii1>;
-                               phy-mode = "sgmii";
-                               managed = "in-band-status";
-                       };
+&enetc_port0 {
+       phy-handle = <&slot1_sgmii0>;
+       phy-mode = "sgmii";
+       managed = "in-band-status";
+       status = "okay";
+};
 
-                       port@2 {
-                               status = "okay";
-                               phy-handle = <&slot1_sgmii2>;
-                               phy-mode = "sgmii";
-                               managed = "in-band-status";
-                       };
-               };
+&mscc_felix_ports {
+       port@1 {
+               status = "okay";
+               phy-handle = <&slot1_sgmii1>;
+               phy-mode = "sgmii";
+               managed = "in-band-status";
        };
 
-       fragment@3 {
-               target = <&mscc_felix>;
-               __overlay__ {
-                       status = "okay";
-               };
+       port@2 {
+               status = "okay";
+               phy-handle = <&slot1_sgmii2>;
+               phy-mode = "sgmii";
+               managed = "in-band-status";
        };
 };
+
+&mscc_felix {
+       status = "okay";
+};
index 1ef743c..63e46fa 100644 (file)
 /dts-v1/;
 /plugin/;
 
-/ {
-       fragment@0 {
-               target = <&mdio_slot1>;
-               __overlay__ {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
+&mdio_slot1 {
+       #address-cells = <1>;
+       #size-cells = <0>;
 
-                       /* VSC8234 */
-                       slot1_sgmii0: ethernet-phy@1c {
-                               reg = <0x1c>;
-                       };
-
-                       slot1_sgmii1: ethernet-phy@1d {
-                               reg = <0x1d>;
-                       };
+       /* VSC8234 */
+       slot1_sgmii0: ethernet-phy@1c {
+               reg = <0x1c>;
+       };
 
-                       slot1_sgmii2: ethernet-phy@1e {
-                               reg = <0x1e>;
-                       };
+       slot1_sgmii1: ethernet-phy@1d {
+               reg = <0x1d>;
+       };
 
-                       slot1_sgmii3: ethernet-phy@1f {
-                               reg = <0x1f>;
-                       };
-               };
+       slot1_sgmii2: ethernet-phy@1e {
+               reg = <0x1e>;
        };
 
-       fragment@1 {
-               target = <&mscc_felix_ports>;
-               __overlay__ {
-                       port@0 {
-                               status = "okay";
-                               phy-handle = <&slot1_sgmii0>;
-                               phy-mode = "sgmii";
-                               managed = "in-band-status";
-                       };
+       slot1_sgmii3: ethernet-phy@1f {
+               reg = <0x1f>;
+       };
+};
 
-                       port@1 {
-                               status = "okay";
-                               phy-handle = <&slot1_sgmii1>;
-                               phy-mode = "sgmii";
-                               managed = "in-band-status";
-                       };
+&mscc_felix_ports {
+       port@0 {
+               status = "okay";
+               phy-handle = <&slot1_sgmii0>;
+               phy-mode = "sgmii";
+               managed = "in-band-status";
+       };
 
-                       port@2 {
-                               status = "okay";
-                               phy-handle = <&slot1_sgmii2>;
-                               phy-mode = "sgmii";
-                               managed = "in-band-status";
-                       };
+       port@1 {
+               status = "okay";
+               phy-handle = <&slot1_sgmii1>;
+               phy-mode = "sgmii";
+               managed = "in-band-status";
+       };
 
-                       port@3 {
-                               status = "okay";
-                               phy-handle = <&slot1_sgmii3>;
-                               phy-mode = "sgmii";
-                               managed = "in-band-status";
-                       };
-               };
+       port@2 {
+               status = "okay";
+               phy-handle = <&slot1_sgmii2>;
+               phy-mode = "sgmii";
+               managed = "in-band-status";
        };
 
-       fragment@2 {
-               target = <&mscc_felix>;
-               __overlay__ {
-                       status = "okay";
-               };
+       port@3 {
+               status = "okay";
+               phy-handle = <&slot1_sgmii3>;
+               phy-mode = "sgmii";
+               managed = "in-band-status";
        };
 };
+
+&mscc_felix {
+       status = "okay";
+};
index 177bc14..19d3952 100644 (file)
                                reg = <5>;
                        };
                };
+
+               mdio_slot1: mdio@4 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <4>;
+               };
+
+               mdio_slot2: mdio@5 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <5>;
+               };
+
+               mdio_slot3: mdio@6 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <6>;
+               };
+
+               mdio_slot4: mdio@7 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <7>;
+               };
        };
 };
 
index 5bb8c26..088271d 100644 (file)
                        little-endian;
                };
 
+               efuse@1e80000 {
+                       compatible = "fsl,ls1028a-sfp";
+                       reg = <0x0 0x1e80000 0x0 0x10000>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       ls1028a_uid: unique-id@1c {
+                               reg = <0x1c 0x8>;
+                       };
+               };
+
                scfg: syscon@1fc0000 {
                        compatible = "fsl,ls1028a-scfg", "syscon";
                        reg = <0x0 0x1fc0000 0x0 0x10000>;
index ee4e585..6446e6d 100644 (file)
@@ -141,6 +141,22 @@ lsio_subsys: bus@5d000000 {
                status = "disabled";
        };
 
+       lsio_mu5: mailbox@5d200000 {
+               reg = <0x5d200000 0x10000>;
+               interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
+               #mbox-cells = <2>;
+               power-domains = <&pd IMX_SC_R_MU_5A>;
+               status = "disabled";
+       };
+
+       lsio_mu6: mailbox@5d210000 {
+               reg = <0x5d210000 0x10000>;
+               interrupts = <GIC_SPI 185 IRQ_TYPE_LEVEL_HIGH>;
+               #mbox-cells = <2>;
+               power-domains = <&pd IMX_SC_R_MU_6A>;
+               status = "disabled";
+       };
+
        lsio_mu13: mailbox@5d280000 {
                reg = <0x5d280000 0x10000>;
                interrupts = <GIC_SPI 192 IRQ_TYPE_LEVEL_HIGH>;
index 0da3118..ec3f2c1 100644 (file)
@@ -3,6 +3,8 @@
  * Copyright 2020 Compass Electronics Group, LLC
  */
 
+#include <dt-bindings/phy/phy-imx8-pcie.h>
+
 / {
        leds {
                compatible = "gpio-leds";
                };
        };
 
+       pcie0_refclk: pcie0-refclk {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <100000000>;
+       };
+
+       pcie0_refclk_gated:  pcie0-refclk-gated {
+               compatible = "gpio-gate-clock";
+               clocks = <&pcie0_refclk>;
+               #clock-cells = <0>;
+               enable-gpios = <&pca6416_1 2 GPIO_ACTIVE_LOW>;
+       };
+
        reg_audio: regulator-audio {
                compatible = "regulator-fixed";
                regulator-name = "3v3_aud";
                startup-delay-us = <100000>;
        };
 
+       reg_pcie0: regulator-pcie {
+               compatible = "regulator-fixed";
+               regulator-name = "pci_pwr_en";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               enable-active-high;
+               gpio = <&pca6416_1 1 GPIO_ACTIVE_HIGH>;
+               startup-delay-us = <100000>;
+       };
+
        reg_usdhc2_vmmc: regulator-usdhc2 {
                compatible = "regulator-fixed";
                regulator-name = "VSD_3V3";
        };
 };
 
+&pcie_phy {
+       fsl,refclk-pad-mode = <IMX8_PCIE_REFCLK_PAD_INPUT>;
+       fsl,tx-deemph-gen1 = <0x2d>;
+       fsl,tx-deemph-gen2 = <0xf>;
+       fsl,clkreq-unsupported;
+       clocks = <&pcie0_refclk_gated>;
+       clock-names = "ref";
+       status = "okay";
+};
+
+&pcie0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pcie0>;
+       reset-gpio = <&gpio4 21 GPIO_ACTIVE_LOW>;
+       clocks = <&clk IMX8MM_CLK_PCIE1_ROOT>, <&clk IMX8MM_CLK_PCIE1_AUX>,
+                <&pcie0_refclk_gated>;
+       clock-names = "pcie", "pcie_aux", "pcie_bus";
+       assigned-clocks = <&clk IMX8MM_CLK_PCIE1_AUX>,
+                         <&clk IMX8MM_CLK_PCIE1_CTRL>;
+       assigned-clock-rates = <10000000>, <250000000>;
+       assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_50M>,
+                                <&clk IMX8MM_SYS_PLL2_250M>;
+       vpcie-supply = <&reg_pcie0>;
+       status = "okay";
+};
+
 &sai3 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_sai3>;
                >;
        };
 
+       pinctrl_pcie0: pcie0grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SAI2_RXFS_GPIO4_IO21       0x41
+               >;
+       };
+
        pinctrl_sai3: sai3grp {
                fsl,pins = <
                        MX8MM_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC     0xd6
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-emcon-avari.dts b/arch/arm64/boot/dts/freescale/imx8mm-emcon-avari.dts
new file mode 100644 (file)
index 0000000..b2e8967
--- /dev/null
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: (GPL-2.0 or MIT)
+//
+// Copyright (c) 2021 emtrion GmbH
+// Author: Frank Erdrich <frank.erdrich@emtrion.com>
+//
+
+/dts-v1/;
+
+#include "imx8mm-emcon.dtsi"
+#include "imx8mm-emcon-avari.dtsi"
+
+/ {
+       model = "emtrion SoM emCON-MX8M mini on Avari";
+       compatible = "emtrion,emcon-mx8mm-avari", "fsl,imx8mm";
+};
+
+&lvds_backlight {
+       status = "okay";
+};
+
+&pwm1 {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-emcon-avari.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-emcon-avari.dtsi
new file mode 100644 (file)
index 0000000..5028f23
--- /dev/null
@@ -0,0 +1,139 @@
+// SPDX-License-Identifier: (GPL-2.0 or MIT)
+//
+// Copyright (C) 2021 emtrion GmbH
+// Author: Frank Erdrich <frank.erdrich@emtrion.com>
+//
+
+/ {
+       aliases {
+               boardid = &boardID;
+               mmc0 = &usdhc1;
+               mmc1 = &usdhc2;
+       };
+
+       chosen {
+               stdout-path = &uart1;
+       };
+
+       reg_wall_5p0: regulator-wall5p0 {
+               compatible = "regulator-fixed";
+               regulator-name = "Main-Supply";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               regulator-always-on;
+               regulator-boot-on;
+       };
+
+       reg_base3p3: regulator-base3p3 {
+               compatible = "regulator-fixed";
+               vin-supply = <&reg_wall_5p0>;
+               regulator-name = "3V3-avari";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               regulator-always-on;
+               regulator-boot-on;
+       };
+
+       reg_base1p5: regulator-base1p5 {
+               compatible = "regulator-fixed";
+               vin-supply = <&reg_base3p3>;
+               regulator-name = "1V5-avari";
+               regulator-min-microvolt = <1500000>;
+               regulator-max-microvolt = <1500000>;
+               regulator-always-on;
+               regulator-boot-on;
+       };
+
+       reg_usb_otg: regulator-otgvbus {
+               compatible = "regulator-fixed";
+               vin-supply = <&reg_wall_5p0>;
+               regulator-name = "OTG_VBUS";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               gpio = <&gpio1 8 GPIO_ACTIVE_LOW>;
+               regulator-always-on;
+       };
+
+       clk_codec: clock-codec {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <12000000>;
+       };
+
+       sound {
+               compatible = "simple-audio-card";
+               simple-audio-card,name = "SGTL5000-Card";
+               simple-audio-card,format = "i2s";
+               simple-audio-card,bitclock-master = <&codec_dai>;
+               simple-audio-card,frame-master = <&codec_dai>;
+               simple-audio-card,widgets = "Headphone", "Headphone Jack";
+               simple-audio-card,routing = "Headphone Jack", "HP_OUT";
+
+               cpu_dai: simple-audio-card,cpu {
+                       sound-dai = <&sai2>;
+               };
+
+               codec_dai: simple-audio-card,codec {
+                       sound-dai = <&sgtl5000>;
+               };
+       };
+};
+
+&ecspi1 {
+       status = "okay";
+};
+
+&i2c2 {
+       status = "okay";
+};
+
+&i2c1 {
+       clock-frequency = <100000>;
+       status = "okay";
+
+       sgtl5000: audio-codec@a {
+               compatible = "fsl,sgtl5000";
+               reg = <0x0a>;
+               #sound-dai-cells = <0>;
+               clocks = <&clk_codec>;
+               VDDA-supply = <&reg_base3p3>;
+               VDDIO-supply = <&reg_base3p3>;
+       };
+
+       boardID: gpio@3a {
+               compatible = "nxp,pca8574";
+               reg = <0x3a>;
+               gpio-controller;
+               #gpio-cells = <1>;
+       };
+};
+
+&sai2 {
+       status = "okay";
+};
+
+&uart2 {
+       uart-has-rtscts;
+       status = "okay";
+};
+
+&uart3 {
+       status = "okay";
+};
+
+&uart4 {
+       status = "okay";
+};
+
+&usbotg1 {
+       status = "okay";
+};
+
+&usbotg2 {
+       dr_mode = "host";
+       status = "disabled";
+};
+
+&usdhc2 {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-emcon.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-emcon.dtsi
new file mode 100644 (file)
index 0000000..7c4af71
--- /dev/null
@@ -0,0 +1,627 @@
+// SPDX-License-Identifier: (GPL-2.0 or MIT)
+//
+// Copyright 2018 NXP
+// Copyright (C) 2021 emtrion GmbH
+//
+
+/dts-v1/;
+
+#include "imx8mm.dtsi"
+
+/ {
+       chosen {
+               stdout-path = &uart1;
+       };
+
+       som_leds: leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_gpio_led>;
+
+               green {
+                       label = "som:green";
+                       gpios = <&gpio3 4 GPIO_ACTIVE_HIGH>;
+                       default-state = "on";
+                       linux,default-trigger = "heartbeat";
+               };
+
+               red {
+                       label = "som:red";
+                       gpios = <&gpio5 10 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+               };
+       };
+
+       lvds_backlight: lvds-backlight {
+               compatible = "pwm-backlight";
+               enable-gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;
+               pwms = <&pwm1 0 50000 0>;
+               brightness-levels = <
+                       0 4 8 16 32 64 80 96 112
+                       128 144 160 176 250
+               >;
+               default-brightness-level = <9>;
+               status = "disabled";
+       };
+
+       reg_usdhc1_vmmc: regulator-emmc {
+               compatible = "regulator-fixed";
+               regulator-name = "eMMC";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+       };
+
+       reg_usdhc2_vmmc: regulator-usdhc2 {
+               compatible = "regulator-fixed";
+               regulator-name = "sdcard_3V3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+       };
+};
+
+&A53_0 {
+       cpu-supply = <&buck2_reg>;
+};
+
+&ecspi1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_ecspi1 &pinctrl_ecspi1_cs>;
+       cs-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>,
+                               <&gpio5 13 GPIO_ACTIVE_LOW>;
+       status = "okay";
+};
+
+&fec1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_fec1>;
+       phy-mode = "rgmii-id";
+       phy-handle = <&ethphy0>;
+       fsl,magic-packet;
+       status = "okay";
+
+       mdio {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               ethphy0: ethernet-phy@0 {
+                       compatible = "ethernet-phy-ieee802.3-c22";
+                       reg = <0>;
+                       reset-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
+                       reset-assert-us = <10000>;
+               };
+       };
+};
+
+&flexspi {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_flexspi0>;
+       pinctrl-1 = <&pinctrl_flexspi1>;
+       status = "okay";
+
+       flash0: spi-flash@0 {
+               reg = <0>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "jedec,spi-nor";
+               spi-max-frequency = <40000000>;
+       };
+};
+
+&iomuxc {
+       pinctrl-names = "default";
+
+       pinctrl_csi_pwn: csi-pwn-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_GPIO1_IO07_GPIO1_IO7               0x19
+               >;
+       };
+
+       pinctrl_ecspi1: ecspi1-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_ECSPI1_SCLK_ECSPI1_SCLK            0x82
+                       MX8MM_IOMUXC_ECSPI1_MOSI_ECSPI1_MOSI            0x82
+                       MX8MM_IOMUXC_ECSPI1_MISO_ECSPI1_MISO            0x82
+               >;
+       };
+
+       pinctrl_ecspi1_cs: ecspi1-cs {
+               fsl,pins = <
+                       MX8MM_IOMUXC_ECSPI1_SS0_GPIO5_IO9               0x40000
+                       MX8MM_IOMUXC_ECSPI2_SS0_GPIO5_IO13              0x40000
+               >;
+       };
+
+       pinctrl_fec1: fec1-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_ENET_MDC_ENET1_MDC                         0x3
+                       MX8MM_IOMUXC_ENET_MDIO_ENET1_MDIO                       0x3
+                       MX8MM_IOMUXC_ENET_TD3_ENET1_RGMII_TD3           0x1f
+                       MX8MM_IOMUXC_ENET_TD2_ENET1_RGMII_TD2           0x1f
+                       MX8MM_IOMUXC_ENET_TD1_ENET1_RGMII_TD1           0x1f
+                       MX8MM_IOMUXC_ENET_TD0_ENET1_RGMII_TD0           0x1f
+                       MX8MM_IOMUXC_ENET_RD3_ENET1_RGMII_RD3           0x91
+                       MX8MM_IOMUXC_ENET_RD2_ENET1_RGMII_RD2           0x91
+                       MX8MM_IOMUXC_ENET_RD1_ENET1_RGMII_RD1           0x91
+                       MX8MM_IOMUXC_ENET_RD0_ENET1_RGMII_RD0           0x91
+                       MX8MM_IOMUXC_ENET_TXC_ENET1_RGMII_TXC           0x1f
+                       MX8MM_IOMUXC_ENET_RXC_ENET1_RGMII_RXC           0x91
+                       MX8MM_IOMUXC_ENET_RX_CTL_ENET1_RGMII_RX_CTL     0x91
+                       MX8MM_IOMUXC_ENET_TX_CTL_ENET1_RGMII_TX_CTL     0x1f
+                       MX8MM_IOMUXC_GPIO1_IO09_GPIO1_IO9                       0x19
+               >;
+       };
+
+       pinctrl_flexspi0: flexspi0-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_NAND_ALE_QSPI_A_SCLK               0x1c2
+                       MX8MM_IOMUXC_NAND_CE0_B_QSPI_A_SS0_B    0x82
+                       MX8MM_IOMUXC_NAND_DATA00_QSPI_A_DATA0   0x82
+                       MX8MM_IOMUXC_NAND_DATA01_QSPI_A_DATA1   0x82
+                       MX8MM_IOMUXC_NAND_DATA02_QSPI_A_DATA2   0x82
+                       MX8MM_IOMUXC_NAND_DATA03_QSPI_A_DATA3   0x82
+                       MX8MM_IOMUXC_NAND_DQS_QSPI_A_DQS                0x82
+               >;
+       };
+
+       pinctrl_flexspi1: flexspi1-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_NAND_CLE_QSPI_B_SCLK               0x1c2
+                       MX8MM_IOMUXC_NAND_CE2_B_QSPI_B_SS0_B    0x82
+                       MX8MM_IOMUXC_NAND_DATA04_QSPI_B_DATA0   0x82
+                       MX8MM_IOMUXC_NAND_DATA05_QSPI_B_DATA1   0x82
+                       MX8MM_IOMUXC_NAND_DATA06_QSPI_B_DATA2   0x82
+                       MX8MM_IOMUXC_NAND_DATA07_QSPI_B_DATA3   0x82
+               >;
+       };
+
+       pinctrl_gpio_led: gpio-led-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_ECSPI2_SCLK_GPIO5_IO10             0x19
+                       MX8MM_IOMUXC_NAND_CE3_B_GPIO3_IO4               0x19
+               >;
+       };
+
+       pinctrl_i2c1: i2c1-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_I2C1_SCL_I2C1_SCL                  0x400001c3
+                       MX8MM_IOMUXC_I2C1_SDA_I2C1_SDA                  0x400001c3
+               >;
+       };
+
+       pinctrl_i2c2: i2c2grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_I2C2_SCL_I2C2_SCL                  0x400001c3
+                       MX8MM_IOMUXC_I2C2_SDA_I2C2_SDA                  0x400001c3
+               >;
+       };
+
+       pinctrl_i2c3: i2c3-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_I2C3_SCL_I2C3_SCL                  0x400001c3
+                       MX8MM_IOMUXC_I2C3_SDA_I2C3_SDA                  0x400001c3
+               >;
+       };
+
+       pinctrl_lvds: lvds-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SAI5_MCLK_GPIO3_IO25               0x06
+               >;
+       };
+
+       pinctrl_pcie0: pcie0-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SAI5_RXC_GPIO3_IO20                0x41
+                       MX8MM_IOMUXC_SAI5_RXFS_GPIO3_IO19               0x41
+               >;
+       };
+
+       pinctrl_pmic: pmic-irq {
+               fsl,pins = <
+                       MX8MM_IOMUXC_NAND_CE1_B_GPIO3_IO2               0x41
+               >;
+       };
+
+       pinctrl_pwm1: pwm1-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_GPIO1_IO01_PWM1_OUT                0x06
+               >;
+       };
+
+       pinctrl_sai2: sai2-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SAI2_MCLK_SAI2_MCLK                0xd6
+                       MX8MM_IOMUXC_SAI2_RXC_SAI2_RX_BCLK              0xd6
+                       MX8MM_IOMUXC_SAI2_RXD0_SAI2_RX_DATA0    0xd6
+                       MX8MM_IOMUXC_SAI2_RXFS_SAI2_RX_SYNC             0xd6
+                       MX8MM_IOMUXC_SAI2_TXC_SAI2_TX_BCLK              0xd6
+                       MX8MM_IOMUXC_SAI2_TXD0_SAI2_TX_DATA0    0xd6
+                       MX8MM_IOMUXC_SAI2_TXFS_SAI2_TX_SYNC             0xd6
+               >;
+       };
+
+       pinctrl_spdif1: spdif1-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SPDIF_TX_SPDIF1_OUT                0xd6
+                       MX8MM_IOMUXC_SPDIF_RX_SPDIF1_IN                 0xd6
+               >;
+       };
+
+       pinctrl_uart1: uart1-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_UART1_RXD_UART1_DCE_RX             0x140
+                       MX8MM_IOMUXC_UART1_TXD_UART1_DCE_TX             0x140
+               >;
+       };
+
+       pinctrl_uart2: uart2-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_UART2_RXD_UART2_DCE_RX             0x140
+                       MX8MM_IOMUXC_UART2_TXD_UART2_DCE_TX             0x140
+
+                       /* rts and cts */
+                       MX8MM_IOMUXC_SAI3_RXC_UART2_DCE_CTS_B   0x140
+                       MX8MM_IOMUXC_SAI3_RXD_UART2_DCE_RTS_B   0x140
+               >;
+       };
+
+       pinctrl_uart3: uart3-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_UART3_RXD_UART3_DCE_RX             0x140
+                       MX8MM_IOMUXC_UART3_TXD_UART3_DCE_TX             0x140
+               >;
+       };
+
+       pinctrl_uart4: uart4-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_UART4_RXD_UART4_DCE_RX             0x140
+                       MX8MM_IOMUXC_UART4_TXD_UART4_DCE_TX             0x140
+               >;
+       };
+
+       pinctrl_usdhc1: usdhc1-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SD1_CLK_USDHC1_CLK                 0x190
+                       MX8MM_IOMUXC_SD1_CMD_USDHC1_CMD                 0x1d0
+                       MX8MM_IOMUXC_SD1_DATA0_USDHC1_DATA0             0x1d0
+                       MX8MM_IOMUXC_SD1_DATA1_USDHC1_DATA1             0x1d0
+                       MX8MM_IOMUXC_SD1_DATA2_USDHC1_DATA2             0x1d0
+                       MX8MM_IOMUXC_SD1_DATA3_USDHC1_DATA3             0x1d0
+                       MX8MM_IOMUXC_SD1_DATA4_USDHC1_DATA4             0x1d0
+                       MX8MM_IOMUXC_SD1_DATA5_USDHC1_DATA5             0x1d0
+                       MX8MM_IOMUXC_SD1_DATA6_USDHC1_DATA6             0x1d0
+                       MX8MM_IOMUXC_SD1_DATA7_USDHC1_DATA7             0x1d0
+               >;
+       };
+
+       pinctrl_usdhc1_100mhz: usdhc1-100mhz-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SD1_CLK_USDHC1_CLK                 0x194
+                       MX8MM_IOMUXC_SD1_CMD_USDHC1_CMD                 0x1d4
+                       MX8MM_IOMUXC_SD1_DATA0_USDHC1_DATA0             0x1d4
+                       MX8MM_IOMUXC_SD1_DATA1_USDHC1_DATA1             0x1d4
+                       MX8MM_IOMUXC_SD1_DATA2_USDHC1_DATA2             0x1d4
+                       MX8MM_IOMUXC_SD1_DATA3_USDHC1_DATA3             0x1d4
+                       MX8MM_IOMUXC_SD1_DATA4_USDHC1_DATA4             0x1d4
+                       MX8MM_IOMUXC_SD1_DATA5_USDHC1_DATA5             0x1d4
+                       MX8MM_IOMUXC_SD1_DATA6_USDHC1_DATA6             0x1d4
+                       MX8MM_IOMUXC_SD1_DATA7_USDHC1_DATA7             0x1d4
+               >;
+       };
+
+       pinctrl_usdhc1_200mhz: usdhc1-200mhz-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SD1_CLK_USDHC1_CLK                 0x196
+                       MX8MM_IOMUXC_SD1_CMD_USDHC1_CMD                 0x1d6
+                       MX8MM_IOMUXC_SD1_DATA0_USDHC1_DATA0             0x1d6
+                       MX8MM_IOMUXC_SD1_DATA1_USDHC1_DATA1             0x1d6
+                       MX8MM_IOMUXC_SD1_DATA2_USDHC1_DATA2             0x1d6
+                       MX8MM_IOMUXC_SD1_DATA3_USDHC1_DATA3             0x1d6
+                       MX8MM_IOMUXC_SD1_DATA4_USDHC1_DATA4             0x1d6
+                       MX8MM_IOMUXC_SD1_DATA5_USDHC1_DATA5             0x1d6
+                       MX8MM_IOMUXC_SD1_DATA6_USDHC1_DATA6             0x1d6
+                       MX8MM_IOMUXC_SD1_DATA7_USDHC1_DATA7             0x1d6
+               >;
+       };
+
+       pinctrl_usdhc1_gpio: usdhc1-gpio-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SD1_RESET_B_USDHC1_RESET_B 0x41
+                       MX8MM_IOMUXC_GPIO1_IO03_GPIO1_IO3               0x1c4
+               >;
+       };
+
+       pinctrl_usdhc2: usdhc2-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK                 0x190
+                       MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD                 0x1d0
+                       MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0             0x1d0
+                       MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1             0x1d0
+                       MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2             0x1d0
+                       MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3             0x1d0
+                       MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT  0x1d0
+               >;
+       };
+
+       pinctrl_usdhc2_100mhz: usdhc2-100mhz-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK                 0x194
+                       MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD                 0x1d4
+                       MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0             0x1d4
+                       MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1             0x1d4
+                       MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2             0x1d4
+                       MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3             0x1d4
+                       MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT  0x1d0
+               >;
+       };
+
+       pinctrl_usdhc2_200mhz: usdhc2-200mhz-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK                 0x196
+                       MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD                 0x1d6
+                       MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0             0x1d6
+                       MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1             0x1d6
+                       MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2             0x1d6
+                       MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3             0x1d6
+                       MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT  0x1d0
+               >;
+       };
+
+       /* no reset for sdhc2 interface */
+       pinctrl_usdhc2_gpio: usdhc2-gpio-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12                0x1c4
+                       MX8MM_IOMUXC_SD2_WP_USDHC2_WP                   0x1c4
+               >;
+       };
+
+       pinctrl_wdog: wdog-grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B    0xc6
+               >;
+       };
+};
+
+&i2c1 {
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c1>;
+       status = "okay";
+};
+
+&i2c2 {
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c2>;
+       status = "okay";
+};
+
+&i2c3 {
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c3>;
+       status = "okay";
+
+       bd71847: pmic@4b {
+               compatible = "rohm,bd71847";
+               reg = <0x4b>;
+               pinctrl-0 = <&pinctrl_pmic>;
+               interrupt-parent = <&gpio3>;
+               interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
+               rohm,reset-snvs-powered;
+
+               regulators {
+                       buck1_reg: BUCK1 {
+                               regulator-name = "BUCK1";
+                               regulator-min-microvolt = <700000>;
+                               regulator-max-microvolt = <1300000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                               regulator-ramp-delay = <1250>;
+                       };
+
+                       buck2_reg: BUCK2 {
+                               regulator-name = "BUCK2";
+                               regulator-min-microvolt = <700000>;
+                               regulator-max-microvolt = <1300000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                               regulator-ramp-delay = <1250>;
+                               rohm,dvs-run-voltage = <1000000>;
+                               rohm,dvs-idle-voltage = <900000>;
+                       };
+
+                       buck3_reg: BUCK3 {
+                               // BUCK5 in datasheet
+                               regulator-name = "BUCK3";
+                               regulator-min-microvolt = <700000>;
+                               regulator-max-microvolt = <1350000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       buck4_reg: BUCK4 {
+                               // BUCK6 in datasheet
+                               regulator-name = "BUCK4";
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       buck5_reg: BUCK5 {
+                               // BUCK7 in datasheet
+                               regulator-name = "BUCK5";
+                               regulator-min-microvolt = <1605000>;
+                               regulator-max-microvolt = <1995000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       buck6_reg: BUCK6 {
+                               // BUCK8 in datasheet
+                               regulator-name = "BUCK6";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1400000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       ldo1_reg: LDO1 {
+                               regulator-name = "LDO1";
+                               regulator-min-microvolt = <1600000>;
+                               regulator-max-microvolt = <1900000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       ldo2_reg: LDO2 {
+                               regulator-name = "LDO2";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <900000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       ldo3_reg: LDO3 {
+                               regulator-name = "LDO3";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       ldo4_reg: LDO4 {
+                               regulator-name = "LDO4";
+                               regulator-min-microvolt = <900000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       ldo6_reg: LDO6 {
+                               regulator-name = "LDO6";
+                               regulator-min-microvolt = <900000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+               };
+       };
+
+       rv1805: rtc@69 {
+               compatible = "abracon,ab1805";
+               reg = <0x69>;
+       };
+};
+
+&mu {
+       status = "okay";
+};
+
+&pwm1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pwm1>;
+};
+
+&sai2 {
+       #sound-dai-cells = <0>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_sai2>;
+       assigned-clocks = <&clk IMX8MM_CLK_SAI2>;
+       assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
+       assigned-clock-rates = <12000000>;
+       status = "disabled";
+};
+
+&spdif1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_spdif1>;
+       assigned-clocks = <&clk IMX8MM_CLK_SPDIF1>;
+       assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
+       assigned-clock-rates = <24576000>;
+       clocks = <&clk IMX8MM_CLK_AUDIO_AHB>, <&clk IMX8MM_CLK_24M>,
+               <&clk IMX8MM_CLK_SPDIF1>, <&clk IMX8MM_CLK_DUMMY>,
+               <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>,
+               <&clk IMX8MM_CLK_AUDIO_AHB>, <&clk IMX8MM_CLK_DUMMY>,
+               <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>,
+               <&clk IMX8MM_AUDIO_PLL1_OUT>, <&clk IMX8MM_AUDIO_PLL2_OUT>;
+       clock-names = "core", "rxtx0", "rxtx1", "rxtx2", "rxtx3",
+               "rxtx4", "rxtx5", "rxtx6", "rxtx7", "spba", "pll8k", "pll11k";
+       status = "disabled";
+};
+
+&uart1 { /* console */
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart1>;
+       assigned-clocks = <&clk IMX8MM_CLK_UART1>;
+       assigned-clock-parents = <&clk IMX8MM_SYS_PLL1_80M>;
+       status = "okay";
+};
+
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart2>;
+       assigned-clocks = <&clk IMX8MM_CLK_UART2>;
+       assigned-clock-parents = <&clk IMX8MM_SYS_PLL1_80M>;
+       status = "okay";
+};
+
+&uart3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart3>;
+       assigned-clocks = <&clk IMX8MM_CLK_UART3>;
+       assigned-clock-parents = <&clk IMX8MM_SYS_PLL1_80M>;
+       status = "okay";
+};
+
+&uart4 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart4>;
+       assigned-clocks = <&clk IMX8MM_CLK_UART4>;
+       assigned-clock-parents = <&clk IMX8MM_SYS_PLL1_80M>;
+       status = "okay";
+};
+
+&usbotg1 {
+       dr_mode = "otg";
+       over-current-active-low;
+       status = "okay";
+};
+
+&usbotg2 {
+       dr_mode = "host";
+       disable-over-current;
+       status = "disabled";
+};
+
+&usdhc1 {
+       pinctrl-names = "default", "state_100mhz", "state_200mhz";
+       pinctrl-0 = <&pinctrl_usdhc1>, <&pinctrl_usdhc1_gpio>;
+       pinctrl-1 = <&pinctrl_usdhc1_100mhz>, <&pinctrl_usdhc1_gpio>;
+       pinctrl-2 = <&pinctrl_usdhc1_200mhz>, <&pinctrl_usdhc1_gpio>;
+       bus-width = <8>;
+       vmmc-supply = <&reg_usdhc1_vmmc>;
+       keep-power-in-suspend;
+       non-removable;
+       status = "okay";
+};
+
+&usdhc2 {
+       pinctrl-names = "default", "state_100mhz", "state_200mhz";
+       pinctrl-0 = <&pinctrl_usdhc2>, <&pinctrl_usdhc2_gpio>;
+       pinctrl-1 = <&pinctrl_usdhc2_100mhz>, <&pinctrl_usdhc2_gpio>;
+       pinctrl-2 = <&pinctrl_usdhc2_200mhz>, <&pinctrl_usdhc2_gpio>;
+       cd-gpios = <&gpio2 12 GPIO_ACTIVE_LOW>;
+       wp-gpios = <&gpio2 20 GPIO_ACTIVE_HIGH>;
+       bus-width = <4>;
+       vmmc-supply = <&reg_usdhc2_vmmc>;
+       no-1-8-v;
+       status = "okay";
+};
+
+&wdog1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_wdog>;
+       fsl,ext-reset-output;
+       status = "okay";
+};
index 3bac87b..6d67df7 100644 (file)
@@ -5,6 +5,7 @@
 
 /dts-v1/;
 
+#include <dt-bindings/phy/phy-imx8-pcie.h>
 #include <dt-bindings/usb/pd.h>
 #include "imx8mm.dtsi"
 
                };
        };
 
+       pcie0_refclk: pcie0-refclk {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <100000000>;
+       };
+
+       reg_pcie0: regulator-pcie {
+               compatible = "regulator-fixed";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_pcie0_reg>;
+               regulator-name = "MPCIE_3V3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               gpio = <&gpio1 5 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+       };
+
        reg_usdhc2_vmmc: regulator-usdhc2 {
                compatible = "regulator-fixed";
                pinctrl-names = "default";
        };
 };
 
+&pcie_phy {
+       fsl,refclk-pad-mode = <IMX8_PCIE_REFCLK_PAD_INPUT>;
+       fsl,tx-deemph-gen1 = <0x2d>;
+       fsl,tx-deemph-gen2 = <0xf>;
+       clocks = <&pcie0_refclk>;
+       status = "okay";
+};
+
+&pcie0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pcie0>;
+       reset-gpio = <&gpio4 21 GPIO_ACTIVE_LOW>;
+       clocks = <&clk IMX8MM_CLK_PCIE1_ROOT>, <&clk IMX8MM_CLK_PCIE1_AUX>,
+                <&pcie0_refclk>;
+       clock-names = "pcie", "pcie_aux", "pcie_bus";
+       assigned-clocks = <&clk IMX8MM_CLK_PCIE1_AUX>,
+                         <&clk IMX8MM_CLK_PCIE1_CTRL>;
+       assigned-clock-rates = <10000000>, <250000000>;
+       assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_50M>,
+                                <&clk IMX8MM_SYS_PLL2_250M>;
+       vpcie-supply = <&reg_pcie0>;
+       status = "okay";
+};
+
 &sai3 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_sai3>;
                >;
        };
 
+       pinctrl_pcie0: pcie0grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_I2C4_SCL_PCIE1_CLKREQ_B    0x61
+                       MX8MM_IOMUXC_SAI2_RXFS_GPIO4_IO21       0x41
+               >;
+       };
+
+       pinctrl_pcie0_reg: pcie0reggrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_GPIO1_IO05_GPIO1_IO5       0x41
+               >;
+       };
+
        pinctrl_pmic: pmicirqgrp {
                fsl,pins = <
                        MX8MM_IOMUXC_GPIO1_IO03_GPIO1_IO3               0x141
index a003e6a..83c8f71 100644 (file)
 #define MX8MM_IOMUXC_NAND_RE_B_GPIO3_IO15                                   0x130 0x398 0x000 0x5 0x0
 #define MX8MM_IOMUXC_NAND_RE_B_SIM_M_HADDR11                                0x130 0x398 0x000 0x7 0x0
 #define MX8MM_IOMUXC_NAND_READY_B_RAWNAND_READY_B                           0x134 0x39C 0x000 0x0 0x0
+#define MX8MM_IOMUXC_NAND_READY_B_SD3_RESET_B                               0x134 0x39C 0x000 0x2 0x0
 #define MX8MM_IOMUXC_NAND_READY_B_GPIO3_IO16                                0x134 0x39C 0x000 0x5 0x0
 #define MX8MM_IOMUXC_NAND_READY_B_SIM_M_HADDR12                             0x134 0x39C 0x000 0x7 0x0
 #define MX8MM_IOMUXC_NAND_WE_B_RAWNAND_WE_B                                 0x138 0x3A0 0x000 0x0 0x0
 #define MX8MM_IOMUXC_SAI5_RXD2_SAI1_TX_DATA4                                0x150 0x3B8 0x000 0x1 0x0
 #define MX8MM_IOMUXC_SAI5_RXD2_SAI1_TX_SYNC                                 0x150 0x3B8 0x4CC 0x2 0x1
 #define MX8MM_IOMUXC_SAI5_RXD2_SAI5_TX_BCLK                                 0x150 0x3B8 0x4E8 0x3 0x0
-#define MX8MM_IOMUXC_SAI5_RXD2_PDM_DATA2                                    0x150 0x3B8 0x53c 0x4 0x0
+#define MX8MM_IOMUXC_SAI5_RXD2_PDM_DATA2                                    0x150 0x3B8 0x53C 0x4 0x0
 #define MX8MM_IOMUXC_SAI5_RXD2_GPIO3_IO23                                   0x150 0x3B8 0x000 0x5 0x0
 #define MX8MM_IOMUXC_SAI5_RXD3_SAI5_RX_DATA3                                0x154 0x3BC 0x4E0 0x0 0x0
 #define MX8MM_IOMUXC_SAI5_RXD3_SAI1_TX_DATA5                                0x154 0x3BC 0x000 0x1 0x0
 #define MX8MM_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC                                 0x1D8 0x440 0x000 0x0 0x0
 #define MX8MM_IOMUXC_SAI3_TXFS_GPT1_CAPTURE2                                0x1D8 0x440 0x000 0x1 0x0
 #define MX8MM_IOMUXC_SAI3_TXFS_SAI5_RX_DATA1                                0x1D8 0x440 0x4D8 0x2 0x2
-#define MX8MM_IOMUXC_SAI3_TXFS_UART2_DCE_RX                                 0x1D8 0x440 0x4Fc 0x4 0x2
+#define MX8MM_IOMUXC_SAI3_TXFS_UART2_DCE_RX                                 0x1D8 0x440 0x4FC 0x4 0x2
 #define MX8MM_IOMUXC_SAI3_TXFS_UART2_DTE_TX                                 0x1D8 0x440 0x000 0x4 0x0
 #define MX8MM_IOMUXC_SAI3_TXFS_GPIO4_IO31                                   0x1D8 0x440 0x000 0x5 0x0
 #define MX8MM_IOMUXC_SAI3_TXFS_TPSMP_HDATA1                                 0x1D8 0x440 0x000 0x7 0x0
 #define MX8MM_IOMUXC_SAI3_TXC_GPT1_COMPARE2                                 0x1DC 0x444 0x000 0x1 0x0
 #define MX8MM_IOMUXC_SAI3_TXC_SAI5_RX_DATA2                                 0x1DC 0x444 0x4DC 0x2 0x2
 #define MX8MM_IOMUXC_SAI3_TXC_UART2_DCE_TX                                  0x1DC 0x444 0x000 0x4 0x0
-#define MX8MM_IOMUXC_SAI3_TXC_UART2_DTE_RX                                  0x1DC 0x444 0x4Fc 0x4 0x3
+#define MX8MM_IOMUXC_SAI3_TXC_UART2_DTE_RX                                  0x1DC 0x444 0x4FC 0x4 0x3
 #define MX8MM_IOMUXC_SAI3_TXC_GPIO5_IO0                                     0x1DC 0x444 0x000 0x5 0x0
 #define MX8MM_IOMUXC_SAI3_TXC_TPSMP_HDATA2                                  0x1DC 0x444 0x000 0x7 0x0
 #define MX8MM_IOMUXC_SAI3_TXD_SAI3_TX_DATA0                                 0x1E0 0x448 0x000 0x0 0x0
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-prt8mm.dts b/arch/arm64/boot/dts/freescale/imx8mm-prt8mm.dts
new file mode 100644 (file)
index 0000000..9fbbbb5
--- /dev/null
@@ -0,0 +1,304 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2020 Protonic Holland
+ * Copyright 2019 NXP
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/usb/pd.h>
+#include "imx8mm.dtsi"
+
+/ {
+       model = "Protonic PRT8MM";
+       compatible = "prt,prt8mm", "fsl,imx8mm";
+
+       chosen {
+               stdout-path = &uart4;
+       };
+
+       memory@40000000 {
+               device_type = "memory";
+               reg = <0x0 0x40000000 0 0x40000000>;
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_gpio_leds>;
+
+               debug-led0 {
+                       label = "DEBUG_LED0";
+                       gpios = <&gpio3 0 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "heartbeat";
+               };
+
+               debug-led1 {
+                       label = "DEBUG_LED1";
+                       gpios = <&gpio3 1 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "cpu";
+               };
+       };
+
+       sound-ssm2518 {
+               compatible = "simple-audio-card";
+               simple-audio-card,name = "ssm2518-audio";
+               simple-audio-card,format = "i2s";
+               simple-audio-card,frame-master = <&cpudai>;
+               simple-audio-card,bitclock-master = <&cpudai>;
+
+               cpudai: simple-audio-card,cpu {
+                       sound-dai = <&sai3>;
+               };
+
+               simple-audio-card,codec {
+                       sound-dai = <&ssm2518>;
+                       clocks = <&clk IMX8MM_CLK_SAI3_ROOT>;
+               };
+       };
+};
+
+&i2c1 {
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c1>;
+       status = "okay";
+
+       ssm2518: audio-codec@34 {
+               compatible = "adi,ssm2518";
+               reg = <0x34>;
+               #sound-dai-cells = <0>;
+       };
+};
+
+&i2c2 {
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c2>;
+       status = "okay";
+
+       regulator@60 {
+               compatible = "fcs,fan53555";
+               reg = <0x60>;
+               regulator-name = "0V9_CORE";
+               regulator-min-microvolt = <900000>;
+               regulator-max-microvolt = <980000>;
+               regulator-boot-on;
+               regulator-always-on;
+       };
+};
+
+&i2c3 {
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c3>;
+       status = "okay";
+
+       rtc@51 {
+               compatible = "nxp,pcf85363";
+               reg = <0x51>;
+       };
+
+       touchscreeen@5d {
+               compatible = "goodix,gt911";
+               reg = <0x5d>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_touchscreen>;
+               interrupt-parent = <&gpio1>;
+               interrupts = <8 IRQ_TYPE_NONE>;
+               irq-gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
+               reset-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
+       };
+
+       temp-sense@70 {
+               compatible = "ti,tmp103";
+               reg = <0x70>;
+       };
+};
+
+&sai3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_sai3>;
+       assigned-clocks = <&clk IMX8MM_CLK_SAI3>;
+       assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
+       assigned-clock-rates = <12288000>;
+       fsl,sai-mclk-direction-output;
+       fsl,sai-asynchronous;
+       status = "okay";
+};
+
+&snvs_pwrkey {
+       status = "okay";
+};
+
+&uart4 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart4>;
+       status = "okay";
+};
+
+&usbotg1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usbotg1>;
+       dr_mode = "host";
+       disable-over-current;
+       power-active-high;
+       status = "okay";
+};
+
+&usdhc2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usdhc2>;
+       assigned-clocks = <&clk IMX8MM_CLK_USDHC2>;
+       assigned-clock-rates = <100000000>;
+       cd-gpios = <&gpio2 12 GPIO_ACTIVE_LOW>;
+       bus-width = <4>;
+       status = "okay";
+};
+
+&usdhc3 {
+       pinctrl-names = "default", "state_100mhz", "state_200mhz";
+       pinctrl-0 = <&pinctrl_usdhc3>;
+       pinctrl-1 = <&pinctrl_usdhc3_100mhz>;
+       pinctrl-2 = <&pinctrl_usdhc3_200mhz>;
+       assigned-clocks = <&clk IMX8MM_CLK_USDHC3_ROOT>;
+       assigned-clock-rates = <400000000>;
+       bus-width = <8>;
+       non-removable;
+       no-sdio;
+       no-sd;
+       status = "okay";
+};
+
+&wdog1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_wdog>;
+       fsl,ext-reset-output;
+       status = "okay";
+};
+
+&iomuxc {
+       pinctrl_gpio_leds: ledsgrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_NAND_ALE_GPIO3_IO0                 0x00
+                       MX8MM_IOMUXC_NAND_CE0_B_GPIO3_IO1               0x00
+               >;
+       };
+
+       pinctrl_i2c1: i2c1grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_I2C1_SCL_I2C1_SCL                  0x400000c3
+                       MX8MM_IOMUXC_I2C1_SDA_I2C1_SDA                  0x400000c3
+               >;
+       };
+
+       pinctrl_i2c2: i2c2grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_I2C2_SCL_I2C2_SCL                  0x400000c3
+                       MX8MM_IOMUXC_I2C2_SDA_I2C2_SDA                  0x400000c3
+               >;
+       };
+
+       pinctrl_i2c3: i2c3grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_I2C3_SCL_I2C3_SCL                  0x400000c3
+                       MX8MM_IOMUXC_I2C3_SDA_I2C3_SDA                  0x400000c3
+               >;
+       };
+
+       pinctrl_sai3: sai3grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC             0xd6
+                       MX8MM_IOMUXC_SAI3_TXC_SAI3_TX_BCLK              0xd6
+                       MX8MM_IOMUXC_SAI3_MCLK_SAI3_MCLK                0xd6
+                       MX8MM_IOMUXC_SAI3_TXD_SAI3_TX_DATA0             0xd6
+               >;
+       };
+
+       pinctrl_touchscreen: tsgrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_GPIO1_IO08_GPIO1_IO8               0x80
+                       MX8MM_IOMUXC_GPIO1_IO09_GPIO1_IO9               0x80
+               >;
+       };
+
+       pinctrl_uart4: uart4grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_UART4_RXD_UART4_DCE_RX             0x040
+                       MX8MM_IOMUXC_UART4_TXD_UART4_DCE_TX             0x040
+               >;
+       };
+
+       pinctrl_usbotg1: usbotg1grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_GPIO1_IO12_USB1_OTG_PWR            0x000
+                       MX8MM_IOMUXC_GPIO1_IO13_USB1_OTG_OC             0x000
+               >;
+       };
+
+       pinctrl_usdhc2: usdhc2grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK                 0x190
+                       MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD                 0x1d0
+                       MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0             0x1d0
+                       MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1             0x1d0
+                       MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2             0x1d0
+                       MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3             0x1d0
+                       MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12                0x0d4
+               >;
+       };
+
+       pinctrl_usdhc3: usdhc3grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK               0x190
+                       MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD               0x1d0
+                       MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0           0x1d0
+                       MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1           0x1d0
+                       MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2           0x1d0
+                       MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3           0x1d0
+                       MX8MM_IOMUXC_NAND_RE_B_USDHC3_DATA4             0x1d0
+                       MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5            0x1d0
+                       MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6            0x1d0
+                       MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7              0x1d0
+                       MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE           0x190
+               >;
+       };
+
+       pinctrl_usdhc3_100mhz: usdhc3grp100mhz {
+               fsl,pins = <
+                       MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK               0x194
+                       MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD               0x1d4
+                       MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0           0x1d4
+                       MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1           0x1d4
+                       MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2           0x1d4
+                       MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3           0x1d4
+                       MX8MM_IOMUXC_NAND_RE_B_USDHC3_DATA4             0x1d4
+                       MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5            0x1d4
+                       MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6            0x1d4
+                       MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7              0x1d4
+                       MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE           0x194
+               >;
+       };
+
+       pinctrl_usdhc3_200mhz: usdhc3grp200mhz {
+               fsl,pins = <
+                       MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK               0x196
+                       MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD               0x1d6
+                       MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0           0x1d6
+                       MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1           0x1d6
+                       MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2           0x1d6
+                       MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3           0x1d6
+                       MX8MM_IOMUXC_NAND_RE_B_USDHC3_DATA4             0x1d6
+                       MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5            0x1d6
+                       MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6            0x1d6
+                       MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7              0x1d6
+                       MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE           0x196
+               >;
+       };
+
+       pinctrl_wdog: wdoggrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B            0xc6
+               >;
+       };
+};
index 7844878..286d2df 100644 (file)
@@ -5,6 +5,7 @@
 
 /dts-v1/;
 
+#include <dt-bindings/phy/phy-imx8-pcie.h>
 #include "imx8mm-tqma8mqml.dtsi"
 #include "mba8mx.dtsi"
 
        };
 };
 
+&pcie_phy {
+       clocks = <&pcie0_refclk>;
+       status = "okay";
+};
+
+&pcie0 {
+       reset-gpio = <&expander0 14 GPIO_ACTIVE_LOW>;
+       clocks = <&clk IMX8MM_CLK_PCIE1_ROOT>, <&clk IMX8MM_CLK_PCIE1_AUX>,
+               <&pcie0_refclk>;
+       clock-names = "pcie", "pcie_aux", "pcie_bus";
+       assigned-clocks = <&clk IMX8MM_CLK_PCIE1_AUX>,
+                               <&clk IMX8MM_CLK_PCIE1_CTRL>;
+       assigned-clock-rates = <10000000>, <250000000>;
+       assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_50M>,
+                               <&clk IMX8MM_SYS_PLL2_250M>;
+       status = "okay";
+};
+
 &sai3 {
        assigned-clocks = <&clk IMX8MM_CLK_SAI3>;
        assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
index 284e62a..16ee9b5 100644 (file)
        };
 };
 
+&pcie_phy {
+       fsl,refclk-pad-mode = <IMX8_PCIE_REFCLK_PAD_INPUT>;
+       fsl,clkreq-unsupported;
+};
+
 &usdhc3 {
        pinctrl-names = "default", "state_100mhz", "state_200mhz";
        pinctrl-0 = <&pinctrl_usdhc3>;
index 2801227..73addc0 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/leds/common.h>
+#include <dt-bindings/phy/phy-imx8-pcie.h>
 
 / {
        aliases {
                };
        };
 
+       pcie0_refclk: pcie0-refclk {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <100000000>;
+       };
+
        pps {
                compatible = "pps-gpio";
                pinctrl-names = "default";
        status = "okay";
 };
 
+&gpio1 {
+       gpio-line-names = "", "", "", "", "", "", "pci_usb_sel", "dio0",
+               "", "dio1", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "";
+};
+
+&gpio4 {
+       gpio-line-names = "", "", "", "dio2", "dio3", "", "", "pci_wdis#",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "";
+};
+
 &i2c2 {
        clock-frequency = <400000>;
        pinctrl-names = "default";
        status = "okay";
 };
 
+&pcie_phy {
+       fsl,refclk-pad-mode = <IMX8_PCIE_REFCLK_PAD_INPUT>;
+       fsl,clkreq-unsupported;
+       clocks = <&pcie0_refclk>;
+       status = "okay";
+};
+
+&pcie0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pcie0>;
+       reset-gpio = <&gpio4 6 GPIO_ACTIVE_LOW>;
+       clocks = <&clk IMX8MM_CLK_PCIE1_ROOT>, <&clk IMX8MM_CLK_PCIE1_AUX>,
+                <&pcie0_refclk>;
+       clock-names = "pcie", "pcie_aux", "pcie_bus";
+       assigned-clocks = <&clk IMX8MM_CLK_PCIE1_AUX>,
+                         <&clk IMX8MM_CLK_PCIE1_CTRL>;
+       assigned-clock-rates = <10000000>, <250000000>;
+       assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_50M>,
+                                <&clk IMX8MM_SYS_PLL2_250M>;
+       status = "okay";
+};
+
 /* GPS */
 &uart1 {
        pinctrl-names = "default";
                >;
        };
 
+       pinctrl_pcie0: pcie0grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SAI1_RXD4_GPIO4_IO6        0x41
+               >;
+       };
+
        pinctrl_pps: ppsgrp {
                fsl,pins = <
                        MX8MM_IOMUXC_GPIO1_IO15_GPIO1_IO15      0x41
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx-0x-imx219.dts b/arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx-0x-imx219.dts
new file mode 100644 (file)
index 0000000..4eaf8aa
--- /dev/null
@@ -0,0 +1,93 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Gateworks Corporation
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+
+#include "imx8mm-pinfunc.h"
+
+/dts-v1/;
+/plugin/;
+
+&{/} {
+       compatible = "gw,imx8mm-gw72xx-0x", "fsl,imx8mm";
+
+       reg_cam: regulator-cam {
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_reg_cam>;
+               compatible = "regulator-fixed";
+               regulator-name = "reg_cam";
+               gpio = <&gpio1 1 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+       };
+
+       cam24m: cam24m {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <24000000>;
+               clock-output-names = "cam24m";
+       };
+};
+
+&csi {
+       status = "okay";
+};
+
+&i2c3 {
+       #address-cells = <1>;
+       #size-cells = <0>;
+
+       imx219: sensor@10 {
+               compatible = "sony,imx219";
+               reg = <0x10>;
+               clocks = <&cam24m>;
+               VDIG-supply = <&reg_cam>;
+
+               port {
+                       /* MIPI CSI-2 bus endpoint */
+                       imx219_to_mipi_csi2: endpoint {
+                               remote-endpoint = <&imx8mm_mipi_csi_in>;
+                               clock-lanes = <0>;
+                               data-lanes = <1 2>;
+                               link-frequencies = /bits/ 64 <456000000>;
+                       };
+               };
+       };
+};
+
+&mipi_csi {
+       status = "okay";
+
+       ports {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               port@0 {
+                       reg = <0>;
+
+                       imx8mm_mipi_csi_in: endpoint {
+                               remote-endpoint = <&imx219_to_mipi_csi2>;
+                               data-lanes = <1 2>;
+                       };
+               };
+
+               port@1 {
+                       reg = <1>;
+
+                       imx8mm_mipi_csi_out: endpoint {
+                               remote-endpoint = <&csi_in>;
+                       };
+               };
+       };
+};
+
+&iomuxc {
+       pinctrl_reg_cam: regcamgrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_GPIO1_IO01_GPIO1_IO1       0x41
+               >;
+       };
+};
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx-0x-rs232-rts.dts b/arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx-0x-rs232-rts.dts
new file mode 100644 (file)
index 0000000..3ea73a6
--- /dev/null
@@ -0,0 +1,53 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Gateworks Corporation
+ *
+ * GW72xx RS232 with RTS/CTS hardware flow control:
+ *  - GPIO4_0 rs485_en needs to be driven low (in-active)
+ *  - UART4_TX becomes RTS
+ *  - UART4_RX becomes CTS
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+
+#include "imx8mm-pinfunc.h"
+
+/dts-v1/;
+/plugin/;
+
+&{/} {
+       compatible = "gw,imx8mm-gw72xx-0x";
+};
+
+&gpio4 {
+       rs485_en {
+               gpio-hog;
+               gpios = <0 GPIO_ACTIVE_HIGH>;
+               output-low;
+               line-name = "rs485_en";
+       };
+};
+
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart2>;
+       rts-gpios = <&gpio5 29 GPIO_ACTIVE_LOW>;
+       cts-gpios = <&gpio5 28 GPIO_ACTIVE_LOW>;
+       uart-has-rtscts;
+       status = "okay";
+};
+
+&uart4 {
+       status = "disabled";
+};
+
+&iomuxc {
+       pinctrl_uart2: uart2grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_UART2_RXD_UART2_DCE_RX     0x140
+                       MX8MM_IOMUXC_UART2_TXD_UART2_DCE_TX     0x140
+                       MX8MM_IOMUXC_UART4_TXD_GPIO5_IO29       0x140
+                       MX8MM_IOMUXC_UART4_RXD_GPIO5_IO28       0x140
+               >;
+       };
+};
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx-0x-rs422.dts b/arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx-0x-rs422.dts
new file mode 100644 (file)
index 0000000..c3cd9f2
--- /dev/null
@@ -0,0 +1,61 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Gateworks Corporation
+ *
+ * GW72xx RS422 (RS485 full duplex):
+ *  - GPIO1_0 rs485_term selects on-chip termination
+ *  - GPIO4_0 rs485_en needs to be driven high (active)
+ *  - GPIO4_2 rs485_hd needs to be driven low (in-active)
+ *  - UART4_TX is DE for RS485 transmitter
+ *  - RS485_EN needs to be pulled high
+ *  - RS485_HALF needs to be low
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+
+#include "imx8mm-pinfunc.h"
+
+/dts-v1/;
+/plugin/;
+
+&{/} {
+       compatible = "gw,imx8mm-gw72xx-0x";
+};
+
+&gpio4 {
+       rs485_en {
+               gpio-hog;
+               gpios = <0 GPIO_ACTIVE_HIGH>;
+               output-high;
+               line-name = "rs485_en";
+       };
+
+       rs485_hd {
+               gpio-hog;
+               gpios = <2 GPIO_ACTIVE_HIGH>;
+               output-low;
+               line-name = "rs485_hd";
+       };
+};
+
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart2>;
+       rts-gpios = <&gpio5 29 GPIO_ACTIVE_HIGH>;
+       linux,rs485-enabled-at-boot-time;
+       status = "okay";
+};
+
+&uart4 {
+       status = "disabled";
+};
+
+&iomuxc {
+       pinctrl_uart2: uart2grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_UART2_RXD_UART2_DCE_RX     0x140
+                       MX8MM_IOMUXC_UART2_TXD_UART2_DCE_TX     0x140
+                       MX8MM_IOMUXC_UART4_TXD_GPIO5_IO29       0x140
+               >;
+       };
+};
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx-0x-rs485.dts b/arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx-0x-rs485.dts
new file mode 100644 (file)
index 0000000..cc0a287
--- /dev/null
@@ -0,0 +1,61 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Gateworks Corporation
+ *
+ * GW72xx RS485 HD:
+ *  - GPIO1_0 rs485_term selects on-chip termination
+ *  - GPIO4_0 rs485_en needs to be driven high (active)
+ *  - GPIO4_2 rs485_hd needs to be driven high (active)
+ *  - UART4_TX is DE for RS485 transmitter
+ *  - RS485_EN needs to be pulled high
+ *  - RS485_HALF needs to be pulled high
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+
+#include "imx8mm-pinfunc.h"
+
+/dts-v1/;
+/plugin/;
+
+&{/} {
+       compatible = "gw,imx8mm-gw72xx-0x";
+};
+
+&gpio4 {
+       rs485_en {
+               gpio-hog;
+               gpios = <0 GPIO_ACTIVE_HIGH>;
+               output-high;
+               line-name = "rs485_en";
+       };
+
+       rs485_hd {
+               gpio-hog;
+               gpios = <2 GPIO_ACTIVE_HIGH>;
+               output-high;
+               line-name = "rs485_hd";
+       };
+};
+
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart2>;
+       rts-gpios = <&gpio5 29 GPIO_ACTIVE_HIGH>;
+       linux,rs485-enabled-at-boot-time;
+       status = "okay";
+};
+
+&uart4 {
+       status = "disabled";
+};
+
+&iomuxc {
+       pinctrl_uart2: uart2grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_UART2_RXD_UART2_DCE_RX     0x140
+                       MX8MM_IOMUXC_UART2_TXD_UART2_DCE_TX     0x140
+                       MX8MM_IOMUXC_UART4_TXD_GPIO5_IO29       0x140
+               >;
+       };
+};
index 27afa46..1e7badb 100644 (file)
@@ -5,9 +5,11 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/leds/common.h>
+#include <dt-bindings/phy/phy-imx8-pcie.h>
 
 / {
        aliases {
+               ethernet1 = &eth1;
                usb0 = &usbotg1;
                usb1 = &usbotg2;
        };
                };
        };
 
+       pcie0_refclk: pcie0-refclk {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <100000000>;
+       };
+
        pps {
                compatible = "pps-gpio";
                pinctrl-names = "default";
        status = "okay";
 };
 
+&gpio1 {
+       gpio-line-names = "rs485_term", "mipi_gpio4", "", "",
+               "", "", "pci_usb_sel", "dio0",
+               "", "dio1", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "";
+};
+
+&gpio4 {
+       gpio-line-names = "rs485_en", "mipi_gpio3", "rs485_hd", "mipi_gpio2",
+               "mipi_gpio1", "", "", "pci_wdis#",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "";
+};
+
 &i2c2 {
        clock-frequency = <400000>;
        pinctrl-names = "default";
        status = "okay";
 };
 
+&pcie_phy {
+       fsl,refclk-pad-mode = <IMX8_PCIE_REFCLK_PAD_INPUT>;
+       fsl,clkreq-unsupported;
+       clocks = <&pcie0_refclk>;
+       status = "okay";
+};
+
+&pcie0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pcie0>;
+       reset-gpio = <&gpio4 6 GPIO_ACTIVE_LOW>;
+       clocks = <&clk IMX8MM_CLK_PCIE1_ROOT>, <&clk IMX8MM_CLK_PCIE1_AUX>,
+                <&pcie0_refclk>;
+       clock-names = "pcie", "pcie_aux", "pcie_bus";
+       assigned-clocks = <&clk IMX8MM_CLK_PCIE1_AUX>,
+                         <&clk IMX8MM_CLK_PCIE1_CTRL>;
+       assigned-clock-rates = <10000000>, <250000000>;
+       assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_50M>,
+                                <&clk IMX8MM_SYS_PLL2_250M>;
+       status = "okay";
+
+       pcie@0,0 {
+               reg = <0x0000 0 0 0 0>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               pcie@1,0 {
+                       reg = <0x0000 0 0 0 0>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       pcie@2,3 {
+                               reg = <0x1800 0 0 0 0>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               eth1: pcie@5,0 {
+                                       reg = <0x0000 0 0 0 0>;
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       local-mac-address = [00 00 00 00 00 00];
+                               };
+                       };
+               };
+       };
+};
+
 /* off-board header */
 &sai3 {
        pinctrl-names = "default";
                >;
        };
 
+       pinctrl_pcie0: pcie0grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SAI1_RXD4_GPIO4_IO6        0x41
+               >;
+       };
+
        pinctrl_pps: ppsgrp {
                fsl,pins = <
                        MX8MM_IOMUXC_GPIO1_IO15_GPIO1_IO15      0x41
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-imx219.dts b/arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-imx219.dts
new file mode 100644 (file)
index 0000000..f3ece4b
--- /dev/null
@@ -0,0 +1,93 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Gateworks Corporation
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+
+#include "imx8mm-pinfunc.h"
+
+/dts-v1/;
+/plugin/;
+
+&{/} {
+       compatible = "gw,imx8mm-gw73xx-0x", "fsl,imx8mm";
+
+       reg_cam: regulator-cam {
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_reg_cam>;
+               compatible = "regulator-fixed";
+               regulator-name = "reg_cam";
+               gpio = <&gpio1 1 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+       };
+
+       cam24m: cam24m {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <24000000>;
+               clock-output-names = "cam24m";
+       };
+};
+
+&csi {
+       status = "okay";
+};
+
+&i2c3 {
+       #address-cells = <1>;
+       #size-cells = <0>;
+
+       imx219: sensor@10 {
+               compatible = "sony,imx219";
+               reg = <0x10>;
+               clocks = <&cam24m>;
+               VDIG-supply = <&reg_cam>;
+
+               port {
+                       /* MIPI CSI-2 bus endpoint */
+                       imx219_to_mipi_csi2: endpoint {
+                               remote-endpoint = <&imx8mm_mipi_csi_in>;
+                               clock-lanes = <0>;
+                               data-lanes = <1 2>;
+                               link-frequencies = /bits/ 64 <456000000>;
+                       };
+               };
+       };
+};
+
+&mipi_csi {
+       status = "okay";
+
+       ports {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               port@0 {
+                       reg = <0>;
+
+                       imx8mm_mipi_csi_in: endpoint {
+                               remote-endpoint = <&imx219_to_mipi_csi2>;
+                               data-lanes = <1 2>;
+                       };
+               };
+
+               port@1 {
+                       reg = <1>;
+
+                       imx8mm_mipi_csi_out: endpoint {
+                               remote-endpoint = <&csi_in>;
+                       };
+               };
+       };
+};
+
+&iomuxc {
+       pinctrl_reg_cam: regcamgrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_GPIO1_IO01_GPIO1_IO1       0x41
+               >;
+       };
+};
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-rs232-rts.dts b/arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-rs232-rts.dts
new file mode 100644 (file)
index 0000000..2fa635e
--- /dev/null
@@ -0,0 +1,53 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Gateworks Corporation
+ *
+ * GW73xx RS232 with RTS/CTS hardware flow control:
+ *  - GPIO4_0 rs485_en needs to be driven low (in-active)
+ *  - UART4_TX becomes RTS
+ *  - UART4_RX becomes CTS
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+
+#include "imx8mm-pinfunc.h"
+
+/dts-v1/;
+/plugin/;
+
+&{/} {
+       compatible = "gw,imx8mm-gw73xx-0x";
+};
+
+&gpio4 {
+       rs485_en {
+               gpio-hog;
+               gpios = <0 GPIO_ACTIVE_HIGH>;
+               output-low;
+               line-name = "rs485_en";
+       };
+};
+
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart2>;
+       rts-gpios = <&gpio5 29 GPIO_ACTIVE_LOW>;
+       cts-gpios = <&gpio5 28 GPIO_ACTIVE_LOW>;
+       uart-has-rtscts;
+       status = "okay";
+};
+
+&uart4 {
+       status = "disabled";
+};
+
+&iomuxc {
+       pinctrl_uart2: uart2grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_UART2_RXD_UART2_DCE_RX     0x140
+                       MX8MM_IOMUXC_UART2_TXD_UART2_DCE_TX     0x140
+                       MX8MM_IOMUXC_UART4_TXD_GPIO5_IO29       0x140
+                       MX8MM_IOMUXC_UART4_RXD_GPIO5_IO28       0x140
+               >;
+       };
+};
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-rs422.dts b/arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-rs422.dts
new file mode 100644 (file)
index 0000000..3e64043
--- /dev/null
@@ -0,0 +1,61 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2021 Gateworks Corporation
+ *
+ * GW73xx RS422 (RS485 full duplex):
+ *  - GPIO1_0 rs485_term selects on-chip termination
+ *  - GPIO4_0 rs485_en needs to be driven high (active)
+ *  - GPIO4_2 rs485_hd needs to be driven low (in-active)
+ *  - UART4_TX is DE for RS485 transmitter
+ *  - RS485_EN needs to be pulled high
+ *  - RS485_HALF needs to be low
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+
+#include "imx8mm-pinfunc.h"
+
+/dts-v1/;
+/plugin/;
+
+&{/} {
+       compatible = "gw,imx8mm-gw73xx-0x";
+};
+
+&gpio4 {
+       rs485_en {
+               gpio-hog;
+               gpios = <0 GPIO_ACTIVE_HIGH>;
+               output-high;
+               line-name = "rs485_en";
+       };
+
+       rs485_hd {
+               gpio-hog;
+               gpios = <2 GPIO_ACTIVE_HIGH>;
+               output-low;
+               line-name = "rs485_hd";
+       };
+};
+
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart2>;
+       rts-gpios = <&gpio5 29 GPIO_ACTIVE_HIGH>;
+       linux,rs485-enabled-at-boot-time;
+       status = "okay";
+};
+
+&uart4 {
+       status = "disabled";
+};
+
+&iomuxc {
+       pinctrl_uart2: uart2grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_UART2_RXD_UART2_DCE_RX     0x140
+                       MX8MM_IOMUXC_UART2_TXD_UART2_DCE_TX     0x140
+                       MX8MM_IOMUXC_UART4_TXD_GPIO5_IO29       0x140
+               >;
+       };
+};
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-rs485.dts b/arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-rs485.dts
new file mode 100644 (file)
index 0000000..2c71ab9
--- /dev/null
@@ -0,0 +1,61 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2021 Gateworks Corporation
+ *
+ * GW73xx RS485 HD:
+ *  - GPIO1_0 rs485_term selects on-chip termination
+ *  - GPIO4_0 rs485_en needs to be driven high (active)
+ *  - GPIO4_2 rs485_hd needs to be driven high (active)
+ *  - UART4_TX is DE for RS485 transmitter
+ *  - RS485_EN needs to be pulled high
+ *  - RS485_HALF needs to be pulled high
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+
+#include "imx8mm-pinfunc.h"
+
+/dts-v1/;
+/plugin/;
+
+&{/} {
+       compatible = "gw,imx8mm-gw73xx-0x";
+};
+
+&gpio4 {
+       rs485_en {
+               gpio-hog;
+               gpios = <0 GPIO_ACTIVE_HIGH>;
+               output-high;
+               line-name = "rs485_en";
+       };
+
+       rs485_hd {
+               gpio-hog;
+               gpios = <2 GPIO_ACTIVE_HIGH>;
+               output-high;
+               line-name = "rs485_hd";
+       };
+};
+
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart2>;
+       rts-gpios = <&gpio5 29 GPIO_ACTIVE_HIGH>;
+       linux,rs485-enabled-at-boot-time;
+       status = "okay";
+};
+
+&uart4 {
+       status = "disabled";
+};
+
+&iomuxc {
+       pinctrl_uart2: uart2grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_UART2_RXD_UART2_DCE_RX     0x140
+                       MX8MM_IOMUXC_UART2_TXD_UART2_DCE_TX     0x140
+                       MX8MM_IOMUXC_UART4_TXD_GPIO5_IO29       0x140
+               >;
+       };
+};
index a59e849..426483e 100644 (file)
@@ -5,9 +5,11 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/leds/common.h>
+#include <dt-bindings/phy/phy-imx8-pcie.h>
 
 / {
        aliases {
+               ethernet1 = &eth1;
                usb0 = &usbotg1;
                usb1 = &usbotg2;
        };
                };
        };
 
+       pcie0_refclk: pcie0-refclk {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <100000000>;
+       };
+
        pps {
                compatible = "pps-gpio";
                pinctrl-names = "default";
        status = "okay";
 };
 
+&gpio1 {
+       gpio-line-names = "rs485_term", "mipi_gpio4", "", "",
+               "", "", "pci_usb_sel", "dio0",
+               "", "dio1", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "";
+};
+
+&gpio4 {
+       gpio-line-names = "rs485_en", "mipi_gpio3", "rs485_hd", "mipi_gpio2",
+               "mipi_gpio1", "", "", "pci_wdis#",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "";
+};
+
 &i2c2 {
        clock-frequency = <400000>;
        pinctrl-names = "default";
        status = "okay";
 };
 
+&pcie_phy {
+       fsl,refclk-pad-mode = <IMX8_PCIE_REFCLK_PAD_INPUT>;
+       fsl,clkreq-unsupported;
+       clocks = <&pcie0_refclk>;
+       status = "okay";
+};
+
+&pcie0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pcie0>;
+       reset-gpio = <&gpio4 6 GPIO_ACTIVE_LOW>;
+       clocks = <&clk IMX8MM_CLK_PCIE1_ROOT>, <&clk IMX8MM_CLK_PCIE1_AUX>,
+                <&pcie0_refclk>;
+       clock-names = "pcie", "pcie_aux", "pcie_bus";
+       assigned-clocks = <&clk IMX8MM_CLK_PCIE1_AUX>,
+                         <&clk IMX8MM_CLK_PCIE1_CTRL>;
+       assigned-clock-rates = <10000000>, <250000000>;
+       assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_50M>,
+                                <&clk IMX8MM_SYS_PLL2_250M>;
+       status = "okay";
+
+       pcie@0,0 {
+               reg = <0x0000 0 0 0 0>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               pcie@1,0 {
+                       reg = <0x0000 0 0 0 0>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       pcie@2,4 {
+                               reg = <0x2000 0 0 0 0>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               eth1: pcie@6,0 {
+                                       reg = <0x0000 0 0 0 0>;
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       local-mac-address = [00 00 00 00 00 00];
+                               };
+                       };
+               };
+       };
+};
+
 /* off-board header */
 &sai3 {
        pinctrl-names = "default";
                >;
        };
 
+       pinctrl_pcie0: pcie0grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SAI1_RXD4_GPIO4_IO6        0x41
+               >;
+       };
+
        pinctrl_pps: ppsgrp {
                fsl,pins = <
                        MX8MM_IOMUXC_GPIO1_IO15_GPIO1_IO15      0x41
index 21c546c..7e72310 100644 (file)
@@ -8,6 +8,7 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/leds/common.h>
+#include <dt-bindings/phy/phy-imx8-pcie.h>
 
 #include "imx8mm.dtsi"
 
                };
        };
 
+       pcie0_refclk: pcie0-refclk {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <100000000>;
+       };
+
        reg_3p3v: regulator-3p3v {
                compatible = "regulator-fixed";
                regulator-name = "3P3V";
        };
 };
 
+&gpio1 {
+       gpio-line-names = "uart1_rs422#", "", "", "uart1_rs485#",
+               "", "uart1_rs232#", "dig1_in", "dig1_out",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "";
+};
+
+&gpio4 {
+       gpio-line-names = "", "", "", "",
+               "", "", "uart3_rs232#", "uart3_rs422#",
+               "uart3_rs485#", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "uart4_rs485#", "", "sim1det#", "sim2det#", "";
+};
+
+&gpio5 {
+       gpio-line-names = "", "", "", "dig2_out", "dig2_in", "sim2sel", "", "",
+               "", "", "uart4_rs232#", "", "", "uart4_rs422#", "", "",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "";
+};
+
 &gpu_2d {
        status = "disabled";
 };
        status = "okay";
 };
 
+&pcie_phy {
+       fsl,refclk-pad-mode = <IMX8_PCIE_REFCLK_PAD_INPUT>;
+       fsl,clkreq-unsupported;
+       clocks = <&pcie0_refclk>;
+       status = "okay";
+};
+
+&pcie0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pcie0>;
+       reset-gpio = <&gpio5 2 GPIO_ACTIVE_LOW>;
+       clocks = <&clk IMX8MM_CLK_PCIE1_ROOT>, <&clk IMX8MM_CLK_PCIE1_AUX>,
+                <&pcie0_refclk>;
+       clock-names = "pcie", "pcie_aux", "pcie_bus";
+       assigned-clocks = <&clk IMX8MM_CLK_PCIE1_AUX>,
+                         <&clk IMX8MM_CLK_PCIE1_CTRL>;
+       assigned-clock-rates = <10000000>, <250000000>;
+       assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_50M>,
+                                <&clk IMX8MM_SYS_PLL2_250M>;
+       status = "okay";
+};
+
 &pgc_gpu {
        status = "disabled";
 };
                >;
        };
 
+       pinctrl_pcie0: pciegrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SAI3_TXFS_GPIO4_IO31       0x40000041 /* WDIS# */
+                       MX8MM_IOMUXC_SAI3_MCLK_GPIO5_IO2        0x41
+               >;
+       };
+
        pinctrl_pmic: pmicgrp {
                fsl,pins = <
                        MX8MM_IOMUXC_SAI5_RXC_GPIO3_IO20        0x41
index d52686f..edf0c7a 100644 (file)
@@ -9,6 +9,7 @@
 #include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/leds/common.h>
 #include <dt-bindings/net/ti-dp83867.h>
+#include <dt-bindings/phy/phy-imx8-pcie.h>
 
 #include "imx8mm.dtsi"
 
@@ -17,6 +18,7 @@
        compatible = "gw,imx8mm-gw7902", "fsl,imx8mm";
 
        aliases {
+               ethernet1 = &eth1;
                usb0 = &usbotg1;
                usb1 = &usbotg2;
        };
                };
        };
 
+       pcie0_refclk: pcie0-refclk {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <100000000>;
+       };
+
        pps {
                compatible = "pps-gpio";
                pinctrl-names = "default";
        };
 };
 
+&gpio1 {
+       gpio-line-names = "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "m2_reset", "", "m2_wdis#",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "";
+};
+
+&gpio2 {
+       gpio-line-names = "", "", "", "", "", "", "", "",
+               "uart2_en#", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "";
+};
+
+&gpio3 {
+       gpio-line-names = "", "m2_gdis#", "", "", "", "", "", "m2_off#",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "";
+};
+
+&gpio4 {
+       gpio-line-names = "", "", "", "", "", "", "", "",
+               "", "", "", "amp_gpio3", "amp_gpio2", "", "amp_gpio1", "",
+               "", "", "", "", "amp_gpio4", "app_gpio1", "", "uart1_rs485",
+               "", "uart1_term", "uart1_half", "app_gpio2",
+               "mipi_gpio1", "", "", "";
+};
+
+&gpio5 {
+       gpio-line-names = "", "", "", "mipi_gpio4",
+               "mipi_gpio3", "mipi_gpio2", "", "",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "";
+};
+
 &i2c1 {
        clock-frequency = <100000>;
        pinctrl-names = "default";
        status = "okay";
 };
 
+&pcie_phy {
+       fsl,refclk-pad-mode = <IMX8_PCIE_REFCLK_PAD_INPUT>;
+       fsl,clkreq-unsupported;
+       clocks = <&clk IMX8MM_CLK_DUMMY>;
+       status = "okay";
+};
+
+&pcie0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pcie0>;
+       reset-gpio = <&gpio4 5 GPIO_ACTIVE_LOW>;
+       clocks = <&clk IMX8MM_CLK_PCIE1_ROOT>, <&clk IMX8MM_CLK_PCIE1_AUX>,
+                <&clk IMX8MM_CLK_DUMMY>, <&pcie0_refclk>;
+       clock-names = "pcie", "pcie_aux", "pcie_phy", "pcie_bus";
+       assigned-clocks = <&clk IMX8MM_CLK_PCIE1_AUX>,
+                         <&clk IMX8MM_CLK_PCIE1_CTRL>;
+       assigned-clock-rates = <10000000>, <250000000>;
+       assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_50M>,
+                                <&clk IMX8MM_SYS_PLL2_250M>;
+       status = "okay";
+
+       pcie@0,0 {
+               reg = <0x0000 0 0 0 0>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               eth1: pcie@1,0 {
+                       reg = <0x0000 0 0 0 0>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       local-mac-address = [00 00 00 00 00 00];
+               };
+       };
+};
+
 /* off-board header */
 &sai3 {
        pinctrl-names = "default";
        pinctrl_hog: hoggrp {
                fsl,pins = <
                        MX8MM_IOMUXC_NAND_CE0_B_GPIO3_IO1       0x40000159 /* M2_GDIS# */
-                       MX8MM_IOMUXC_GPIO1_IO13_GPIO1_IO13      0x40000041 /* M2_RST# */
+                       MX8MM_IOMUXC_GPIO1_IO13_GPIO1_IO13      0x40000041 /* M2_RESET */
                        MX8MM_IOMUXC_NAND_DATA01_GPIO3_IO7      0x40000119 /* M2_OFF# */
                        MX8MM_IOMUXC_GPIO1_IO15_GPIO1_IO15      0x40000159 /* M2_WDIS# */
                        MX8MM_IOMUXC_SAI1_TXD2_GPIO4_IO14       0x40000041 /* AMP GPIO1 */
                >;
        };
 
+       pinctrl_pcie0: pciegrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SAI1_RXD3_GPIO4_IO5        0x41
+               >;
+       };
+
        pinctrl_pmic: pmicgrp {
                fsl,pins = <
                        MX8MM_IOMUXC_NAND_DATA02_GPIO3_IO8      0x41
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-venice-gw7903.dts b/arch/arm64/boot/dts/freescale/imx8mm-venice-gw7903.dts
new file mode 100644 (file)
index 0000000..1deb2ea
--- /dev/null
@@ -0,0 +1,836 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Gateworks Corporation
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/linux-event-codes.h>
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/phy/phy-imx8-pcie.h>
+
+#include "imx8mm.dtsi"
+
+/ {
+       model = "Gateworks Venice GW7903 i.MX8MM board";
+       compatible = "gw,imx8mm-gw7903", "fsl,imx8mm";
+
+       aliases {
+               ethernet0 = &fec1;
+               usb0 = &usbotg1;
+       };
+
+       chosen {
+               stdout-path = &uart2;
+       };
+
+       memory@40000000 {
+               device_type = "memory";
+               reg = <0x0 0x40000000 0 0x80000000>;
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               user-pb {
+                       label = "user_pb";
+                       gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
+                       linux,code = <BTN_0>;
+               };
+
+               user-pb1x {
+                       label = "user_pb1x";
+                       linux,code = <BTN_1>;
+                       interrupt-parent = <&gsc>;
+                       interrupts = <0>;
+               };
+
+               key-erased {
+                       label = "key_erased";
+                       linux,code = <BTN_2>;
+                       interrupt-parent = <&gsc>;
+                       interrupts = <1>;
+               };
+
+               eeprom-wp {
+                       label = "eeprom_wp";
+                       linux,code = <BTN_3>;
+                       interrupt-parent = <&gsc>;
+                       interrupts = <2>;
+               };
+
+               switch-hold {
+                       label = "switch_hold";
+                       linux,code = <BTN_5>;
+                       interrupt-parent = <&gsc>;
+                       interrupts = <7>;
+               };
+       };
+
+       led-controller {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_gpio_leds>;
+
+               led-0 {
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_RED>;
+                       label = "led01_red";
+                       gpios = <&gpio5 5 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+               };
+
+               led-1 {
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_GREEN>;
+                       label = "led01_grn";
+                       gpios = <&gpio4 30 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+               };
+
+               led-2 {
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_RED>;
+                       label = "led02_red";
+                       gpios = <&gpio5 2 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+               };
+
+               led-3 {
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_GREEN>;
+                       label = "led02_grn";
+                       gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+               };
+
+               led-4 {
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_RED>;
+                       label = "led03_red";
+                       gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+               };
+
+               led-5 {
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_GREEN>;
+                       label = "led03_grn";
+                       gpios = <&gpio5 3 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+               };
+
+               led-6 {
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_RED>;
+                       label = "led04_red";
+                       gpios = <&gpio4 29 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+               };
+
+               led-7 {
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_GREEN>;
+                       label = "led04_grn";
+                       gpios = <&gpio4 28 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+               };
+
+               led-8 {
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_RED>;
+                       label = "led05_red";
+                       gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+               };
+
+               led-9 {
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_GREEN>;
+                       label = "led05_grn";
+                       gpios = <&gpio4 31 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+               };
+
+               led-a {
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_RED>;
+                       label = "led06_red";
+                       gpios = <&gpio5 4 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+               };
+
+               led-b {
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_GREEN>;
+                       label = "led06_grn";
+                       gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+               };
+       };
+
+       pcie0_refclk: pcie0-refclk {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <100000000>;
+       };
+
+       reg_3p3v: regulator-3p3v {
+               compatible = "regulator-fixed";
+               regulator-name = "3P3V";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               regulator-always-on;
+       };
+};
+
+&A53_0 {
+       cpu-supply = <&buck2>;
+};
+
+&A53_1 {
+       cpu-supply = <&buck2>;
+};
+
+&A53_2 {
+       cpu-supply = <&buck2>;
+};
+
+&A53_3 {
+       cpu-supply = <&buck2>;
+};
+
+&ddrc {
+       operating-points-v2 = <&ddrc_opp_table>;
+
+       ddrc_opp_table: opp-table {
+               compatible = "operating-points-v2";
+
+               opp-25M {
+                       opp-hz = /bits/ 64 <25000000>;
+               };
+
+               opp-100M {
+                       opp-hz = /bits/ 64 <100000000>;
+               };
+
+               opp-750M {
+                       opp-hz = /bits/ 64 <750000000>;
+               };
+       };
+};
+
+&fec1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_fec1>;
+       phy-mode = "rgmii-id";
+       phy-handle = <&ethphy0>;
+       local-mac-address = [00 00 00 00 00 00];
+       status = "okay";
+
+       mdio {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               ethphy0: ethernet-phy@0 {
+                       compatible = "ethernet-phy-ieee802.3-c22";
+                       reg = <0>;
+                       rx-internal-delay-ps = <2000>;
+                       tx-internal-delay-ps = <2500>;
+               };
+       };
+};
+
+&gpio1 {
+       gpio-line-names = "", "", "", "", "", "", "", "",
+               "", "", "rs422_en#", "rs485_en#", "rs232_en#", "", "", "",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "";
+};
+
+&gpio2 {
+       gpio-line-names = "dig2_in", "dig2_out#", "", "", "", "", "", "",
+               "dig1_out#", "dig1_in", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "";
+};
+
+&gpio5 {
+       gpio-line-names = "", "", "", "", "", "", "", "sim1_det#",
+               "sim2_det#", "sim2_sel", "", "", "pci_wdis#", "", "", "",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "";
+};
+
+&i2c1 {
+       clock-frequency = <100000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c1>;
+       status = "okay";
+
+       gsc: gsc@20 {
+               compatible = "gw,gsc";
+               reg = <0x20>;
+               pinctrl-0 = <&pinctrl_gsc>;
+               interrupt-parent = <&gpio4>;
+               interrupts = <26 IRQ_TYPE_EDGE_FALLING>;
+               interrupt-controller;
+               #interrupt-cells = <1>;
+
+               adc {
+                       compatible = "gw,gsc-adc";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       channel@6 {
+                               gw,mode = <0>;
+                               reg = <0x06>;
+                               label = "temp";
+                       };
+
+                       channel@8 {
+                               gw,mode = <1>;
+                               reg = <0x08>;
+                               label = "vdd_bat";
+                       };
+
+                       channel@82 {
+                               gw,mode = <2>;
+                               reg = <0x82>;
+                               label = "vin";
+                               gw,voltage-divider-ohms = <22100 1000>;
+                               gw,voltage-offset-microvolt = <700000>;
+                       };
+
+                       channel@84 {
+                               gw,mode = <2>;
+                               reg = <0x84>;
+                               label = "vdd_5p0";
+                               gw,voltage-divider-ohms = <10000 10000>;
+                       };
+
+                       channel@86 {
+                               gw,mode = <2>;
+                               reg = <0x86>;
+                               label = "vdd_3p3";
+                               gw,voltage-divider-ohms = <10000 10000>;
+                       };
+
+                       channel@88 {
+                               gw,mode = <2>;
+                               reg = <0x88>;
+                               label = "vdd_0p9";
+                       };
+
+                       channel@8c {
+                               gw,mode = <2>;
+                               reg = <0x8c>;
+                               label = "vdd_soc";
+                       };
+
+                       channel@8e {
+                               gw,mode = <2>;
+                               reg = <0x8e>;
+                               label = "vdd_arm";
+                       };
+
+                       channel@90 {
+                               gw,mode = <2>;
+                               reg = <0x90>;
+                               label = "vdd_1p8";
+                       };
+
+                       channel@92 {
+                               gw,mode = <2>;
+                               reg = <0x92>;
+                               label = "vdd_dram";
+                       };
+
+                       channel@a2 {
+                               gw,mode = <2>;
+                               reg = <0xa2>;
+                               label = "vdd_gsc";
+                               gw,voltage-divider-ohms = <10000 10000>;
+                       };
+               };
+       };
+
+       gpio: gpio@23 {
+               compatible = "nxp,pca9555";
+               reg = <0x23>;
+               gpio-controller;
+               #gpio-cells = <2>;
+               interrupt-parent = <&gsc>;
+               interrupts = <4>;
+       };
+
+       eeprom@50 {
+               compatible = "atmel,24c02";
+               reg = <0x50>;
+               pagesize = <16>;
+       };
+
+       eeprom@51 {
+               compatible = "atmel,24c02";
+               reg = <0x51>;
+               pagesize = <16>;
+       };
+
+       eeprom@52 {
+               compatible = "atmel,24c02";
+               reg = <0x52>;
+               pagesize = <16>;
+       };
+
+       eeprom@53 {
+               compatible = "atmel,24c02";
+               reg = <0x53>;
+               pagesize = <16>;
+       };
+
+       rtc@68 {
+               compatible = "dallas,ds1672";
+               reg = <0x68>;
+       };
+};
+
+&i2c2 {
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c2>;
+       status = "okay";
+
+       pmic@4b {
+               compatible = "rohm,bd71847";
+               reg = <0x4b>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_pmic>;
+               interrupt-parent = <&gpio3>;
+               interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
+               rohm,reset-snvs-powered;
+               #clock-cells = <0>;
+               clocks = <&osc_32k 0>;
+               clock-output-names = "clk-32k-out";
+
+               regulators {
+                       /* vdd_soc: 0.805-0.900V (typ=0.8V) */
+                       BUCK1 {
+                               regulator-name = "buck1";
+                               regulator-min-microvolt = <700000>;
+                               regulator-max-microvolt = <1300000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                               regulator-ramp-delay = <1250>;
+                       };
+
+                       /* vdd_arm: 0.805-1.0V (typ=0.9V) */
+                       buck2: BUCK2 {
+                               regulator-name = "buck2";
+                               regulator-min-microvolt = <700000>;
+                               regulator-max-microvolt = <1300000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                               regulator-ramp-delay = <1250>;
+                               rohm,dvs-run-voltage = <1000000>;
+                               rohm,dvs-idle-voltage = <900000>;
+                       };
+
+                       /* vdd_0p9: 0.805-1.0V (typ=0.9V) */
+                       BUCK3 {
+                               regulator-name = "buck3";
+                               regulator-min-microvolt = <700000>;
+                               regulator-max-microvolt = <1350000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       /* vdd_3p3 */
+                       BUCK4 {
+                               regulator-name = "buck4";
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       /* vdd_1p8 */
+                       BUCK5 {
+                               regulator-name = "buck5";
+                               regulator-min-microvolt = <1605000>;
+                               regulator-max-microvolt = <1995000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       /* vdd_dram */
+                       BUCK6 {
+                               regulator-name = "buck6";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1400000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       /* nvcc_snvs_1p8 */
+                       LDO1 {
+                               regulator-name = "ldo1";
+                               regulator-min-microvolt = <1600000>;
+                               regulator-max-microvolt = <1900000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       /* vdd_snvs_0p8 */
+                       LDO2 {
+                               regulator-name = "ldo2";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <900000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       /* vdda_1p8 */
+                       LDO3 {
+                               regulator-name = "ldo3";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       LDO4 {
+                               regulator-name = "ldo4";
+                               regulator-min-microvolt = <900000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       LDO6 {
+                               regulator-name = "ldo6";
+                               regulator-min-microvolt = <900000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+               };
+       };
+};
+
+&i2c3 {
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c3>;
+       status = "okay";
+
+       accelerometer@19 {
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_accel>;
+               compatible = "st,lis2de12";
+               reg = <0x19>;
+               st,drdy-int-pin = <1>;
+               interrupt-parent = <&gpio1>;
+               interrupts = <15 IRQ_TYPE_LEVEL_LOW>;
+               interrupt-names = "INT1";
+       };
+};
+
+&pcie_phy {
+       fsl,refclk-pad-mode = <IMX8_PCIE_REFCLK_PAD_INPUT>;
+       fsl,clkreq-unsupported;
+       clocks = <&pcie0_refclk>;
+       status = "okay";
+};
+
+&pcie0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pcie0>;
+       reset-gpio = <&gpio5 11 GPIO_ACTIVE_LOW>;
+       clocks = <&clk IMX8MM_CLK_PCIE1_ROOT>, <&clk IMX8MM_CLK_PCIE1_AUX>,
+                <&pcie0_refclk>;
+       clock-names = "pcie", "pcie_aux", "pcie_bus";
+       assigned-clocks = <&clk IMX8MM_CLK_PCIE1_AUX>,
+                         <&clk IMX8MM_CLK_PCIE1_CTRL>;
+       assigned-clock-rates = <10000000>, <250000000>;
+       assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_50M>,
+                                <&clk IMX8MM_SYS_PLL2_250M>;
+       status = "okay";
+};
+
+&pgc_mipi {
+       status = "disabled";
+};
+
+/* off-board RS232/RS485/RS422 */
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart1>;
+       cts-gpios = <&gpio1 3 GPIO_ACTIVE_LOW>;
+       rts-gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
+       dtr-gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
+       dsr-gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
+       dcd-gpios = <&gpio3 24 GPIO_ACTIVE_LOW>;
+       uart-has-rtscts;
+       status = "okay";
+};
+
+/* console */
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart2>;
+       status = "okay";
+};
+
+&usbotg1 {
+       dr_mode = "host";
+       disable-over-current;
+       status = "okay";
+};
+
+/* microSD */
+&usdhc2 {
+       pinctrl-names = "default", "state_100mhz", "state_200mhz";
+       pinctrl-0 = <&pinctrl_usdhc2>, <&pinctrl_usdhc2_gpio>;
+       pinctrl-1 = <&pinctrl_usdhc2_100mhz>, <&pinctrl_usdhc2_gpio>;
+       pinctrl-2 = <&pinctrl_usdhc2_200mhz>, <&pinctrl_usdhc2_gpio>;
+       cd-gpios = <&gpio2 12 GPIO_ACTIVE_LOW>;
+       bus-width = <4>;
+       vmmc-supply = <&reg_3p3v>;
+       status = "okay";
+};
+
+/* eMMC */
+&usdhc3 {
+       pinctrl-names = "default", "state_100mhz", "state_200mhz";
+       pinctrl-0 = <&pinctrl_usdhc3>;
+       pinctrl-1 = <&pinctrl_usdhc3_100mhz>;
+       pinctrl-2 = <&pinctrl_usdhc3_200mhz>;
+       bus-width = <8>;
+       non-removable;
+       status = "okay";
+};
+
+&wdog1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_wdog>;
+       fsl,ext-reset-output;
+       status = "okay";
+};
+
+&iomuxc {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_hog>;
+
+       pinctrl_hog: hoggrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_GPIO1_IO10_GPIO1_IO10      0x40000041 /* RS422# */
+                       MX8MM_IOMUXC_GPIO1_IO11_GPIO1_IO11      0x40000041 /* RS485# */
+                       MX8MM_IOMUXC_GPIO1_IO12_GPIO1_IO12      0x40000041 /* RS232# */
+                       MX8MM_IOMUXC_SD1_DATA7_GPIO2_IO9        0x40000041 /* DIG1_IN */
+                       MX8MM_IOMUXC_SD1_DATA6_GPIO2_IO8        0x40000041 /* DIG1_OUT */
+                       MX8MM_IOMUXC_SD1_CLK_GPIO2_IO0          0x40000041 /* DIG2_IN */
+                       MX8MM_IOMUXC_SD1_CMD_GPIO2_IO1          0x40000041 /* DIG2_OUT */
+                       MX8MM_IOMUXC_ECSPI1_MOSI_GPIO5_IO7      0x40000041 /* SIM1DET# */
+                       MX8MM_IOMUXC_ECSPI1_MISO_GPIO5_IO8      0x40000041 /* SIM2DET# */
+                       MX8MM_IOMUXC_ECSPI1_SS0_GPIO5_IO9       0x40000041 /* SIM2SEL */
+                       MX8MM_IOMUXC_ECSPI2_MISO_GPIO5_IO12     0x40000041 /* PCI_WDIS# */
+               >;
+       };
+
+       pinctrl_accel: accelgrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_GPIO1_IO15_GPIO1_IO15      0x159
+               >;
+       };
+
+       pinctrl_fec1: fec1grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_ENET_MDC_ENET1_MDC                 0x3
+                       MX8MM_IOMUXC_ENET_MDIO_ENET1_MDIO               0x3
+                       MX8MM_IOMUXC_ENET_TD3_ENET1_RGMII_TD3           0x1f
+                       MX8MM_IOMUXC_ENET_TD2_ENET1_RGMII_TD2           0x1f
+                       MX8MM_IOMUXC_ENET_TD1_ENET1_RGMII_TD1           0x1f
+                       MX8MM_IOMUXC_ENET_TD0_ENET1_RGMII_TD0           0x1f
+                       MX8MM_IOMUXC_ENET_RD3_ENET1_RGMII_RD3           0x91
+                       MX8MM_IOMUXC_ENET_RD2_ENET1_RGMII_RD2           0x91
+                       MX8MM_IOMUXC_ENET_RD1_ENET1_RGMII_RD1           0x91
+                       MX8MM_IOMUXC_ENET_RD0_ENET1_RGMII_RD0           0x91
+                       MX8MM_IOMUXC_ENET_TXC_ENET1_RGMII_TXC           0x1f
+                       MX8MM_IOMUXC_ENET_RXC_ENET1_RGMII_RXC           0x91
+                       MX8MM_IOMUXC_ENET_RX_CTL_ENET1_RGMII_RX_CTL     0x91
+                       MX8MM_IOMUXC_ENET_TX_CTL_ENET1_RGMII_TX_CTL     0x1f
+                       MX8MM_IOMUXC_SAI2_TXFS_GPIO4_IO24               0x19 /* IRQ# */
+                       MX8MM_IOMUXC_SAI2_TXC_GPIO4_IO25                0x19 /* RST# */
+               >;
+       };
+
+       pinctrl_gsc: gscgrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SAI2_TXD0_GPIO4_IO26       0x159
+               >;
+       };
+
+       pinctrl_i2c1: i2c1grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_I2C1_SCL_I2C1_SCL          0x400001c3
+                       MX8MM_IOMUXC_I2C1_SDA_I2C1_SDA          0x400001c3
+               >;
+       };
+
+       pinctrl_i2c2: i2c2grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_I2C2_SCL_I2C2_SCL          0x400001c3
+                       MX8MM_IOMUXC_I2C2_SDA_I2C2_SDA          0x400001c3
+               >;
+       };
+
+       pinctrl_i2c3: i2c3grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_I2C3_SCL_I2C3_SCL          0x400001c3
+                       MX8MM_IOMUXC_I2C3_SDA_I2C3_SDA          0x400001c3
+               >;
+       };
+
+       pinctrl_gpio_leds: gpioledgrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SPDIF_EXT_CLK_GPIO5_IO5    0x19
+                       MX8MM_IOMUXC_SAI3_RXD_GPIO4_IO30        0x19
+                       MX8MM_IOMUXC_SAI3_MCLK_GPIO5_IO2        0x19
+                       MX8MM_IOMUXC_GPIO1_IO14_GPIO1_IO14      0x19
+                       MX8MM_IOMUXC_GPIO1_IO09_GPIO1_IO9       0x19
+                       MX8MM_IOMUXC_SPDIF_TX_GPIO5_IO3         0x19
+                       MX8MM_IOMUXC_SAI3_RXC_GPIO4_IO29        0x19
+                       MX8MM_IOMUXC_SAI3_RXFS_GPIO4_IO28       0x19
+                       MX8MM_IOMUXC_GPIO1_IO13_GPIO1_IO13      0x19
+                       MX8MM_IOMUXC_SAI3_TXFS_GPIO4_IO31       0x19
+                       MX8MM_IOMUXC_SPDIF_RX_GPIO5_IO4         0x19
+                       MX8MM_IOMUXC_GPIO1_IO08_GPIO1_IO8       0x19
+               >;
+       };
+
+       pinctrl_pcie0: pciegrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_ECSPI2_MOSI_GPIO5_IO11     0x41
+               >;
+       };
+
+       pinctrl_pmic: pmicgrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_NAND_DATA02_GPIO3_IO8      0x41
+               >;
+       };
+
+       pinctrl_uart1: uart1grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_UART1_RXD_UART1_DCE_RX     0x140
+                       MX8MM_IOMUXC_UART1_TXD_UART1_DCE_TX     0x140
+                       MX8MM_IOMUXC_GPIO1_IO00_GPIO1_IO0       0x140
+                       MX8MM_IOMUXC_GPIO1_IO01_GPIO1_IO1       0x140
+                       MX8MM_IOMUXC_GPIO1_IO03_GPIO1_IO3       0x140
+                       MX8MM_IOMUXC_GPIO1_IO05_GPIO1_IO5       0x140
+                       MX8MM_IOMUXC_SAI5_RXD3_GPIO3_IO24       0x140
+               >;
+       };
+
+       pinctrl_uart2: uart2grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_UART2_RXD_UART2_DCE_RX     0x140
+                       MX8MM_IOMUXC_UART2_TXD_UART2_DCE_TX     0x140
+               >;
+       };
+
+       pinctrl_usdhc2: usdhc2grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK         0x190
+                       MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD         0x1d0
+                       MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0     0x1d0
+                       MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1     0x1d0
+                       MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2     0x1d0
+                       MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3     0x1d0
+               >;
+       };
+
+       pinctrl_usdhc2_100mhz: usdhc2-100mhzgrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK         0x194
+                       MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD         0x1d4
+                       MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0     0x1d4
+                       MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1     0x1d4
+                       MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2     0x1d4
+                       MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3     0x1d4
+               >;
+       };
+
+       pinctrl_usdhc2_200mhz: usdhc2-200mhzgrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK         0x196
+                       MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD         0x1d6
+                       MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0     0x1d6
+                       MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1     0x1d6
+                       MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2     0x1d6
+                       MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3     0x1d6
+               >;
+       };
+
+       pinctrl_usdhc2_gpio: usdhc2-gpiogrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12        0x1c4
+                       MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT  0x1d0
+               >;
+       };
+
+       pinctrl_usdhc3: usdhc3grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK       0x190
+                       MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD       0x1d0
+                       MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0   0x1d0
+                       MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1   0x1d0
+                       MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2   0x1d0
+                       MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3   0x1d0
+                       MX8MM_IOMUXC_NAND_RE_B_USDHC3_DATA4     0x1d0
+                       MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5    0x1d0
+                       MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6    0x1d0
+                       MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7      0x1d0
+                       MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE   0x190
+               >;
+       };
+
+       pinctrl_usdhc3_100mhz: usdhc3-100mhzgrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK       0x194
+                       MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD       0x1d4
+                       MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0   0x1d4
+                       MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1   0x1d4
+                       MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2   0x1d4
+                       MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3   0x1d4
+                       MX8MM_IOMUXC_NAND_RE_B_USDHC3_DATA4     0x1d4
+                       MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5    0x1d4
+                       MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6    0x1d4
+                       MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7      0x1d4
+                       MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE   0x194
+               >;
+       };
+
+       pinctrl_usdhc3_200mhz: usdhc3-200mhzgrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK       0x196
+                       MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD       0x1d6
+                       MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0   0x1d6
+                       MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1   0x1d6
+                       MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2   0x1d6
+                       MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3   0x1d6
+                       MX8MM_IOMUXC_NAND_RE_B_USDHC3_DATA4     0x1d6
+                       MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5    0x1d6
+                       MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6    0x1d6
+                       MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7      0x1d6
+                       MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE   0x196
+               >;
+       };
+
+       pinctrl_wdog: wdoggrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B    0xc6
+               >;
+       };
+};
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi
new file mode 100644 (file)
index 0000000..aca5ae0
--- /dev/null
@@ -0,0 +1,150 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2022 Toradex
+ */
+
+/ {
+       sound_card: sound-card {
+               compatible = "simple-audio-card";
+               simple-audio-card,bitclock-master = <&dailink_master>;
+               simple-audio-card,format = "i2s";
+               simple-audio-card,frame-master = <&dailink_master>;
+               simple-audio-card,name = "imx8mm-wm8904";
+               simple-audio-card,routing =
+                       "Headphone Jack", "HPOUTL",
+                       "Headphone Jack", "HPOUTR",
+                       "IN2L", "Line In Jack",
+                       "IN2R", "Line In Jack",
+                       "Headphone Jack", "MICBIAS",
+                       "IN1L", "Headphone Jack";
+               simple-audio-card,widgets =
+                       "Microphone", "Headphone Jack",
+                       "Headphone", "Headphone Jack",
+                       "Line", "Line In Jack";
+
+               dailink_master: simple-audio-card,codec {
+                       clocks = <&clk IMX8MM_CLK_SAI2_ROOT>;
+                       sound-dai = <&wm8904_1a>;
+               };
+
+               simple-audio-card,cpu {
+                       sound-dai = <&sai2>;
+               };
+       };
+};
+
+/* Verdin SPI_1 */
+&ecspi2 {
+       status = "okay";
+};
+
+/* EEPROM on display adapter boards */
+&eeprom_display_adapter {
+       status = "okay";
+};
+
+/* EEPROM on Verdin Development board */
+&eeprom_carrier_board {
+       status = "okay";
+};
+
+&fec1 {
+       status = "okay";
+};
+
+/* Verdin QSPI_1 */
+&flexspi {
+       status = "okay";
+};
+
+/* Current measurement into module VCC */
+&hwmon {
+       status = "okay";
+};
+
+&hwmon_temp {
+       vs-supply = <&reg_1p8v>;
+       status = "okay";
+};
+
+&i2c3 {
+       status = "okay";
+};
+
+/* Verdin I2C_1 */
+&i2c4 {
+       status = "okay";
+
+       /* Audio Codec */
+       wm8904_1a: audio-codec@1a {
+               compatible = "wlf,wm8904";
+               AVDD-supply = <&reg_3p3v>;
+               clocks = <&clk IMX8MM_CLK_SAI2_ROOT>;
+               clock-names = "mclk";
+               CPVDD-supply = <&reg_3p3v>;
+               DBVDD-supply = <&reg_3p3v>;
+               DCVDD-supply = <&reg_3p3v>;
+               MICVDD-supply = <&reg_3p3v>;
+               reg = <0x1a>;
+               #sound-dai-cells = <0>;
+       };
+};
+
+/* Verdin PCIE_1 */
+&pcie0 {
+       status = "okay";
+};
+
+&pcie_phy {
+       status = "okay";
+};
+
+/* Verdin PWM_3_DSI */
+&pwm1 {
+       status = "okay";
+};
+
+/* Verdin PWM_1 */
+&pwm2 {
+       status = "okay";
+};
+
+/* Verdin PWM_2 */
+&pwm3 {
+       status = "okay";
+};
+
+/* VERDIN I2S_1 */
+&sai2 {
+       status = "okay";
+};
+
+/* Verdin UART_3 */
+&uart1 {
+       status = "okay";
+};
+
+/* Verdin UART_1 */
+&uart2 {
+       status = "okay";
+};
+
+/* Verdin UART_2 */
+&uart3 {
+       status = "okay";
+};
+
+/* Verdin USB_1 */
+&usbotg1 {
+       status = "okay";
+};
+
+/* Verdin USB_2 */
+&usbotg2 {
+       status = "okay";
+};
+
+/* Verdin SD_1 */
+&usdhc2 {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin-dev.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-verdin-dev.dtsi
new file mode 100644 (file)
index 0000000..73cc3fa
--- /dev/null
@@ -0,0 +1,67 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2022 Toradex
+ */
+
+#include "imx8mm-verdin-dahlia.dtsi"
+
+/ {
+       sound_card: sound-card {
+               compatible = "simple-audio-card";
+               simple-audio-card,bitclock-master = <&dailink_master>;
+               simple-audio-card,format = "i2s";
+               simple-audio-card,frame-master = <&dailink_master>;
+               simple-audio-card,name = "imx8mm-nau8822";
+               simple-audio-card,routing =
+                       "Headphones", "LHP",
+                       "Headphones", "RHP",
+                       "Speaker", "LSPK",
+                       "Speaker", "RSPK",
+                       "Line Out", "AUXOUT1",
+                       "Line Out", "AUXOUT2",
+                       "LAUX", "Line In",
+                       "RAUX", "Line In",
+                       "LMICP", "Mic In",
+                       "RMICP", "Mic In";
+               simple-audio-card,widgets =
+                       "Headphones", "Headphones",
+                       "Line Out", "Line Out",
+                       "Speaker", "Speaker",
+                       "Microphone", "Mic In",
+                       "Line", "Line In";
+
+               dailink_master: simple-audio-card,codec {
+                       clocks = <&clk IMX8MM_CLK_SAI2_ROOT>;
+                       sound-dai = <&nau8822_1a>;
+               };
+
+               simple-audio-card,cpu {
+                       sound-dai = <&sai2>;
+               };
+       };
+};
+
+&gpio_expander_21 {
+       status = "okay";
+};
+
+/* Verdin I2C_1 */
+&i2c4 {
+       /* Audio Codec */
+       nau8822_1a: audio-codec@1a {
+               compatible = "nuvoton,nau8822";
+               reg = <0x1a>;
+       };
+};
+
+/* Verdin UART_1, connector X50 through RS485 transceiver */
+&uart2 {
+       linux,rs485-enabled-at-boot-time;
+       rs485-rts-active-low;
+       rs485-rx-during-tx;
+};
+
+/* Limit frequency on dev board due to long traces and bad signal integrity */
+&usdhc2 {
+       max-frequency = <100000000>;
+};
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin-nonwifi-dahlia.dts b/arch/arm64/boot/dts/freescale/imx8mm-verdin-nonwifi-dahlia.dts
new file mode 100644 (file)
index 0000000..d64ff37
--- /dev/null
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2022 Toradex
+ */
+
+/dts-v1/;
+
+#include "imx8mm-verdin.dtsi"
+#include "imx8mm-verdin-nonwifi.dtsi"
+#include "imx8mm-verdin-dahlia.dtsi"
+
+/ {
+       model = "Toradex Verdin iMX8M Mini on Dahlia Board";
+       compatible = "toradex,verdin-imx8mm-nonwifi-dahlia",
+                    "toradex,verdin-imx8mm-nonwifi",
+                    "toradex,verdin-imx8mm",
+                    "fsl,imx8mm";
+};
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin-nonwifi-dev.dts b/arch/arm64/boot/dts/freescale/imx8mm-verdin-nonwifi-dev.dts
new file mode 100644 (file)
index 0000000..6ae71ec
--- /dev/null
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2022 Toradex
+ */
+
+/dts-v1/;
+
+#include "imx8mm-verdin.dtsi"
+#include "imx8mm-verdin-nonwifi.dtsi"
+#include "imx8mm-verdin-dev.dtsi"
+
+/ {
+       model = "Toradex Verdin iMX8M Mini on Verdin Development Board";
+       compatible = "toradex,verdin-imx8mm-nonwifi-dev",
+                    "toradex,verdin-imx8mm-nonwifi",
+                    "toradex,verdin-imx8mm",
+                    "fsl,imx8mm";
+};
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin-nonwifi.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-verdin-nonwifi.dtsi
new file mode 100644 (file)
index 0000000..1e0f87c
--- /dev/null
@@ -0,0 +1,75 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2022 Toradex
+ */
+
+&gpio3 {
+       gpio-line-names = "SODIMM_52",
+                         "SODIMM_54",
+                         "SODIMM_64",
+                         "SODIMM_21",
+                         "SODIMM_206",
+                         "SODIMM_76",
+                         "SODIMM_56",
+                         "SODIMM_58",
+                         "SODIMM_60",
+                         "SODIMM_62",
+                         "SODIMM_162",
+                         "SODIMM_164",
+                         "SODIMM_166",
+                         "SODIMM_168",
+                         "SODIMM_66",
+                         "SODIMM_17",
+                         "",
+                         "SODIMM_156",
+                         "SODIMM_160",
+                         "SODIMM_244",
+                         "",
+                         "SODIMM_48",
+                         "SODIMM_44",
+                         "SODIMM_42",
+                         "SODIMM_46";
+};
+
+&gpio4 {
+       gpio-line-names = "SODIMM_102",
+                         "SODIMM_90",
+                         "SODIMM_92",
+                         "SODIMM_94",
+                         "SODIMM_96",
+                         "SODIMM_100",
+                         "SODIMM_148",
+                         "SODIMM_152",
+                         "SODIMM_154",
+                         "SODIMM_174",
+                         "SODIMM_120",
+                         "SODIMM_104",
+                         "SODIMM_106",
+                         "SODIMM_108",
+                         "SODIMM_112",
+                         "SODIMM_114",
+                         "SODIMM_116",
+                         "SODIMM_150",
+                         "SODIMM_118",
+                         "",
+                         "SODIMM_88",
+                         "SODIMM_149",
+                         "SODIMM_147",
+                         "SODIMM_36",
+                         "SODIMM_32",
+                         "SODIMM_30",
+                         "SODIMM_34",
+                         "SODIMM_38",
+                         "SODIMM_252",
+                         "SODIMM_133",
+                         "SODIMM_135",
+                         "SODIMM_129";
+};
+
+&usdhc3 {
+       bus-width = <4>;
+       pinctrl-names = "default", "state_100mhz", "state_200mhz";
+       pinctrl-0 = <&pinctrl_usdhc3>;
+       pinctrl-1 = <&pinctrl_usdhc3_100mhz>;
+       pinctrl-2 = <&pinctrl_usdhc3_200mhz>;
+};
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin-wifi-dahlia.dts b/arch/arm64/boot/dts/freescale/imx8mm-verdin-wifi-dahlia.dts
new file mode 100644 (file)
index 0000000..d424c47
--- /dev/null
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2022 Toradex
+ */
+
+/dts-v1/;
+
+#include "imx8mm-verdin.dtsi"
+#include "imx8mm-verdin-wifi.dtsi"
+#include "imx8mm-verdin-dahlia.dtsi"
+
+/ {
+       model = "Toradex Verdin iMX8M Mini WB on Dahlia Board";
+       compatible = "toradex,verdin-imx8mm-wifi-dahlia",
+                    "toradex,verdin-imx8mm-wifi",
+                    "toradex,verdin-imx8mm",
+                    "fsl,imx8mm";
+};
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin-wifi-dev.dts b/arch/arm64/boot/dts/freescale/imx8mm-verdin-wifi-dev.dts
new file mode 100644 (file)
index 0000000..ef95202
--- /dev/null
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2022 Toradex
+ */
+
+/dts-v1/;
+
+#include "imx8mm-verdin.dtsi"
+#include "imx8mm-verdin-wifi.dtsi"
+#include "imx8mm-verdin-dev.dtsi"
+
+/ {
+       model = "Toradex Verdin iMX8M Mini WB on Verdin Development Board";
+       compatible = "toradex,verdin-imx8mm-wifi-dev",
+                    "toradex,verdin-imx8mm-wifi",
+                    "toradex,verdin-imx8mm",
+                    "fsl,imx8mm";
+};
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin-wifi.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-verdin-wifi.dtsi
new file mode 100644 (file)
index 0000000..3e06a6c
--- /dev/null
@@ -0,0 +1,94 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2022 Toradex
+ */
+
+/ {
+       reg_wifi_en: regulator-wifi-en {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio3 25 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_wifi_pwr_en>;
+               regulator-max-microvolt = <3300000>;
+               regulator-min-microvolt = <3300000>;
+               regulator-name = "PDn_AW-CM276NF";
+               startup-delay-us = <2000>;
+       };
+};
+
+/* On-module Wi-Fi */
+&usdhc3 {
+       bus-width = <4>;
+       keep-power-in-suspend;
+       non-removable;
+       pinctrl-names = "default", "state_100mhz", "state_200mhz";
+       pinctrl-0 = <&pinctrl_usdhc3>, <&pinctrl_wifi_ctrl>;
+       pinctrl-1 = <&pinctrl_usdhc3_100mhz>, <&pinctrl_wifi_ctrl>;
+       pinctrl-2 = <&pinctrl_usdhc3_200mhz>, <&pinctrl_wifi_ctrl>;
+       vmmc-supply = <&reg_wifi_en>;
+       status = "okay";
+};
+
+&gpio3 {
+       gpio-line-names = "SODIMM_52",
+                         "SODIMM_54",
+                         "SODIMM_64",
+                         "SODIMM_21",
+                         "SODIMM_206",
+                         "SODIMM_76",
+                         "SODIMM_56",
+                         "SODIMM_58",
+                         "SODIMM_60",
+                         "SODIMM_62",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "SODIMM_66",
+                         "SODIMM_17",
+                         "",
+                         "",
+                         "",
+                         "SODIMM_244",
+                         "",
+                         "SODIMM_48",
+                         "SODIMM_44",
+                         "SODIMM_42",
+                         "SODIMM_46";
+};
+
+&gpio4 {
+       gpio-line-names = "SODIMM_102",
+                         "SODIMM_90",
+                         "SODIMM_92",
+                         "SODIMM_94",
+                         "SODIMM_96",
+                         "SODIMM_100",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "SODIMM_120",
+                         "SODIMM_104",
+                         "SODIMM_106",
+                         "SODIMM_108",
+                         "SODIMM_112",
+                         "SODIMM_114",
+                         "SODIMM_116",
+                         "",
+                         "SODIMM_118",
+                         "",
+                         "SODIMM_88",
+                         "SODIMM_149",
+                         "SODIMM_147",
+                         "SODIMM_36",
+                         "SODIMM_32",
+                         "SODIMM_30",
+                         "SODIMM_34",
+                         "SODIMM_38",
+                         "SODIMM_252",
+                         "SODIMM_133",
+                         "SODIMM_135",
+                         "SODIMM_129";
+};
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi
new file mode 100644 (file)
index 0000000..0d84d29
--- /dev/null
@@ -0,0 +1,1264 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2022 Toradex
+ */
+
+#include "dt-bindings/phy/phy-imx8-pcie.h"
+#include "dt-bindings/pwm/pwm.h"
+#include "imx8mm.dtsi"
+
+/ {
+       chosen {
+               stdout-path = &uart1;
+       };
+
+       aliases {
+               rtc0 = &rtc_i2c;
+               rtc1 = &snvs_rtc;
+       };
+
+       backlight: backlight {
+               compatible = "pwm-backlight";
+               brightness-levels = <0 45 63 88 119 158 203 255>;
+               default-brightness-level = <4>;
+               /* Verdin I2S_2_D_OUT (DSI_1_BKL_EN/DSI_1_BKL_EN_LVDS, SODIMM 46) */
+               enable-gpios = <&gpio3 24 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_i2s_2_d_out_dsi_1_bkl_en>;
+               power-supply = <&reg_3p3v>;
+               /* Verdin PWM_3_DSI/PWM_3_DSI_LVDS (SODIMM 19) */
+               pwms = <&pwm1 0 6666667 PWM_POLARITY_INVERTED>;
+               status = "disabled";
+       };
+
+       /* Fixed clock dedicated to SPI CAN controller */
+       clk20m: oscillator {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <20000000>;
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_gpio_keys>;
+
+               wakeup {
+                       debounce-interval = <10>;
+                       /* Verdin CTRL_WAKE1_MICO# (SODIMM 252) */
+                       gpios = <&gpio4 28 GPIO_ACTIVE_LOW>;
+                       label = "Wake-Up";
+                       linux,code = <KEY_WAKEUP>;
+                       wakeup-source;
+               };
+       };
+
+       /* Carrier Board Supplies */
+       reg_1p8v: regulator-1p8v {
+               compatible = "regulator-fixed";
+               regulator-max-microvolt = <1800000>;
+               regulator-min-microvolt = <1800000>;
+               regulator-name = "+V1.8_SW";
+       };
+
+       reg_3p3v: regulator-3p3v {
+               compatible = "regulator-fixed";
+               regulator-max-microvolt = <3300000>;
+               regulator-min-microvolt = <3300000>;
+               regulator-name = "+V3.3_SW";
+       };
+
+       reg_5p0v: regulator-5p0v {
+               compatible = "regulator-fixed";
+               regulator-max-microvolt = <5000000>;
+               regulator-min-microvolt = <5000000>;
+               regulator-name = "+V5_SW";
+       };
+
+       /* Non PMIC On-module Supplies */
+       reg_ethphy: regulator-ethphy {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio2 20 GPIO_ACTIVE_HIGH>; /* PMIC_EN_ETH */
+               off-on-delay = <500000>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_reg_eth>;
+               regulator-boot-on;
+               regulator-max-microvolt = <3300000>;
+               regulator-min-microvolt = <3300000>;
+               regulator-name = "+V3.3_ETH";
+               startup-delay-us = <200000>;
+       };
+
+       reg_usb_otg1_vbus: regulator-usb-otg1 {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               /* Verdin USB_1_EN (SODIMM 155) */
+               gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_reg_usb1_en>;
+               regulator-max-microvolt = <5000000>;
+               regulator-min-microvolt = <5000000>;
+               regulator-name = "usb_otg1_vbus";
+       };
+
+       reg_usb_otg2_vbus: regulator-usb-otg2 {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               /* Verdin USB_2_EN (SODIMM 185) */
+               gpio = <&gpio1 14 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_reg_usb2_en>;
+               regulator-max-microvolt = <5000000>;
+               regulator-min-microvolt = <5000000>;
+               regulator-name = "usb_otg2_vbus";
+       };
+
+       reg_usdhc2_vmmc: regulator-usdhc2 {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               /* Verdin SD_1_PWR_EN (SODIMM 76) */
+               gpio = <&gpio3 5 GPIO_ACTIVE_HIGH>;
+               off-on-delay = <100000>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_usdhc2_pwr_en>;
+               regulator-max-microvolt = <3300000>;
+               regulator-min-microvolt = <3300000>;
+               regulator-name = "+V3.3_SD";
+               startup-delay-us = <2000>;
+       };
+
+       reserved-memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               /* Use the kernel configuration settings instead */
+               /delete-node/ linux,cma;
+       };
+};
+
+&A53_0 {
+       cpu-supply = <&reg_vdd_arm>;
+};
+
+&A53_1 {
+       cpu-supply = <&reg_vdd_arm>;
+};
+
+&A53_2 {
+       cpu-supply = <&reg_vdd_arm>;
+};
+
+&A53_3 {
+       cpu-supply = <&reg_vdd_arm>;
+};
+
+&ddrc {
+       operating-points-v2 = <&ddrc_opp_table>;
+
+       ddrc_opp_table: opp-table {
+               compatible = "operating-points-v2";
+
+               opp-25M {
+                       opp-hz = /bits/ 64 <25000000>;
+               };
+
+               opp-100M {
+                       opp-hz = /bits/ 64 <100000000>;
+               };
+
+               opp-750M {
+                       opp-hz = /bits/ 64 <750000000>;
+               };
+       };
+};
+
+/* Verdin SPI_1 */
+&ecspi2 {
+       #address-cells = <1>;
+       #size-cells = <0>;
+       cs-gpios = <&gpio5 13 GPIO_ACTIVE_LOW>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_ecspi2>;
+};
+
+/* Verdin CAN_1 (On-module) */
+&ecspi3 {
+       #address-cells = <1>;
+       #size-cells = <0>;
+       cs-gpios = <&gpio5 25 GPIO_ACTIVE_LOW>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_ecspi3>;
+       status = "okay";
+
+       can1: can@0 {
+               compatible = "microchip,mcp251xfd";
+               clocks = <&clk20m>;
+               interrupts-extended = <&gpio1 6 IRQ_TYPE_EDGE_FALLING>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_can1_int>;
+               reg = <0>;
+               spi-max-frequency = <8500000>;
+       };
+};
+
+/* Verdin ETH_1 (On-module PHY) */
+&fec1 {
+       fsl,magic-packet;
+       phy-handle = <&ethphy0>;
+       phy-mode = "rgmii-id";
+       phy-supply = <&reg_ethphy>;
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <&pinctrl_fec1>;
+       pinctrl-1 = <&pinctrl_fec1_sleep>;
+
+       mdio {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               ethphy0: ethernet-phy@7 {
+                       compatible = "ethernet-phy-ieee802.3-c22";
+                       interrupt-parent = <&gpio1>;
+                       interrupts = <10 IRQ_TYPE_LEVEL_LOW>;
+                       micrel,led-mode = <0>;
+                       reg = <7>;
+               };
+       };
+};
+
+/* Verdin QSPI_1 */
+&flexspi {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_flexspi0>;
+};
+
+&gpio1 {
+       gpio-line-names = "SODIMM_216",
+                         "SODIMM_19",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "SODIMM_220",
+                         "SODIMM_222",
+                         "",
+                         "SODIMM_218",
+                         "SODIMM_155",
+                         "SODIMM_157",
+                         "SODIMM_185",
+                         "SODIMM_187";
+};
+
+&gpio2 {
+       gpio-line-names = "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "SODIMM_84",
+                         "SODIMM_78",
+                         "SODIMM_74",
+                         "SODIMM_80",
+                         "SODIMM_82",
+                         "SODIMM_70",
+                         "SODIMM_72";
+};
+
+&gpio5 {
+       gpio-line-names = "SODIMM_131",
+                         "",
+                         "SODIMM_91",
+                         "SODIMM_16",
+                         "SODIMM_15",
+                         "SODIMM_208",
+                         "SODIMM_137",
+                         "SODIMM_139",
+                         "SODIMM_141",
+                         "SODIMM_143",
+                         "SODIMM_196",
+                         "SODIMM_200",
+                         "SODIMM_198",
+                         "SODIMM_202",
+                         "",
+                         "",
+                         "SODIMM_55",
+                         "SODIMM_53",
+                         "SODIMM_95",
+                         "SODIMM_93",
+                         "SODIMM_14",
+                         "SODIMM_12",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "SODIMM_210",
+                         "SODIMM_212",
+                         "SODIMM_151",
+                         "SODIMM_153";
+
+       ctrl_sleep_moci-hog {
+               gpio-hog;
+               /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */
+               gpios = <1 GPIO_ACTIVE_HIGH>;
+               line-name = "CTRL_SLEEP_MOCI#";
+               output-high;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_ctrl_sleep_moci>;
+       };
+};
+
+/* On-module I2C */
+&i2c1 {
+       clock-frequency = <400000>;
+       pinctrl-names = "default", "gpio";
+       pinctrl-0 = <&pinctrl_i2c1>;
+       pinctrl-1 = <&pinctrl_i2c1_gpio>;
+       scl-gpios = <&gpio5 14 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+       sda-gpios = <&gpio5 15 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+       status = "okay";
+
+       pca9450: pmic@25 {
+               compatible = "nxp,pca9450a";
+               interrupt-parent = <&gpio1>;
+               /* PMIC PCA9450 PMIC_nINT GPIO1_IO3 */
+               interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_pmic>;
+               reg = <0x25>;
+               sd-vsel-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
+
+               regulators {
+                       reg_vdd_soc: BUCK1 {
+                               nxp,dvs-run-voltage = <850000>;
+                               nxp,dvs-standby-voltage = <800000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <850000>;
+                               regulator-min-microvolt = <800000>;
+                               regulator-name = "+VDD_SOC";
+                               regulator-ramp-delay = <3125>;
+                       };
+
+                       reg_vdd_arm: BUCK2 {
+                               nxp,dvs-run-voltage = <950000>;
+                               nxp,dvs-standby-voltage = <850000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <950000>;
+                               regulator-min-microvolt = <850000>;
+                               regulator-name = "+VDD_ARM";
+                               regulator-ramp-delay = <3125>;
+                       };
+
+                       reg_vdd_dram: BUCK3 {
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <950000>;
+                               regulator-min-microvolt = <850000>;
+                               regulator-name = "+VDD_GPU_VPU_DDR";
+                       };
+
+                       reg_vdd_3v3: BUCK4 {
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-min-microvolt = <3300000>;
+                               regulator-name = "+V3.3";
+                       };
+
+                       reg_vdd_1v8: BUCK5 {
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-name = "PWR_1V8_MOCI";
+                       };
+
+                       reg_nvcc_dram: BUCK6 {
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <1100000>;
+                               regulator-min-microvolt = <1100000>;
+                               regulator-name = "+VDD_DDR";
+                       };
+
+                       reg_nvcc_snvs: LDO1 {
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-name = "+V1.8_SNVS";
+                       };
+
+                       reg_vdd_snvs: LDO2 {
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <900000>;
+                               regulator-min-microvolt = <800000>;
+                               regulator-name = "+V0.8_SNVS";
+                       };
+
+                       reg_vdda: LDO3 {
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-name = "+V1.8A";
+                       };
+
+                       reg_vdd_phy: LDO4 {
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <900000>;
+                               regulator-min-microvolt = <900000>;
+                               regulator-name = "+V0.9_MIPI";
+                       };
+
+                       reg_nvcc_sd: LDO5 {
+                               regulator-max-microvolt = <3300000>;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-name = "+V3.3_1.8_SD";
+                       };
+               };
+       };
+
+       rtc_i2c: rtc@32 {
+               compatible = "epson,rx8130";
+               reg = <0x32>;
+       };
+
+       adc@49 {
+               compatible = "ti,ads1015";
+               reg = <0x49>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               /* Verdin I2C_1 (ADC_4 - ADC_3) */
+               channel@0 {
+                       reg = <0>;
+                       ti,datarate = <4>;
+                       ti,gain = <2>;
+               };
+
+               /* Verdin I2C_1 (ADC_4 - ADC_1) */
+               channel@1 {
+                       reg = <1>;
+                       ti,datarate = <4>;
+                       ti,gain = <2>;
+               };
+
+               /* Verdin I2C_1 (ADC_3 - ADC_1) */
+               channel@2 {
+                       reg = <2>;
+                       ti,datarate = <4>;
+                       ti,gain = <2>;
+               };
+
+               /* Verdin I2C_1 (ADC_2 - ADC_1) */
+               channel@3 {
+                       reg = <3>;
+                       ti,datarate = <4>;
+                       ti,gain = <2>;
+               };
+
+               /* Verdin I2C_1 ADC_4 */
+               channel@4 {
+                       reg = <4>;
+                       ti,datarate = <4>;
+                       ti,gain = <2>;
+               };
+
+               /* Verdin I2C_1 ADC_3 */
+               channel@5 {
+                       reg = <5>;
+                       ti,datarate = <4>;
+                       ti,gain = <2>;
+               };
+
+               /* Verdin I2C_1 ADC_2 */
+               channel@6 {
+                       reg = <6>;
+                       ti,datarate = <4>;
+                       ti,gain = <2>;
+               };
+
+               /* Verdin I2C_1 ADC_1 */
+               channel@7 {
+                       reg = <7>;
+                       ti,datarate = <4>;
+                       ti,gain = <2>;
+               };
+       };
+
+       eeprom@50 {
+               compatible = "st,24c02";
+               pagesize = <16>;
+               reg = <0x50>;
+       };
+};
+
+/* Verdin I2C_2_DSI */
+&i2c2 {
+       clock-frequency = <10000>;
+       pinctrl-names = "default", "gpio";
+       pinctrl-0 = <&pinctrl_i2c2>;
+       pinctrl-1 = <&pinctrl_i2c2_gpio>;
+       scl-gpios = <&gpio5 16 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+       sda-gpios = <&gpio5 17 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+       status = "disabled";
+};
+
+/* Verdin I2C_3_HDMI N/A */
+
+/* Verdin I2C_4_CSI */
+&i2c3 {
+       clock-frequency = <400000>;
+       pinctrl-names = "default", "gpio";
+       pinctrl-0 = <&pinctrl_i2c3>;
+       pinctrl-1 = <&pinctrl_i2c3_gpio>;
+       scl-gpios = <&gpio5 18 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+       sda-gpios = <&gpio5 19 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+};
+
+/* Verdin I2C_1 */
+&i2c4 {
+       clock-frequency = <400000>;
+       pinctrl-names = "default", "gpio";
+       pinctrl-0 = <&pinctrl_i2c4>;
+       pinctrl-1 = <&pinctrl_i2c4_gpio>;
+       scl-gpios = <&gpio5 20 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+       sda-gpios = <&gpio5 21 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+
+       gpio_expander_21: gpio-expander@21 {
+               compatible = "nxp,pcal6416";
+               #gpio-cells = <2>;
+               gpio-controller;
+               reg = <0x21>;
+               vcc-supply = <&reg_3p3v>;
+               status = "disabled";
+       };
+
+       lvds_ti_sn65dsi83: bridge@2c {
+               compatible = "ti,sn65dsi83";
+               /* Verdin GPIO_9_DSI (SN65DSI84 IRQ, SODIMM 17, unused) */
+               /* Verdin GPIO_10_DSI (SODIMM 21) */
+               enable-gpios = <&gpio3 3 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_gpio_10_dsi>;
+               reg = <0x2c>;
+               status = "disabled";
+       };
+
+       /* Current measurement into module VCC */
+       hwmon: hwmon@40 {
+               compatible = "ti,ina219";
+               reg = <0x40>;
+               shunt-resistor = <10000>;
+               status = "disabled";
+       };
+
+       hdmi_lontium_lt8912: hdmi@48 {
+               compatible = "lontium,lt8912b";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_gpio_10_dsi>, <&pinctrl_pwm_3_dsi_hpd_gpio>;
+               reg = <0x48>;
+               /* Verdin GPIO_9_DSI (LT8912 INT, SODIMM 17, unused) */
+               /* Verdin GPIO_10_DSI (SODIMM 21) */
+               reset-gpios = <&gpio3 3 GPIO_ACTIVE_LOW>;
+               status = "disabled";
+       };
+
+       atmel_mxt_ts: touch@4a {
+               compatible = "atmel,maxtouch";
+               /* Verdin GPIO_9_DSI */
+               /* (TOUCH_INT#, SODIMM 17, also routed to SN65dsi83 IRQ albeit currently unused) */
+               interrupt-parent = <&gpio3>;
+               interrupts = <15 IRQ_TYPE_EDGE_FALLING>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_gpio_9_dsi>, <&pinctrl_i2s_2_bclk_touch_reset>;
+               reg = <0x4a>;
+               /* Verdin I2S_2_BCLK (TOUCH_RESET#, SODIMM 42) */
+               reset-gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;
+               status = "disabled";
+       };
+
+       /* Temperature sensor on carrier board */
+       hwmon_temp: sensor@4f {
+               compatible = "ti,tmp75c";
+               reg = <0x4f>;
+               status = "disabled";
+       };
+
+       /* EEPROM on display adapter (MIPI DSI Display Adapter) */
+       eeprom_display_adapter: eeprom@50 {
+               compatible = "st,24c02";
+               pagesize = <16>;
+               reg = <0x50>;
+               status = "disabled";
+       };
+
+       /* EEPROM on carrier board */
+       eeprom_carrier_board: eeprom@57 {
+               compatible = "st,24c02";
+               pagesize = <16>;
+               reg = <0x57>;
+               status = "disabled";
+       };
+};
+
+/* Verdin PCIE_1 */
+&pcie0 {
+       assigned-clocks = <&clk IMX8MM_CLK_PCIE1_AUX>,
+                         <&clk IMX8MM_CLK_PCIE1_CTRL>;
+       assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_50M>,
+                                <&clk IMX8MM_SYS_PLL2_250M>;
+       assigned-clock-rates = <10000000>, <250000000>;
+       clocks = <&clk IMX8MM_CLK_PCIE1_ROOT>, <&clk IMX8MM_CLK_PCIE1_AUX>,
+                <&clk IMX8MM_CLK_PCIE1_PHY>;
+       clock-names = "pcie", "pcie_aux", "pcie_bus";
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pcie0>;
+       /* PCIE_1_RESET# (SODIMM 244) */
+       reset-gpio = <&gpio3 19 GPIO_ACTIVE_LOW>;
+};
+
+&pcie_phy {
+       clocks = <&clk IMX8MM_CLK_PCIE1_PHY>;
+       fsl,clkreq-unsupported;
+       fsl,refclk-pad-mode = <IMX8_PCIE_REFCLK_PAD_OUTPUT>;
+       fsl,tx-deemph-gen1 = <0x2d>;
+       fsl,tx-deemph-gen2 = <0xf>;
+};
+
+/* Verdin PWM_3_DSI */
+&pwm1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pwm_1>;
+       #pwm-cells = <3>;
+};
+
+/* Verdin PWM_1 */
+&pwm2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pwm_2>;
+       #pwm-cells = <3>;
+};
+
+/* Verdin PWM_2 */
+&pwm3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pwm_3>;
+       #pwm-cells = <3>;
+};
+
+/* VERDIN I2S_1 */
+&sai2 {
+       #sound-dai-cells = <0>;
+       assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
+       assigned-clock-rates = <24576000>;
+       assigned-clocks = <&clk IMX8MM_CLK_SAI2>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_sai2>;
+};
+
+&snvs_pwrkey {
+       status = "okay";
+};
+
+/* Verdin UART_3, used as the Linux console */
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart1>;
+};
+
+/* Verdin UART_1 */
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart2>;
+       uart-has-rtscts;
+};
+
+/* Verdin UART_2 */
+&uart3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart3>;
+       uart-has-rtscts;
+};
+
+/* Verdin UART_4 */
+/*
+ * Resource allocated to M4 by default, must not be accessed from Cortex-A35 or you get an OOPS
+ */
+&uart4 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart4>;
+};
+
+/* Verdin USB_1 */
+&usbotg1 {
+       adp-disable;
+       dr_mode = "otg";
+       hnp-disable;
+       over-current-active-low;
+       samsung,picophy-dc-vol-level-adjust = <7>;
+       samsung,picophy-pre-emp-curr-control = <3>;
+       srp-disable;
+       vbus-supply = <&reg_usb_otg1_vbus>;
+};
+
+/* Verdin USB_2 */
+&usbotg2 {
+       dr_mode = "host";
+       over-current-active-low;
+       samsung,picophy-dc-vol-level-adjust = <7>;
+       samsung,picophy-pre-emp-curr-control = <3>;
+       vbus-supply = <&reg_usb_otg2_vbus>;
+};
+
+&usbphynop1 {
+       vcc-supply = <&reg_vdd_3v3>;
+};
+
+&usbphynop2 {
+       vcc-supply = <&reg_vdd_3v3>;
+};
+
+/* On-module eMMC */
+&usdhc1 {
+       bus-width = <8>;
+       keep-power-in-suspend;
+       non-removable;
+       pinctrl-names = "default", "state_100mhz", "state_200mhz";
+       pinctrl-0 = <&pinctrl_usdhc1>;
+       pinctrl-1 = <&pinctrl_usdhc1_100mhz>;
+       pinctrl-2 = <&pinctrl_usdhc1_200mhz>;
+       status = "okay";
+};
+
+/* Verdin SD_1 */
+&usdhc2 {
+       bus-width = <4>;
+       cd-gpios = <&gpio2 12 GPIO_ACTIVE_LOW>;
+       disable-wp;
+       pinctrl-names = "default", "state_100mhz", "state_200mhz";
+       pinctrl-0 = <&pinctrl_usdhc2>, <&pinctrl_usdhc2_cd>;
+       pinctrl-1 = <&pinctrl_usdhc2_100mhz>, <&pinctrl_usdhc2_cd>;
+       pinctrl-2 = <&pinctrl_usdhc2_200mhz>, <&pinctrl_usdhc2_cd>;
+       vmmc-supply = <&reg_usdhc2_vmmc>;
+};
+
+&wdog1 {
+       fsl,ext-reset-output;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_wdog>;
+       status = "okay";
+};
+
+&iomuxc {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_gpio1>, <&pinctrl_gpio2>,
+                   <&pinctrl_gpio3>, <&pinctrl_gpio4>,
+                   <&pinctrl_gpio7>, <&pinctrl_gpio8>,
+                   <&pinctrl_gpio_hog1>, <&pinctrl_gpio_hog2>, <&pinctrl_gpio_hog3>,
+                   <&pinctrl_pmic_tpm_ena>;
+
+       pinctrl_can1_int: can1intgrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_GPIO1_IO06_GPIO1_IO6              0x1c4>; /* CAN_1_SPI_INT#_1.8V */
+       };
+
+       pinctrl_can2_int: can2intgrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_GPIO1_IO07_GPIO1_IO7              0x1c4>; /* CAN_2_SPI_INT#_1.8V */
+       };
+
+       pinctrl_ctrl_sleep_moci: ctrlsleepmocigrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SAI3_TXD_GPIO5_IO1                0x1c4>; /* SODIMM 256 */
+       };
+
+       pinctrl_ecspi2: ecspi2grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_ECSPI2_SCLK_ECSPI2_SCLK           0x4>,   /* SODIMM 196 */
+                       <MX8MM_IOMUXC_ECSPI2_MOSI_ECSPI2_MOSI           0x4>,   /* SODIMM 200 */
+                       <MX8MM_IOMUXC_ECSPI2_MISO_ECSPI2_MISO           0x1c4>, /* SODIMM 198 */
+                       <MX8MM_IOMUXC_ECSPI2_SS0_GPIO5_IO13             0x1c4>; /* SODIMM 202 */
+       };
+
+       pinctrl_ecspi3: ecspi3grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_UART1_RXD_ECSPI3_SCLK             0x4>,   /* CAN_SPI_SCK_1.8V */
+                       <MX8MM_IOMUXC_UART1_TXD_ECSPI3_MOSI             0x4>,   /* CAN_SPI_MOSI_1.8V */
+                       <MX8MM_IOMUXC_UART2_RXD_ECSPI3_MISO             0x1c4>, /* CAN_SPI_MISO_1.8V */
+                       <MX8MM_IOMUXC_UART2_TXD_GPIO5_IO25              0x1c4>, /* CAN_1_SPI_CS_1.8V# */
+                       <MX8MM_IOMUXC_GPIO1_IO05_GPIO1_IO5              0x1c4>; /* CAN_2_SPI_CS#_1.8V */
+       };
+
+       pinctrl_fec1: fec1grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_ENET_MDC_ENET1_MDC                0x3>,
+                       <MX8MM_IOMUXC_ENET_MDIO_ENET1_MDIO              0x3>,
+                       <MX8MM_IOMUXC_ENET_TD3_ENET1_RGMII_TD3          0x1f>,
+                       <MX8MM_IOMUXC_ENET_TD2_ENET1_RGMII_TD2          0x1f>,
+                       <MX8MM_IOMUXC_ENET_TD1_ENET1_RGMII_TD1          0x1f>,
+                       <MX8MM_IOMUXC_ENET_TD0_ENET1_RGMII_TD0          0x1f>,
+                       <MX8MM_IOMUXC_ENET_RD3_ENET1_RGMII_RD3          0x91>,
+                       <MX8MM_IOMUXC_ENET_RD2_ENET1_RGMII_RD2          0x91>,
+                       <MX8MM_IOMUXC_ENET_RD1_ENET1_RGMII_RD1          0x91>,
+                       <MX8MM_IOMUXC_ENET_RD0_ENET1_RGMII_RD0          0x91>,
+                       <MX8MM_IOMUXC_ENET_TXC_ENET1_RGMII_TXC          0x1f>,
+                       <MX8MM_IOMUXC_ENET_RXC_ENET1_RGMII_RXC          0x91>,
+                       <MX8MM_IOMUXC_ENET_RX_CTL_ENET1_RGMII_RX_CTL    0x91>,
+                       <MX8MM_IOMUXC_ENET_TX_CTL_ENET1_RGMII_TX_CTL    0x1f>,
+                       <MX8MM_IOMUXC_GPIO1_IO10_GPIO1_IO10             0x1c4>;
+       };
+
+       pinctrl_fec1_sleep: fec1-sleepgrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_ENET_MDC_ENET1_MDC                0x3>,
+                       <MX8MM_IOMUXC_ENET_MDIO_ENET1_MDIO              0x3>,
+                       <MX8MM_IOMUXC_ENET_TD3_GPIO1_IO18               0x1f>,
+                       <MX8MM_IOMUXC_ENET_TD2_GPIO1_IO19               0x1f>,
+                       <MX8MM_IOMUXC_ENET_TD1_GPIO1_IO20               0x1f>,
+                       <MX8MM_IOMUXC_ENET_TD0_GPIO1_IO21               0x1f>,
+                       <MX8MM_IOMUXC_ENET_RD3_ENET1_RGMII_RD3          0x91>,
+                       <MX8MM_IOMUXC_ENET_RD2_ENET1_RGMII_RD2          0x91>,
+                       <MX8MM_IOMUXC_ENET_RD1_ENET1_RGMII_RD1          0x91>,
+                       <MX8MM_IOMUXC_ENET_RD0_ENET1_RGMII_RD0          0x91>,
+                       <MX8MM_IOMUXC_ENET_TXC_GPIO1_IO23               0x1f>,
+                       <MX8MM_IOMUXC_ENET_RXC_ENET1_RGMII_RXC          0x91>,
+                       <MX8MM_IOMUXC_ENET_RX_CTL_ENET1_RGMII_RX_CTL    0x91>,
+                       <MX8MM_IOMUXC_ENET_TX_CTL_GPIO1_IO22            0x1f>,
+                       <MX8MM_IOMUXC_GPIO1_IO10_GPIO1_IO10             0x184>;
+       };
+
+       pinctrl_flexspi0: flexspi0grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_NAND_ALE_QSPI_A_SCLK              0x1c2>, /* SODIMM 52 */
+                       <MX8MM_IOMUXC_NAND_CE0_B_QSPI_A_SS0_B           0x82>,  /* SODIMM 54 */
+                       <MX8MM_IOMUXC_NAND_CE1_B_QSPI_A_SS1_B           0x82>,  /* SODIMM 64 */
+                       <MX8MM_IOMUXC_NAND_DQS_QSPI_A_DQS               0x82>,  /* SODIMM 66 */
+                       <MX8MM_IOMUXC_NAND_DATA00_QSPI_A_DATA0          0x82>,  /* SODIMM 56 */
+                       <MX8MM_IOMUXC_NAND_DATA01_QSPI_A_DATA1          0x82>,  /* SODIMM 58 */
+                       <MX8MM_IOMUXC_NAND_DATA02_QSPI_A_DATA2          0x82>,  /* SODIMM 60 */
+                       <MX8MM_IOMUXC_NAND_DATA03_QSPI_A_DATA3          0x82>;  /* SODIMM 62 */
+       };
+
+       pinctrl_gpio1: gpio1grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_NAND_CE3_B_GPIO3_IO4              0x184>; /* SODIMM 206 */
+       };
+
+       pinctrl_gpio2: gpio2grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SPDIF_EXT_CLK_GPIO5_IO5           0x1c4>; /* SODIMM 208 */
+       };
+
+       pinctrl_gpio3: gpio3grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_UART3_RXD_GPIO5_IO26              0x184>; /* SODIMM 210 */
+       };
+
+       pinctrl_gpio4: gpio4grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_UART3_TXD_GPIO5_IO27              0x184>; /* SODIMM 212 */
+       };
+
+       pinctrl_gpio5: gpio5grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_GPIO1_IO00_GPIO1_IO0              0x184>; /* SODIMM 216 */
+       };
+
+       pinctrl_gpio6: gpio6grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_GPIO1_IO11_GPIO1_IO11             0x184>; /* SODIMM 218 */
+       };
+
+       pinctrl_gpio7: gpio7grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_GPIO1_IO08_GPIO1_IO8              0x184>; /* SODIMM 220 */
+       };
+
+       pinctrl_gpio8: gpio8grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_GPIO1_IO09_GPIO1_IO9              0x184>; /* SODIMM 222 */
+       };
+
+       /* Verdin GPIO_9_DSI (pulled-up as active-low) */
+       pinctrl_gpio_9_dsi: gpio9dsigrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_NAND_RE_B_GPIO3_IO15              0x1c4>; /* SODIMM 17 */
+       };
+
+       /* Verdin GPIO_10_DSI */
+       pinctrl_gpio_10_dsi: gpio10dsigrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_NAND_CE2_B_GPIO3_IO3              0x1c4>; /* SODIMM 21 */
+       };
+
+       pinctrl_gpio_hog1: gpiohog1grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SAI1_MCLK_GPIO4_IO20              0x1c4>, /* SODIMM 88 */
+                       <MX8MM_IOMUXC_SAI1_RXC_GPIO4_IO1                0x1c4>, /* SODIMM 90 */
+                       <MX8MM_IOMUXC_SAI1_RXD0_GPIO4_IO2               0x1c4>, /* SODIMM 92 */
+                       <MX8MM_IOMUXC_SAI1_RXD1_GPIO4_IO3               0x1c4>, /* SODIMM 94 */
+                       <MX8MM_IOMUXC_SAI1_RXD2_GPIO4_IO4               0x1c4>, /* SODIMM 96 */
+                       <MX8MM_IOMUXC_SAI1_RXD3_GPIO4_IO5               0x1c4>, /* SODIMM 100 */
+                       <MX8MM_IOMUXC_SAI1_RXFS_GPIO4_IO0               0x1c4>, /* SODIMM 102 */
+                       <MX8MM_IOMUXC_SAI1_TXC_GPIO4_IO11               0x1c4>, /* SODIMM 104 */
+                       <MX8MM_IOMUXC_SAI1_TXD0_GPIO4_IO12              0x1c4>, /* SODIMM 106 */
+                       <MX8MM_IOMUXC_SAI1_TXD1_GPIO4_IO13              0x1c4>, /* SODIMM 108 */
+                       <MX8MM_IOMUXC_SAI1_TXD2_GPIO4_IO14              0x1c4>, /* SODIMM 112 */
+                       <MX8MM_IOMUXC_SAI1_TXD3_GPIO4_IO15              0x1c4>, /* SODIMM 114 */
+                       <MX8MM_IOMUXC_SAI1_TXD4_GPIO4_IO16              0x1c4>, /* SODIMM 116 */
+                       <MX8MM_IOMUXC_SAI1_TXD6_GPIO4_IO18              0x1c4>, /* SODIMM 118 */
+                       <MX8MM_IOMUXC_SAI1_TXFS_GPIO4_IO10              0x1c4>; /* SODIMM 120 */
+       };
+
+       pinctrl_gpio_hog2: gpiohog2grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SAI3_MCLK_GPIO5_IO2               0x1c4>; /* SODIMM 91 */
+       };
+
+       pinctrl_gpio_hog3: gpiohog3grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_GPIO1_IO13_GPIO1_IO13             0x1c4>, /* SODIMM 157 */
+                       <MX8MM_IOMUXC_GPIO1_IO15_GPIO1_IO15             0x1c4>; /* SODIMM 187 */
+       };
+
+       pinctrl_gpio_keys: gpiokeysgrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SAI3_RXFS_GPIO4_IO28              0x1c4>; /* SODIMM 252 */
+       };
+
+       /* On-module I2C */
+       pinctrl_i2c1: i2c1grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_I2C1_SCL_I2C1_SCL                 0x400001c6>,    /* PMIC_I2C_SCL */
+                       <MX8MM_IOMUXC_I2C1_SDA_I2C1_SDA                 0x400001c6>;    /* PMIC_I2C_SDA */
+       };
+
+       pinctrl_i2c1_gpio: i2c1gpiogrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_I2C1_SCL_GPIO5_IO14               0x400001c6>,    /* PMIC_I2C_SCL */
+                       <MX8MM_IOMUXC_I2C1_SDA_GPIO5_IO15               0x400001c6>;    /* PMIC_I2C_SDA */
+       };
+
+       /* Verdin I2C_4_CSI */
+       pinctrl_i2c2: i2c2grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_I2C2_SCL_I2C2_SCL                 0x400001c6>,    /* SODIMM 55 */
+                       <MX8MM_IOMUXC_I2C2_SDA_I2C2_SDA                 0x400001c6>;    /* SODIMM 53 */
+       };
+
+       pinctrl_i2c2_gpio: i2c2gpiogrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_I2C2_SCL_GPIO5_IO16               0x400001c6>,    /* SODIMM 55 */
+                       <MX8MM_IOMUXC_I2C2_SDA_GPIO5_IO17               0x400001c6>;    /* SODIMM 53 */
+       };
+
+       /* Verdin I2C_2_DSI */
+       pinctrl_i2c3: i2c3grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_I2C3_SCL_I2C3_SCL                 0x400001c6>,    /* SODIMM 95 */
+                       <MX8MM_IOMUXC_I2C3_SDA_I2C3_SDA                 0x400001c6>;    /* SODIMM 93 */
+       };
+
+       pinctrl_i2c3_gpio: i2c3gpiogrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_I2C3_SCL_GPIO5_IO18               0x400001c6>,    /* SODIMM 95 */
+                       <MX8MM_IOMUXC_I2C3_SDA_GPIO5_IO19               0x400001c6>;    /* SODIMM 93 */
+       };
+
+       /* Verdin I2C_1 */
+       pinctrl_i2c4: i2c4grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_I2C4_SCL_I2C4_SCL                 0x400001c6>,    /* SODIMM 14 */
+                       <MX8MM_IOMUXC_I2C4_SDA_I2C4_SDA                 0x400001c6>;    /* SODIMM 12 */
+       };
+
+       pinctrl_i2c4_gpio: i2c4gpiogrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_I2C4_SCL_GPIO5_IO20               0x400001c6>,    /* SODIMM 14 */
+                       <MX8MM_IOMUXC_I2C4_SDA_GPIO5_IO21               0x400001c6>;    /* SODIMM 12 */
+       };
+
+       /* Verdin I2S_2_BCLK (TOUCH_RESET#) */
+       pinctrl_i2s_2_bclk_touch_reset: i2s2bclktouchresetgrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SAI5_RXD2_GPIO3_IO23              0x184>; /* SODIMM 42 */
+       };
+
+       /* Verdin I2S_2_D_OUT shared with SAI5 */
+       pinctrl_i2s_2_d_out_dsi_1_bkl_en: i2s2doutdsi1bklengrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SAI5_RXD3_GPIO3_IO24              0x184>; /* SODIMM 46 */
+       };
+
+       pinctrl_pcie0: pcie0grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SAI5_RXFS_GPIO3_IO19              0x6>,   /* SODIMM 244 */
+                       /* PMIC_EN_PCIe_CLK, unused */
+                       <MX8MM_IOMUXC_SD2_RESET_B_GPIO2_IO19            0x6>;
+       };
+
+       pinctrl_pmic: pmicirqgrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_GPIO1_IO03_GPIO1_IO3              0x41>;  /* PMIC_INT# */
+       };
+
+       /* Verdin PWM_3_DSI shared with GPIO1_IO1 */
+       pinctrl_pwm_1: pwm1grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_GPIO1_IO01_PWM1_OUT               0x6>;   /* SODIMM 19 */
+       };
+
+       pinctrl_pwm_2: pwm2grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SPDIF_RX_PWM2_OUT                 0x6>;   /* SODIMM 15 */
+       };
+
+       pinctrl_pwm_3: pwm3grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SPDIF_TX_PWM3_OUT                 0x6>;   /* SODIMM 16 */
+       };
+
+       /* Verdin PWM_3_DSI (pulled-down as active-high) shared with PWM1_OUT */
+       pinctrl_pwm_3_dsi_hpd_gpio: pwm3dsihpdgpiogrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_GPIO1_IO01_GPIO1_IO1              0x184>; /* SODIMM 19 */
+       };
+
+       pinctrl_reg_eth: regethgrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SD2_WP_GPIO2_IO20                 0x184>; /* PMIC_EN_ETH */
+       };
+
+       pinctrl_reg_usb1_en: regusb1engrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_GPIO1_IO12_GPIO1_IO12             0x184>; /* SODIMM 155 */
+       };
+
+       pinctrl_reg_usb2_en: regusb2engrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_GPIO1_IO14_GPIO1_IO14             0x184>; /* SODIMM 185 */
+       };
+
+       pinctrl_sai2: sai2grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SAI2_TXFS_SAI2_TX_SYNC            0xd6>,  /* SODIMM 32 */
+                       <MX8MM_IOMUXC_SAI2_TXC_SAI2_TX_BCLK             0xd6>,  /* SODIMM 30 */
+                       <MX8MM_IOMUXC_SAI2_MCLK_SAI2_MCLK               0xd6>,  /* SODIMM 38 */
+                       <MX8MM_IOMUXC_SAI2_RXD0_SAI2_RX_DATA0           0xd6>,  /* SODIMM 36 */
+                       <MX8MM_IOMUXC_SAI2_TXD0_SAI2_TX_DATA0           0xd6>;  /* SODIMM 34 */
+       };
+
+       pinctrl_sai5: sai5grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SAI5_RXD0_SAI5_RX_DATA0           0xd6>,  /* SODIMM 48 */
+                       <MX8MM_IOMUXC_SAI5_RXD1_SAI5_TX_SYNC            0xd6>,  /* SODIMM 44 */
+                       <MX8MM_IOMUXC_SAI5_RXD2_SAI5_TX_BCLK            0xd6>,  /* SODIMM 42 */
+                       <MX8MM_IOMUXC_SAI5_RXD3_SAI5_TX_DATA0           0xd6>;  /* SODIMM 46 */
+       };
+
+       /* control signal for optional ATTPM20P or SE050 */
+       pinctrl_pmic_tpm_ena: pmictpmenagrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SAI1_TXD7_GPIO4_IO19              0x1c4>; /* PMIC_TPM_ENA */
+       };
+
+       pinctrl_tsp: tspgrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SAI1_RXD4_GPIO4_IO6               0x140>, /* SODIMM 148 */
+                       <MX8MM_IOMUXC_SAI1_RXD5_GPIO4_IO7               0x140>, /* SODIMM 152 */
+                       <MX8MM_IOMUXC_SAI1_RXD6_GPIO4_IO8               0x140>, /* SODIMM 154 */
+                       <MX8MM_IOMUXC_SAI1_RXD7_GPIO4_IO9               0x140>, /* SODIMM 174 */
+                       <MX8MM_IOMUXC_SAI1_TXD5_GPIO4_IO17              0x140>; /* SODIMM 150 */
+       };
+
+       pinctrl_uart1: uart1grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SAI2_RXFS_UART1_DCE_TX            0x1c4>, /* SODIMM 149 */
+                       <MX8MM_IOMUXC_SAI2_RXC_UART1_DCE_RX             0x1c4>; /* SODIMM 147 */
+       };
+
+       pinctrl_uart2: uart2grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SAI3_TXFS_UART2_DCE_RX            0x1c4>, /* SODIMM 129 */
+                       <MX8MM_IOMUXC_SAI3_TXC_UART2_DCE_TX             0x1c4>, /* SODIMM 131 */
+                       <MX8MM_IOMUXC_SAI3_RXC_UART2_DCE_CTS_B          0x1c4>, /* SODIMM 133 */
+                       <MX8MM_IOMUXC_SAI3_RXD_UART2_DCE_RTS_B          0x1c4>; /* SODIMM 135 */
+       };
+
+       pinctrl_uart3: uart3grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_ECSPI1_SCLK_UART3_DCE_RX          0x1c4>, /* SODIMM 137 */
+                       <MX8MM_IOMUXC_ECSPI1_MOSI_UART3_DCE_TX          0x1c4>, /* SODIMM 139 */
+                       <MX8MM_IOMUXC_ECSPI1_MISO_UART3_DCE_CTS_B       0x1c4>, /* SODIMM 141 */
+                       <MX8MM_IOMUXC_ECSPI1_SS0_UART3_DCE_RTS_B        0x1c4>; /* SODIMM 143 */
+       };
+
+       pinctrl_uart4: uart4grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_UART4_RXD_UART4_DCE_RX            0x1c4>, /* SODIMM 151 */
+                       <MX8MM_IOMUXC_UART4_TXD_UART4_DCE_TX            0x1c4>; /* SODIMM 153 */
+       };
+
+       pinctrl_usdhc1: usdhc1grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SD1_CLK_USDHC1_CLK                0x190>,
+                       <MX8MM_IOMUXC_SD1_CMD_USDHC1_CMD                0x1d0>,
+                       <MX8MM_IOMUXC_SD1_DATA0_USDHC1_DATA0            0x1d0>,
+                       <MX8MM_IOMUXC_SD1_DATA1_USDHC1_DATA1            0x1d0>,
+                       <MX8MM_IOMUXC_SD1_DATA2_USDHC1_DATA2            0x1d0>,
+                       <MX8MM_IOMUXC_SD1_DATA3_USDHC1_DATA3            0x1d0>,
+                       <MX8MM_IOMUXC_SD1_DATA4_USDHC1_DATA4            0x1d0>,
+                       <MX8MM_IOMUXC_SD1_DATA5_USDHC1_DATA5            0x1d0>,
+                       <MX8MM_IOMUXC_SD1_DATA6_USDHC1_DATA6            0x1d0>,
+                       <MX8MM_IOMUXC_SD1_DATA7_USDHC1_DATA7            0x1d0>,
+                       <MX8MM_IOMUXC_SD1_RESET_B_USDHC1_RESET_B        0x1d1>,
+                       <MX8MM_IOMUXC_SD1_STROBE_USDHC1_STROBE          0x190>;
+       };
+
+       pinctrl_usdhc1_100mhz: usdhc1-100mhzgrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SD1_CLK_USDHC1_CLK                0x194>,
+                       <MX8MM_IOMUXC_SD1_CMD_USDHC1_CMD                0x1d4>,
+                       <MX8MM_IOMUXC_SD1_DATA0_USDHC1_DATA0            0x1d4>,
+                       <MX8MM_IOMUXC_SD1_DATA1_USDHC1_DATA1            0x1d4>,
+                       <MX8MM_IOMUXC_SD1_DATA2_USDHC1_DATA2            0x1d4>,
+                       <MX8MM_IOMUXC_SD1_DATA3_USDHC1_DATA3            0x1d4>,
+                       <MX8MM_IOMUXC_SD1_DATA4_USDHC1_DATA4            0x1d4>,
+                       <MX8MM_IOMUXC_SD1_DATA5_USDHC1_DATA5            0x1d4>,
+                       <MX8MM_IOMUXC_SD1_DATA6_USDHC1_DATA6            0x1d4>,
+                       <MX8MM_IOMUXC_SD1_DATA7_USDHC1_DATA7            0x1d4>,
+                       <MX8MM_IOMUXC_SD1_RESET_B_USDHC1_RESET_B        0x1d1>,
+                       <MX8MM_IOMUXC_SD1_STROBE_USDHC1_STROBE          0x194>;
+       };
+
+       pinctrl_usdhc1_200mhz: usdhc1-200mhzgrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SD1_CLK_USDHC1_CLK                0x196>,
+                       <MX8MM_IOMUXC_SD1_CMD_USDHC1_CMD                0x1d6>,
+                       <MX8MM_IOMUXC_SD1_DATA0_USDHC1_DATA0            0x1d6>,
+                       <MX8MM_IOMUXC_SD1_DATA1_USDHC1_DATA1            0x1d6>,
+                       <MX8MM_IOMUXC_SD1_DATA2_USDHC1_DATA2            0x1d6>,
+                       <MX8MM_IOMUXC_SD1_DATA3_USDHC1_DATA3            0x1d6>,
+                       <MX8MM_IOMUXC_SD1_DATA4_USDHC1_DATA4            0x1d6>,
+                       <MX8MM_IOMUXC_SD1_DATA5_USDHC1_DATA5            0x1d6>,
+                       <MX8MM_IOMUXC_SD1_DATA6_USDHC1_DATA6            0x1d6>,
+                       <MX8MM_IOMUXC_SD1_DATA7_USDHC1_DATA7            0x1d6>,
+                       <MX8MM_IOMUXC_SD1_RESET_B_USDHC1_RESET_B        0x1d1>,
+                       <MX8MM_IOMUXC_SD1_STROBE_USDHC1_STROBE          0x196>;
+       };
+
+       pinctrl_usdhc2_cd: usdhc2cdgrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12               0x1c4>; /* SODIMM 84 */
+       };
+
+       pinctrl_usdhc2_pwr_en: usdhc2pwrengrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_NAND_CLE_GPIO3_IO5                0x184>; /* SODIMM 76 */
+       };
+
+       pinctrl_usdhc2: usdhc2grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK                0x190>, /* SODIMM 78 */
+                       <MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD                0x1d0>, /* SODIMM 74 */
+                       <MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0            0x1d0>, /* SODIMM 80 */
+                       <MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1            0x1d0>, /* SODIMM 82 */
+                       <MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2            0x1d0>, /* SODIMM 70 */
+                       <MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3            0x1d0>, /* SODIMM 72 */
+                       <MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT         0x1d0>;
+       };
+
+       pinctrl_usdhc2_100mhz: usdhc2-100mhzgrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK                0x194>,
+                       <MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD                0x1d4>,
+                       <MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0            0x1d4>,
+                       <MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1            0x1d4>,
+                       <MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2            0x1d4>,
+                       <MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3            0x1d4>,
+                       <MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT         0x1d0>;
+       };
+
+       pinctrl_usdhc2_200mhz: usdhc2-200mhzgrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK                0x196>,
+                       <MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD                0x1d6>,
+                       <MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0            0x1d6>,
+                       <MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1            0x1d6>,
+                       <MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2            0x1d6>,
+                       <MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3            0x1d6>,
+                       <MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT         0x1d0>;
+       };
+
+       /* On-module Wi-Fi/BT or type specific SDHC interface */
+       /* (e.g. on X52 extension slot of Verdin Development Board) */
+       pinctrl_usdhc3: usdhc3grp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK              0x190>,
+                       <MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD              0x1d0>,
+                       <MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0          0x1d0>,
+                       <MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1          0x1d0>,
+                       <MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2          0x1d0>,
+                       <MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3          0x1d0>;
+       };
+
+       pinctrl_usdhc3_100mhz: usdhc3-100mhzgrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK              0x194>,
+                       <MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD              0x1d4>,
+                       <MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0          0x1d4>,
+                       <MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1          0x1d4>,
+                       <MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2          0x1d4>,
+                       <MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3          0x1d4>;
+       };
+
+       pinctrl_usdhc3_200mhz: usdhc3-200mhzgrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK              0x196>,
+                       <MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD              0x1d6>,
+                       <MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0          0x1d6>,
+                       <MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1          0x1d6>,
+                       <MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2          0x1d6>,
+                       <MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3          0x1d6>;
+       };
+
+       pinctrl_wdog: wdoggrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B           0xc6>;  /* PMIC_WDI */
+       };
+
+       pinctrl_wifi_ctrl: wifictrlgrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_NAND_READY_B_GPIO3_IO16           0x1c4>, /* WIFI_WKUP_BT */
+                       <MX8MM_IOMUXC_SAI1_RXD7_GPIO4_IO9               0x1c4>, /* WIFI_W_WKUP_HOST */
+                       <MX8MM_IOMUXC_SAI5_RXC_GPIO3_IO20               0x1c4>; /* WIFI_WKUP_WLAN */
+       };
+
+       pinctrl_wifi_i2s: bti2sgrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SAI1_RXD4_SAI6_TX_BCLK            0xd6>,  /* WIFI_TX_BCLK */
+                       <MX8MM_IOMUXC_SAI1_RXD5_SAI6_TX_DATA0           0xd6>,  /* WIFI_TX_DATA0 */
+                       <MX8MM_IOMUXC_SAI1_RXD6_SAI6_TX_SYNC            0xd6>,  /* WIFI_TX_SYNC */
+                       <MX8MM_IOMUXC_SAI1_TXD5_SAI6_RX_DATA0           0xd6>;  /* WIFI_RX_DATA0 */
+       };
+
+       pinctrl_wifi_pwr_en: wifipwrengrp {
+               fsl,pins =
+                       <MX8MM_IOMUXC_SAI5_MCLK_GPIO3_IO25              0x184>; /* PMIC_EN_WIFI */
+       };
+};
index f77f90e..2692f3a 100644 (file)
                        };
 
                        gpr: iomuxc-gpr@30340000 {
-                               compatible = "fsl,imx8mm-iomuxc-gpr", "syscon";
+                               compatible = "fsl,imx8mm-iomuxc-gpr", "fsl,imx6q-iomuxc-gpr", "syscon";
                                reg = <0x30340000 0x10000>;
                        };
 
                                reg = <0x32e50200 0x200>;
                        };
 
+                       pcie_phy: pcie-phy@32f00000 {
+                               compatible = "fsl,imx8mm-pcie-phy";
+                               reg = <0x32f00000 0x10000>;
+                               clocks = <&clk IMX8MM_CLK_PCIE1_PHY>;
+                               clock-names = "ref";
+                               assigned-clocks = <&clk IMX8MM_CLK_PCIE1_PHY>;
+                               assigned-clock-rates = <100000000>;
+                               assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_100M>;
+                               resets = <&src IMX8MQ_RESET_PCIEPHY>;
+                               reset-names = "pciephy";
+                               #phy-cells = <0>;
+                               status = "disabled";
+                       };
                };
 
                dma_apbh: dma-controller@33000000 {
                        status = "disabled";
                };
 
+               pcie0: pcie@33800000 {
+                       compatible = "fsl,imx8mm-pcie";
+                       reg = <0x33800000 0x400000>, <0x1ff00000 0x80000>;
+                       reg-names = "dbi", "config";
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+                       device_type = "pci";
+                       bus-range = <0x00 0xff>;
+                       ranges =  <0x81000000 0 0x00000000 0x1ff80000 0 0x00010000 /* downstream I/O 64KB */
+                                  0x82000000 0 0x18000000 0x18000000 0 0x07f00000>; /* non-prefetchable memory */
+                       num-lanes = <1>;
+                       num-viewport = <4>;
+                       interrupts = <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "msi";
+                       #interrupt-cells = <1>;
+                       interrupt-map-mask = <0 0 0 0x7>;
+                       interrupt-map = <0 0 0 1 &gic GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
+                                       <0 0 0 2 &gic GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>,
+                                       <0 0 0 3 &gic GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
+                                       <0 0 0 4 &gic GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>;
+                       fsl,max-link-speed = <2>;
+                       linux,pci-domain = <0>;
+                       power-domains = <&pgc_pcie>;
+                       resets = <&src IMX8MQ_RESET_PCIE_CTRL_APPS_EN>,
+                                <&src IMX8MQ_RESET_PCIE_CTRL_APPS_TURNOFF>;
+                       reset-names = "apps", "turnoff";
+                       phys = <&pcie_phy>;
+                       phy-names = "pcie-phy";
+                       status = "disabled";
+               };
+
                gpu_3d: gpu@38000000 {
                        compatible = "vivante,gc";
                        reg = <0x38000000 0x8000>;
                        power-domains = <&pgc_gpu>;
                };
 
+               vpu_g1: video-codec@38300000 {
+                       compatible = "nxp,imx8mm-vpu-g1";
+                       reg = <0x38300000 0x10000>;
+                       interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clk IMX8MM_CLK_VPU_G1_ROOT>;
+                       power-domains = <&vpu_blk_ctrl IMX8MM_VPUBLK_PD_G1>;
+               };
+
+               vpu_g2: video-codec@38310000 {
+                       compatible = "nxp,imx8mq-vpu-g2";
+                       reg = <0x38310000 0x10000>;
+                       interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clk IMX8MM_CLK_VPU_G2_ROOT>;
+                       power-domains = <&vpu_blk_ctrl IMX8MM_VPUBLK_PD_G2>;
+               };
+
                vpu_blk_ctrl: blk-ctrl@38330000 {
                        compatible = "fsl,imx8mm-vpu-blk-ctrl", "syscon";
                        reg = <0x38330000 0x100>;
                                 <&clk IMX8MM_CLK_VPU_G2_ROOT>,
                                 <&clk IMX8MM_CLK_VPU_H1_ROOT>;
                        clock-names = "g1", "g2", "h1";
+                       assigned-clocks = <&clk IMX8MM_CLK_VPU_G1>,
+                                         <&clk IMX8MM_CLK_VPU_G2>;
+                       assigned-clock-parents = <&clk IMX8MM_VPU_PLL_OUT>,
+                                                <&clk IMX8MM_VPU_PLL_OUT>;
+                       assigned-clock-rates = <600000000>,
+                                              <600000000>;
                        #power-domain-cells = <1>;
                };
 
index 236f425..3c0e63d 100644 (file)
        };
 };
 
+&disp_blk_ctrl {
+       status = "disabled";
+};
+
 /* off-board header */
 &ecspi2 {
        pinctrl-names = "default";
        };
 };
 
+&gpio1 {
+       gpio-line-names = "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "m2_reset", "", "m2_wdis#",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "";
+};
+
+&gpio2 {
+       gpio-line-names = "", "", "", "", "", "", "", "",
+               "uart2_en#", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "";
+};
+
+&gpio3 {
+       gpio-line-names = "", "m2_gdis#", "", "", "", "", "", "m2_off#",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "";
+};
+
+&gpio4 {
+       gpio-line-names = "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "app_gpio1", "", "uart1_rs485",
+               "", "uart1_term", "uart1_half", "app_gpio2",
+               "mipi_gpio1", "", "", "";
+};
+
+&gpio5 {
+       gpio-line-names = "", "", "", "mipi_gpio4",
+               "mipi_gpio3", "mipi_gpio2", "", "",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "";
+};
+
+&gpu {
+       status = "disabled";
+};
+
 &i2c1 {
        clock-frequency = <100000>;
        pinctrl-names = "default";
        status = "okay";
 };
 
+&pgc_gpumix {
+       status = "disabled";
+};
+
 /* off-board header */
 &sai3 {
        pinctrl-names = "default";
        pinctrl_hog: hoggrp {
                fsl,pins = <
                        MX8MN_IOMUXC_NAND_CE0_B_GPIO3_IO1       0x40000159 /* M2_GDIS# */
-                       MX8MN_IOMUXC_GPIO1_IO13_GPIO1_IO13      0x40000041 /* M2_RST# */
+                       MX8MN_IOMUXC_GPIO1_IO13_GPIO1_IO13      0x40000041 /* M2_RESET */
                        MX8MN_IOMUXC_NAND_DATA01_GPIO3_IO7      0x40000119 /* M2_OFF# */
                        MX8MN_IOMUXC_GPIO1_IO15_GPIO1_IO15      0x40000159 /* M2_WDIS# */
                        MX8MN_IOMUXC_SAI2_RXFS_GPIO4_IO21       0x40000041 /* APP GPIO1 */
index b8d49d5..99f0f50 100644 (file)
@@ -4,6 +4,8 @@
  */
 
 #include <dt-bindings/clock/imx8mn-clock.h>
+#include <dt-bindings/power/imx8mn-power.h>
+#include <dt-bindings/reset/imx8mq-reset.h>
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
                                interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
                                #reset-cells = <1>;
                        };
+
+                       gpc: gpc@303a0000 {
+                               compatible = "fsl,imx8mn-gpc";
+                               reg = <0x303a0000 0x10000>;
+                               interrupt-parent = <&gic>;
+                               interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>;
+
+                               pgc {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       pgc_hsiomix: power-domain@0 {
+                                               #power-domain-cells = <0>;
+                                               reg = <IMX8MN_POWER_DOMAIN_HSIOMIX>;
+                                               clocks = <&clk IMX8MN_CLK_USB_BUS>;
+                                       };
+
+                                       pgc_otg1: power-domain@1 {
+                                               #power-domain-cells = <0>;
+                                               reg = <IMX8MN_POWER_DOMAIN_OTG1>;
+                                               power-domains = <&pgc_hsiomix>;
+                                       };
+
+                                       pgc_gpumix: power-domain@2 {
+                                               #power-domain-cells = <0>;
+                                               reg = <IMX8MN_POWER_DOMAIN_GPUMIX>;
+                                               clocks = <&clk IMX8MN_CLK_GPU_CORE_ROOT>,
+                                                        <&clk IMX8MN_CLK_GPU_SHADER>,
+                                                        <&clk IMX8MN_CLK_GPU_BUS_ROOT>,
+                                                        <&clk IMX8MN_CLK_GPU_AHB>;
+                                               resets = <&src IMX8MQ_RESET_GPU_RESET>;
+                                       };
+
+                                       pgc_dispmix: power-domain@3 {
+                                               #power-domain-cells = <0>;
+                                               reg = <IMX8MN_POWER_DOMAIN_DISPMIX>;
+                                               clocks = <&clk IMX8MN_CLK_DISP_AXI_ROOT>,
+                                                        <&clk IMX8MN_CLK_DISP_APB_ROOT>;
+                                       };
+
+                                       pgc_mipi: power-domain@4 {
+                                               #power-domain-cells = <0>;
+                                               reg = <IMX8MN_POWER_DOMAIN_MIPI>;
+                                               power-domains = <&pgc_dispmix>;
+                                       };
+                               };
+                       };
                };
 
                aips2: bus@30400000 {
                        #size-cells = <1>;
                        ranges;
 
+                       disp_blk_ctrl: blk-ctrl@32e28000 {
+                               compatible = "fsl,imx8mn-disp-blk-ctrl", "syscon";
+                               reg = <0x32e28000 0x100>;
+                               power-domains = <&pgc_dispmix>, <&pgc_dispmix>,
+                                               <&pgc_dispmix>, <&pgc_mipi>,
+                                               <&pgc_mipi>;
+                               power-domain-names = "bus", "isi",
+                                                    "lcdif", "mipi-dsi",
+                                                    "mipi-csi";
+                               clocks = <&clk IMX8MN_CLK_DISP_AXI>,
+                                        <&clk IMX8MN_CLK_DISP_APB>,
+                                        <&clk IMX8MN_CLK_DISP_AXI_ROOT>,
+                                        <&clk IMX8MN_CLK_DISP_APB_ROOT>,
+                                        <&clk IMX8MN_CLK_DISP_AXI_ROOT>,
+                                        <&clk IMX8MN_CLK_DISP_APB_ROOT>,
+                                        <&clk IMX8MN_CLK_DISP_PIXEL_ROOT>,
+                                        <&clk IMX8MN_CLK_DSI_CORE>,
+                                        <&clk IMX8MN_CLK_DSI_PHY_REF>,
+                                        <&clk IMX8MN_CLK_CSI1_PHY_REF>,
+                                        <&clk IMX8MN_CLK_CAMERA_PIXEL_ROOT>;
+                               clock-names = "disp_axi", "disp_apb",
+                                             "disp_axi_root", "disp_apb_root",
+                                             "lcdif-axi", "lcdif-apb", "lcdif-pix",
+                                             "dsi-pclk", "dsi-ref",
+                                             "csi-aclk", "csi-pclk";
+                               #power-domain-cells = <1>;
+                       };
+
                        usbotg1: usb@32e40000 {
                                compatible = "fsl,imx8mn-usb", "fsl,imx7d-usb";
                                reg = <0x32e40000 0x200>;
                                assigned-clock-parents = <&clk IMX8MN_SYS_PLL2_500M>;
                                phys = <&usbphynop1>;
                                fsl,usbmisc = <&usbmisc1 0>;
+                               power-domains = <&pgc_otg1>;
                                status = "disabled";
                        };
 
                        status = "disabled";
                };
 
+               gpu: gpu@38000000 {
+                       compatible = "vivante,gc";
+                       reg = <0x38000000 0x8000>;
+                       interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clk IMX8MN_CLK_GPU_AHB>,
+                               <&clk IMX8MN_CLK_GPU_BUS_ROOT>,
+                               <&clk IMX8MN_CLK_GPU_CORE_ROOT>,
+                               <&clk IMX8MN_CLK_GPU_SHADER>;
+                       clock-names = "reg", "bus", "core", "shader";
+                       assigned-clocks = <&clk IMX8MN_CLK_GPU_CORE>,
+                                         <&clk IMX8MN_CLK_GPU_SHADER>,
+                                         <&clk IMX8MN_CLK_GPU_AXI>,
+                                         <&clk IMX8MN_CLK_GPU_AHB>,
+                                         <&clk IMX8MN_GPU_PLL>;
+                       assigned-clock-parents = <&clk IMX8MN_GPU_PLL_OUT>,
+                                                 <&clk IMX8MN_GPU_PLL_OUT>,
+                                                 <&clk IMX8MN_SYS_PLL1_800M>,
+                                                 <&clk IMX8MN_SYS_PLL1_800M>;
+                       assigned-clock-rates = <400000000>,
+                                              <400000000>,
+                                              <800000000>,
+                                              <400000000>,
+                                              <1200000000>;
+                       power-domains = <&pgc_gpumix>;
+               };
+
                gic: interrupt-controller@38800000 {
                        compatible = "arm,gic-v3";
                        reg = <0x38800000 0x10000>,
index 2eb9432..4c3ac42 100644 (file)
                reg = <0x20>;
                gpio-controller;
                #gpio-cells = <2>;
+               interrupt-controller;
+               #interrupt-cells = <2>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_pca6416_int>;
+               interrupt-parent = <&gpio1>;
+               interrupts = <12 IRQ_TYPE_LEVEL_LOW>;
+               gpio-line-names = "EXT_PWREN1",
+                       "EXT_PWREN2",
+                       "CAN1/I2C5_SEL",
+                       "PDM/CAN2_SEL",
+                       "FAN_EN",
+                       "PWR_MEAS_IO1",
+                       "PWR_MEAS_IO2",
+                       "EXP_P0_7",
+                       "EXP_P1_0",
+                       "EXP_P1_1",
+                       "EXP_P1_2",
+                       "EXP_P1_3",
+                       "EXP_P1_4",
+                       "EXP_P1_5",
+                       "EXP_P1_6",
+                       "EXP_P1_7";
        };
 };
 
+/* I2C on expansion connector J22. */
+&i2c5 {
+       clock-frequency = <100000>; /* Lower clock speed for external bus. */
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c5>;
+       status = "disabled"; /* can1 pins conflict with i2c5 */
+
+       /* GPIO 2 of PCA6416 is used to switch between CAN1 and I2C5 functions:
+        *     LOW:  CAN1 (default, pull-down)
+        *     HIGH: I2C5
+        * You need to set it to high to enable I2C5 (for example, add gpio-hog
+        * in pca6416 node).
+        */
+};
+
 &snvs_pwrkey {
        status = "okay";
 };
                >;
        };
 
+       pinctrl_i2c5: i2c5grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_SPDIF_RX__I2C5_SDA         0x400001c3
+                       MX8MP_IOMUXC_SPDIF_TX__I2C5_SCL         0x400001c3
+               >;
+       };
+
        pinctrl_pmic: pmicgrp {
                fsl,pins = <
                        MX8MP_IOMUXC_GPIO1_IO03__GPIO1_IO03     0x000001c0
                >;
        };
 
+       pinctrl_pca6416_int: pca6416_int_grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_GPIO1_IO12__GPIO1_IO12     0x146 /* Input pull-up. */
+               >;
+       };
+
        pinctrl_reg_usdhc2_vmmc: regusdhc2vmmcgrp {
                fsl,pins = <
                        MX8MP_IOMUXC_SD2_RESET_B__GPIO2_IO19    0x41
index fc178ee..79b290a 100644 (file)
@@ -60,6 +60,7 @@
                        ti,tx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
                        ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
                        ti,clk-output-sel = <DP83867_CLK_O_SEL_OFF>;
+                       ti,min-output-impedance;
                        enet-phy-lane-no-swap;
                };
        };
                                regulator-boot-on;
                                regulator-always-on;
                                regulator-ramp-delay = <3125>;
+                               nxp,dvs-run-voltage = <950000>;
+                               nxp,dvs-standby-voltage = <850000>;
                        };
 
                        buck4: BUCK4 {
                                regulator-compatible = "LDO4";
                                regulator-min-microvolt = <800000>;
                                regulator-max-microvolt = <3300000>;
-                               regulator-boot-on;
-                               regulator-always-on;
                        };
 
                        ldo5: LDO5 {
                                regulator-compatible = "LDO5";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <3300000>;
+                               regulator-boot-on;
+                               regulator-always-on;
                        };
                };
        };
 
 /* eMMC */
 &usdhc3 {
+       assigned-clocks = <&clk IMX8MP_CLK_USDHC3_ROOT>;
+       assigned-clock-rates = <400000000>;
        pinctrl-names = "default", "state_100mhz", "state_200mhz";
        pinctrl-0 = <&pinctrl_usdhc3>;
        pinctrl-1 = <&pinctrl_usdhc3_100mhz>;
                        MX8MP_IOMUXC_SAI1_RXD7__ENET1_RGMII_RD3         0x91
                        MX8MP_IOMUXC_SAI1_TXC__ENET1_RGMII_RXC          0x91
                        MX8MP_IOMUXC_SAI1_TXFS__ENET1_RGMII_RX_CTL      0x91
-                       MX8MP_IOMUXC_SAI1_TXD0__ENET1_RGMII_TD0         0x1f
-                       MX8MP_IOMUXC_SAI1_TXD1__ENET1_RGMII_TD1         0x1f
-                       MX8MP_IOMUXC_SAI1_TXD2__ENET1_RGMII_TD2         0x1f
-                       MX8MP_IOMUXC_SAI1_TXD3__ENET1_RGMII_TD3         0x1f
-                       MX8MP_IOMUXC_SAI1_TXD4__ENET1_RGMII_TX_CTL      0x1f
-                       MX8MP_IOMUXC_SAI1_TXD5__ENET1_RGMII_TXC         0x1f
+                       MX8MP_IOMUXC_SAI1_TXD0__ENET1_RGMII_TD0         0x12
+                       MX8MP_IOMUXC_SAI1_TXD1__ENET1_RGMII_TD1         0x12
+                       MX8MP_IOMUXC_SAI1_TXD2__ENET1_RGMII_TD2         0x14
+                       MX8MP_IOMUXC_SAI1_TXD3__ENET1_RGMII_TD3         0x14
+                       MX8MP_IOMUXC_SAI1_TXD4__ENET1_RGMII_TX_CTL      0x14
+                       MX8MP_IOMUXC_SAI1_TXD5__ENET1_RGMII_TXC         0x14
                        MX8MP_IOMUXC_GPIO1_IO15__GPIO1_IO15             0x11
                >;
        };
                fsl,pins = <
                        MX8MP_IOMUXC_NAND_WE_B__USDHC3_CLK      0x196
                        MX8MP_IOMUXC_NAND_WP_B__USDHC3_CMD      0x1d6
-                       MX8MP_IOMUXC_NAND_DATA04__USDHC3_DATA0  0x1d6
-                       MX8MP_IOMUXC_NAND_DATA05__USDHC3_DATA1  0x1d6
-                       MX8MP_IOMUXC_NAND_DATA06__USDHC3_DATA2  0x1d6
-                       MX8MP_IOMUXC_NAND_DATA07__USDHC3_DATA3  0x1d6
-                       MX8MP_IOMUXC_NAND_RE_B__USDHC3_DATA4    0x1d6
-                       MX8MP_IOMUXC_NAND_CE2_B__USDHC3_DATA5   0x1d6
-                       MX8MP_IOMUXC_NAND_CE3_B__USDHC3_DATA6   0x1d6
-                       MX8MP_IOMUXC_NAND_CLE__USDHC3_DATA7     0x1d6
+                       MX8MP_IOMUXC_NAND_DATA04__USDHC3_DATA0  0x1d2
+                       MX8MP_IOMUXC_NAND_DATA05__USDHC3_DATA1  0x1d2
+                       MX8MP_IOMUXC_NAND_DATA06__USDHC3_DATA2  0x1d2
+                       MX8MP_IOMUXC_NAND_DATA07__USDHC3_DATA3  0x1d2
+                       MX8MP_IOMUXC_NAND_RE_B__USDHC3_DATA4    0x1d2
+                       MX8MP_IOMUXC_NAND_CE2_B__USDHC3_DATA5   0x1d2
+                       MX8MP_IOMUXC_NAND_CE3_B__USDHC3_DATA6   0x1d2
+                       MX8MP_IOMUXC_NAND_CLE__USDHC3_DATA7     0x1d2
                        MX8MP_IOMUXC_NAND_CE1_B__USDHC3_STROBE  0x196
                >;
        };
 
        pinctrl_wdog: wdoggrp {
                fsl,pins = <
-                       MX8MP_IOMUXC_GPIO1_IO02__WDOG1_WDOG_B   0xc6
+                       MX8MP_IOMUXC_GPIO1_IO02__WDOG1_WDOG_B   0xe6
                >;
        };
 };
index 6b840c0..3f8703f 100644 (file)
                        assigned-clocks = <&clk IMX8MP_CLK_USB_PHY_REF>;
                        assigned-clock-parents = <&clk IMX8MP_CLK_24M>;
                        #phy-cells = <0>;
+                       status = "disabled";
                };
 
                usb3_1: usb@32f10108 {
index a1b7582..99fed35 100644 (file)
                clock-frequency = <100000000>;
        };
 
+       reg_pcie1: regulator-pcie {
+               compatible = "regulator-fixed";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_pcie1_reg>;
+               regulator-name = "MPCIE_3V3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               gpio = <&gpio5 10 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+       };
+
        reg_usdhc2_vmmc: regulator-vsd-3v3 {
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_reg_usdhc2>;
 
 &ddrc {
        operating-points-v2 = <&ddrc_opp_table>;
+       status = "okay";
 
        ddrc_opp_table: opp-table {
                compatible = "operating-points-v2";
        status = "okay";
 };
 
+&pcie1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pcie1>;
+       reset-gpio = <&gpio5 12 GPIO_ACTIVE_LOW>;
+       clocks = <&clk IMX8MQ_CLK_PCIE2_ROOT>,
+                <&clk IMX8MQ_CLK_PCIE2_AUX>,
+                <&clk IMX8MQ_CLK_PCIE2_PHY>,
+                <&pcie0_refclk>;
+       clock-names = "pcie", "pcie_aux", "pcie_phy", "pcie_bus";
+       vpcie-supply = <&reg_pcie1>;
+       vph-supply = <&vgen5_reg>;
+       status = "okay";
+};
+
 &pgc_gpu {
        power-supply = <&sw1a_reg>;
 };
                >;
        };
 
+       pinctrl_pcie1: pcie1grp {
+               fsl,pins = <
+                       MX8MQ_IOMUXC_I2C4_SDA_PCIE2_CLKREQ_B            0x76
+                       MX8MQ_IOMUXC_ECSPI2_MISO_GPIO5_IO12             0x16
+               >;
+       };
+
+       pinctrl_pcie1_reg: pcie1reggrp {
+               fsl,pins = <
+                       MX8MQ_IOMUXC_ECSPI2_SCLK_GPIO5_IO10             0x16
+               >;
+       };
+
        pinctrl_qspi: qspigrp {
                fsl,pins = <
                        MX8MQ_IOMUXC_NAND_ALE_QSPI_A_SCLK       0x82
index f3e3418..4429a04 100644 (file)
 
 &ddrc {
        operating-points-v2 = <&ddrc_opp_table>;
+       status = "okay";
 
        ddrc_opp_table: opp-table {
                compatible = "operating-points-v2";
index fa721a1..94a13cb 100644 (file)
        compatible = "mntre,reform2", "boundary,imx8mq-nitrogen8m-som", "fsl,imx8mq";
        chassis-type = "laptop";
 
+       backlight: backlight {
+               compatible = "pwm-backlight";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_backlight>;
+               pwms = <&pwm2 0 10000>;
+               power-supply = <&reg_main_usb>;
+               enable-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
+               brightness-levels = <0 32 64 128 160 200 255>;
+               default-brightness-level = <6>;
+       };
+
+       panel {
+               compatible = "innolux,n125hce-gn1", "simple-panel";
+               power-supply = <&reg_main_3v3>;
+               backlight = <&backlight>;
+               no-hpd;
+
+               port {
+                       panel_in: endpoint {
+                               remote-endpoint = <&edp_bridge_out>;
+                       };
+               };
+       };
+
        pcie1_refclk: clock-pcie1-refclk {
                compatible = "fixed-clock";
                #clock-cells = <0>;
                vin-supply = <&reg_main_5v>;
        };
 
+       reg_main_1v8: regulator-main-1v8 {
+               compatible = "regulator-fixed";
+               regulator-name = "1V8";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               vin-supply = <&reg_main_3v3>;
+       };
+
+       reg_main_1v2: regulator-main-1v2 {
+               compatible = "regulator-fixed";
+               regulator-name = "1V2";
+               regulator-min-microvolt = <1200000>;
+               regulator-max-microvolt = <1200000>;
+               vin-supply = <&reg_main_5v>;
+       };
+
        sound {
                compatible = "fsl,imx-audio-wm8960";
                audio-cpu = <&sai2>;
        };
 };
 
+&dphy {
+       assigned-clocks = <&clk IMX8MQ_CLK_DSI_PHY_REF>;
+       assigned-clock-parents = <&clk IMX8MQ_SYS1_PLL_800M>;
+       assigned-clock-rates = <25000000>;
+       status = "okay";
+};
+
 &fec1 {
        status = "okay";
 };
        };
 };
 
+&i2c4 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c4>;
+       clock-frequency = <400000>;
+       status = "okay";
+
+       edp_bridge: bridge@2c {
+               compatible = "ti,sn65dsi86";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_edp_bridge>;
+               reg = <0x2c>;
+               enable-gpios = <&gpio3 20 GPIO_ACTIVE_HIGH>;
+               vccio-supply = <&reg_main_1v8>;
+               vpll-supply = <&reg_main_1v8>;
+               vcca-supply = <&reg_main_1v2>;
+               vcc-supply = <&reg_main_1v2>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+
+                               edp_bridge_in: endpoint {
+                                       remote-endpoint = <&mipi_dsi_out>;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+
+                               edp_bridge_out: endpoint {
+                                       remote-endpoint = <&panel_in>;
+                               };
+                       };
+               };
+       };
+};
+
+&lcdif {
+       assigned-clocks = <&clk IMX8MQ_CLK_LCDIF_PIXEL>;
+       assigned-clock-parents = <&clk IMX8MQ_SYS1_PLL_800M>;
+       /delete-property/assigned-clock-rates;
+       status = "okay";
+};
+
+&mipi_dsi {
+       status = "okay";
+
+       ports {
+               port@1 {
+                       reg = <1>;
+
+                       mipi_dsi_out: endpoint {
+                               remote-endpoint = <&edp_bridge_in>;
+                       };
+               };
+       };
+};
+
 &pcie1 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_pcie1>;
        status = "okay";
 };
 
+&pwm2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pwm2>;
+       status = "okay";
+};
+
+
 &reg_1p8v {
        vin-supply = <&reg_main_5v>;
 };
 };
 
 &iomuxc {
+       pinctrl_backlight: backlightgrp {
+               fsl,pins = <
+                       MX8MQ_IOMUXC_GPIO1_IO10_GPIO1_IO10              0x3
+               >;
+       };
+
+       pinctrl_edp_bridge: edpbridgegrp {
+               fsl,pins = <
+                       MX8MQ_IOMUXC_SAI5_RXC_GPIO3_IO20                0x1
+               >;
+       };
+
        pinctrl_i2c3: i2c3grp {
                fsl,pins = <
-                       MX8MQ_IOMUXC_I2C3_SCL_I2C3_SCL                  0x4000007f
-                       MX8MQ_IOMUXC_I2C3_SDA_I2C3_SDA                  0x4000007f
+                       MX8MQ_IOMUXC_I2C3_SCL_I2C3_SCL                  0x40000022
+                       MX8MQ_IOMUXC_I2C3_SDA_I2C3_SDA                  0x40000022
+               >;
+       };
+
+       pinctrl_i2c4: i2c4grp {
+               fsl,pins = <
+                       MX8MQ_IOMUXC_I2C4_SCL_I2C4_SCL                  0x40000022
+                       MX8MQ_IOMUXC_I2C4_SDA_I2C4_SDA                  0x40000022
                >;
        };
 
                >;
        };
 
+       pinctrl_pwm2: pwm2grp {
+               fsl,pins = <
+                       MX8MQ_IOMUXC_SPDIF_RX_PWM2_OUT                  0x3
+               >;
+       };
+
        pinctrl_sai2: sai2grp {
                fsl,pins = <
                        MX8MQ_IOMUXC_SAI2_RXD0_SAI2_RX_DATA0            0xd6
index 8aedcdd..38ffcd1 100644 (file)
        status = "okay";
 };
 
-&vpu {
-       status = "okay";
-};
-
 /* Attention: wdog reset forcing POR needs baseboard support */
 &wdog1 {
        status = "okay";
index 2df2510..c4d4895 100644 (file)
                                        pgc_vpu: power-domain@6 {
                                                #power-domain-cells = <0>;
                                                reg = <IMX8M_POWER_DOMAIN_VPU>;
-                                               clocks = <&clk IMX8MQ_CLK_VPU_DEC_ROOT>;
+                                               clocks = <&clk IMX8MQ_CLK_VPU_DEC_ROOT>,
+                                                        <&clk IMX8MQ_CLK_VPU_G1_ROOT>,
+                                                        <&clk IMX8MQ_CLK_VPU_G2_ROOT>;
+                                               assigned-clocks = <&clk IMX8MQ_CLK_VPU_G1>,
+                                                                 <&clk IMX8MQ_CLK_VPU_G2>,
+                                                                 <&clk IMX8MQ_CLK_VPU_BUS>,
+                                                                 <&clk IMX8MQ_VPU_PLL_BYPASS>;
+                                               assigned-clock-parents = <&clk IMX8MQ_VPU_PLL_OUT>,
+                                                                        <&clk IMX8MQ_VPU_PLL_OUT>,
+                                                                        <&clk IMX8MQ_SYS1_PLL_800M>,
+                                                                        <&clk IMX8MQ_VPU_PLL>;
+                                               assigned-clock-rates = <600000000>,
+                                                                      <600000000>,
+                                                                      <800000000>,
+                                                                      <0>;
                                        };
 
                                        pgc_disp: power-domain@7 {
                        status = "disabled";
                };
 
-               vpu: video-codec@38300000 {
-                       compatible = "nxp,imx8mq-vpu";
-                       reg = <0x38300000 0x10000>,
-                             <0x38310000 0x10000>,
-                             <0x38320000 0x10000>;
-                       reg-names = "g1", "g2", "ctrl";
-                       interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
-                                    <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
-                       interrupt-names = "g1", "g2";
+               vpu_g1: video-codec@38300000 {
+                       compatible = "nxp,imx8mq-vpu-g1";
+                       reg = <0x38300000 0x10000>;
+                       interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clk IMX8MQ_CLK_VPU_G1_ROOT>;
+                       power-domains = <&vpu_blk_ctrl IMX8MQ_VPUBLK_PD_G1>;
+               };
+
+               vpu_g2: video-codec@38310000 {
+                       compatible = "nxp,imx8mq-vpu-g2";
+                       reg = <0x38310000 0x10000>;
+                       interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clk IMX8MQ_CLK_VPU_G2_ROOT>;
+                       power-domains = <&vpu_blk_ctrl IMX8MQ_VPUBLK_PD_G2>;
+               };
+
+               vpu_blk_ctrl: blk-ctrl@38320000 {
+                       compatible = "fsl,imx8mq-vpu-blk-ctrl";
+                       reg = <0x38320000 0x100>;
+                       power-domains = <&pgc_vpu>, <&pgc_vpu>, <&pgc_vpu>;
+                       power-domain-names = "bus", "g1", "g2";
                        clocks = <&clk IMX8MQ_CLK_VPU_G1_ROOT>,
-                                <&clk IMX8MQ_CLK_VPU_G2_ROOT>,
-                                <&clk IMX8MQ_CLK_VPU_DEC_ROOT>;
-                       clock-names = "g1", "g2", "bus";
-                       assigned-clocks = <&clk IMX8MQ_CLK_VPU_G1>,
-                                         <&clk IMX8MQ_CLK_VPU_G2>,
-                                         <&clk IMX8MQ_CLK_VPU_BUS>,
-                                         <&clk IMX8MQ_VPU_PLL_BYPASS>;
-                       assigned-clock-parents = <&clk IMX8MQ_VPU_PLL_OUT>,
-                                                <&clk IMX8MQ_VPU_PLL_OUT>,
-                                                <&clk IMX8MQ_SYS1_PLL_800M>,
-                                                <&clk IMX8MQ_VPU_PLL>;
-                       assigned-clock-rates = <600000000>, <600000000>,
-                                              <800000000>, <0>;
-                       power-domains = <&pgc_vpu>;
+                                <&clk IMX8MQ_CLK_VPU_G2_ROOT>;
+                       clock-names = "g1", "g2";
+                       #power-domain-cells = <1>;
                };
 
                pcie0: pcie@33800000 {
                                 <&clk IMX8MQ_DRAM_PLL_OUT>,
                                 <&clk IMX8MQ_CLK_DRAM_ALT>,
                                 <&clk IMX8MQ_CLK_DRAM_APB>;
+                       status = "disabled";
                };
 
                ddr-pmu@3d800000 {
index 42637a4..ec16391 100644 (file)
@@ -19,3 +19,7 @@
 &usdhc2 {
        compatible = "fsl,imx8qm-usdhc", "fsl,imx8qxp-usdhc", "fsl,imx7d-usdhc";
 };
+
+&usdhc3 {
+       compatible = "fsl,imx8qm-usdhc", "fsl,imx8qxp-usdhc", "fsl,imx7d-usdhc";
+};
index 3089661..669aa14 100644 (file)
        compatible = "fsl,imx8-mu-scu", "fsl,imx8qm-mu", "fsl,imx6sx-mu";
 };
 
+&lsio_mu5 {
+       compatible = "fsl,imx8qm-mu", "fsl,imx6sx-mu";
+};
+
+&lsio_mu6 {
+       compatible = "fsl,imx8qm-mu", "fsl,imx6sx-mu";
+};
+
 &lsio_mu13 {
        compatible = "fsl,imx8qm-mu", "fsl,imx6sx-mu";
 };
index 4a7c017..be8c76a 100644 (file)
@@ -20,6 +20,9 @@
                mmc1 = &usdhc2;
                mmc2 = &usdhc3;
                serial0 = &lpuart0;
+               serial1 = &lpuart1;
+               serial2 = &lpuart2;
+               serial3 = &lpuart3;
        };
 
        cpus {
@@ -54,7 +57,7 @@
 
                A53_0: cpu@0 {
                        device_type = "cpu";
-                       compatible = "arm,cortex-a53", "arm,armv8";
+                       compatible = "arm,cortex-a53";
                        reg = <0x0 0x0>;
                        enable-method = "psci";
                        i-cache-size = <0x8000>;
@@ -68,7 +71,7 @@
 
                A53_1: cpu@1 {
                        device_type = "cpu";
-                       compatible = "arm,cortex-a53", "arm,armv8";
+                       compatible = "arm,cortex-a53";
                        reg = <0x0 0x1>;
                        enable-method = "psci";
                        i-cache-size = <0x8000>;
@@ -82,7 +85,7 @@
 
                A53_2: cpu@2 {
                        device_type = "cpu";
-                       compatible = "arm,cortex-a53", "arm,armv8";
+                       compatible = "arm,cortex-a53";
                        reg = <0x0 0x2>;
                        enable-method = "psci";
                        i-cache-size = <0x8000>;
@@ -96,7 +99,7 @@
 
                A53_3: cpu@3 {
                        device_type = "cpu";
-                       compatible = "arm,cortex-a53", "arm,armv8";
+                       compatible = "arm,cortex-a53";
                        reg = <0x0 0x3>;
                        enable-method = "psci";
                        i-cache-size = <0x8000>;
 
                A72_0: cpu@100 {
                        device_type = "cpu";
-                       compatible = "arm,cortex-a72", "arm,armv8";
+                       compatible = "arm,cortex-a72";
                        reg = <0x0 0x100>;
                        enable-method = "psci";
                        i-cache-size = <0xC000>;
 
                A72_1: cpu@101 {
                        device_type = "cpu";
-                       compatible = "arm,cortex-a72", "arm,armv8";
+                       compatible = "arm,cortex-a72";
                        reg = <0x0 0x101>;
                        enable-method = "psci";
                        next-level-cache = <&A72_L2>;
                        compatible = "fsl,imx8qm-iomuxc";
                };
 
+               rtc: rtc {
+                       compatible = "fsl,imx8qxp-sc-rtc";
+               };
        };
 
        /* sorted in register address */
index dc1daa8..7bae516 100644 (file)
@@ -5,19 +5,19 @@
  */
 
 &lpuart0 {
-       compatible = "fsl,imx8qxp-lpuart", "fsl,imx7ulp-lpuart";
+       compatible = "fsl,imx8qxp-lpuart";
 };
 
 &lpuart1 {
-       compatible = "fsl,imx8qxp-lpuart", "fsl,imx7ulp-lpuart";
+       compatible = "fsl,imx8qxp-lpuart";
 };
 
 &lpuart2 {
-       compatible = "fsl,imx8qxp-lpuart", "fsl,imx7ulp-lpuart";
+       compatible = "fsl,imx8qxp-lpuart";
 };
 
 &lpuart3 {
-       compatible = "fsl,imx8qxp-lpuart", "fsl,imx7ulp-lpuart";
+       compatible = "fsl,imx8qxp-lpuart";
 };
 
 &i2c0 {
index 1139547..8e2152c 100644 (file)
        compatible = "fsl,imx8-mu-scu", "fsl,imx8qxp-mu", "fsl,imx6sx-mu";
 };
 
+&lsio_mu5 {
+       compatible = "fsl,imx8qxp-mu", "fsl,imx6sx-mu";
+};
+
+&lsio_mu6 {
+       compatible = "fsl,imx8qxp-mu", "fsl,imx6sx-mu";
+};
+
 &lsio_mu13 {
        compatible = "fsl,imx8qxp-mu", "fsl,imx6sx-mu";
 };
index f27e3c8..3ea34b3 100644 (file)
                };
        };
 
+       pcie0_refclk: pcie0-refclk {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <100000000>;
+       };
+
        reg_hub_vbus: regulator-hub-vbus {
                compatible = "regulator-fixed";
                regulator-name = "MBA8MX_HUB_VBUS";
index 0dd2d2e..1f4618c 100644 (file)
                        status = "disabled";
                };
 
-               mmc: dwmmc0@ff808000 {
+               mmc: mmc@ff808000 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        compatible = "altr,socfpga-dw-mshc";
                        reg = <0xffe00000 0x40000>;
                };
 
-               pdma: pdma@ffda0000 {
+               pdma: dma-controller@ffda0000 {
                        compatible = "arm,pl330", "arm,primecell";
                        reg = <0xffda0000 0x1000>;
                        interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>,
index 0f7a0ba..26cd3c1 100644 (file)
@@ -6,6 +6,7 @@
 
 / {
        model = "SoCFPGA Agilex SoCDK";
+       compatible = "intel,socfpga-agilex-socdk", "intel,socfpga-agilex";
 
        aliases {
                serial0 = &uart0;
 
        leds {
                compatible = "gpio-leds";
-               hps0 {
+               led0 {
                        label = "hps_led0";
                        gpios = <&portb 20 GPIO_ACTIVE_HIGH>;
                };
 
-               hps1 {
+               led1 {
                        label = "hps_led1";
                        gpios = <&portb 19 GPIO_ACTIVE_HIGH>;
                };
 
-               hps2 {
+               led2 {
                        label = "hps_led2";
                        gpios = <&portb 21 GPIO_ACTIVE_HIGH>;
                };
index 57f8348..51f83f9 100644 (file)
@@ -6,6 +6,7 @@
 
 / {
        model = "SoCFPGA Agilex SoCDK";
+       compatible = "intel,socfpga-agilex-socdk", "intel,socfpga-agilex";
 
        aliases {
                serial0 = &uart0;
index f3c1310..5609d8d 100644 (file)
@@ -6,6 +6,7 @@
 
 / {
        model = "eASIC N5X SoCDK";
+       compatible = "intel,n5x-socdk", "intel,socfpga-agilex";
 
        aliases {
                serial0 = &uart0;
index 673f490..c0de8d1 100644 (file)
                        bus-range = <0x00 0xff>;
                        interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
                        #interrupt-cells = <1>;
+                       clocks = <&sb_periph_clk 13>;
                        msi-parent = <&pcie0>;
                        msi-controller;
                        /*
index 9514507..98f3b0e 100644 (file)
@@ -2,6 +2,7 @@
 /*
  * Copyright (c) 2020 MediaTek Inc.
  */
+#include <dt-bindings/input/input.h>
 
 &pwrap {
        pmic: mt6358 {
                mt6358rtc: mt6358rtc {
                        compatible = "mediatek,mt6358-rtc";
                };
+
+               mt6358keys: mt6358keys {
+                       compatible = "mediatek,mt6358-keys";
+                       power {
+                               linux,keycodes = <KEY_POWER>;
+                               wakeup-source;
+                       };
+                       home {
+                               linux,keycodes = <KEY_HOME>;
+                       };
+               };
        };
 };
index 5cd760a..21e4208 100644 (file)
@@ -19,7 +19,8 @@
                stdout-path = "serial0:115200n8";
        };
 
-       memory {
+       memory@40000000 {
+               device_type = "memory";
                reg = <0 0x40000000 0 0x40000000>;
        };
 };
index b8da76b..694acf8 100644 (file)
@@ -6,16 +6,18 @@
 
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/clock/mt7986-clk.h>
 
 / {
        interrupt-parent = <&gic>;
        #address-cells = <2>;
        #size-cells = <2>;
 
-       system_clk: dummy40m {
+       clk40m: oscillator@0 {
                compatible = "fixed-clock";
                clock-frequency = <40000000>;
                #clock-cells = <0>;
+               clock-output-names = "clkxtal";
        };
 
        cpus {
                        interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;
                };
 
+               infracfg: infracfg@10001000 {
+                       compatible = "mediatek,mt7986-infracfg", "syscon";
+                       reg = <0 0x10001000 0 0x1000>;
+                       #clock-cells = <1>;
+               };
+
+               topckgen: topckgen@1001b000 {
+                       compatible = "mediatek,mt7986-topckgen", "syscon";
+                       reg = <0 0x1001B000 0 0x1000>;
+                       #clock-cells = <1>;
+               };
+
                watchdog: watchdog@1001c000 {
                        compatible = "mediatek,mt7986-wdt",
                                     "mediatek,mt6589-wdt";
                        status = "disabled";
                };
 
+               apmixedsys: apmixedsys@1001e000 {
+                       compatible = "mediatek,mt7986-apmixedsys";
+                       reg = <0 0x1001E000 0 0x1000>;
+                       #clock-cells = <1>;
+               };
+
                pio: pinctrl@1001f000 {
                        compatible = "mediatek,mt7986a-pinctrl";
                        reg = <0 0x1001f000 0 0x1000>,
                        #interrupt-cells = <2>;
                };
 
+               sgmiisys0: syscon@10060000 {
+                       compatible = "mediatek,mt7986-sgmiisys_0",
+                                    "syscon";
+                       reg = <0 0x10060000 0 0x1000>;
+                       #clock-cells = <1>;
+               };
+
+               sgmiisys1: syscon@10070000 {
+                       compatible = "mediatek,mt7986-sgmiisys_1",
+                                    "syscon";
+                       reg = <0 0x10070000 0 0x1000>;
+                       #clock-cells = <1>;
+               };
+
                trng: trng@1020f000 {
                        compatible = "mediatek,mt7986-rng",
                                     "mediatek,mt7623-rng";
                        reg = <0 0x1020f000 0 0x100>;
-                       clocks = <&system_clk>;
+                       clocks = <&infracfg CLK_INFRA_TRNG_CK>;
                        clock-names = "rng";
                        status = "disabled";
                };
                                     "mediatek,mt6577-uart";
                        reg = <0 0x11002000 0 0x400>;
                        interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&system_clk>;
+                       clocks = <&infracfg CLK_INFRA_UART0_SEL>,
+                                <&infracfg CLK_INFRA_UART0_CK>;
+                       clock-names = "baud", "bus";
+                       assigned-clocks = <&topckgen CLK_TOP_UART_SEL>,
+                                         <&infracfg CLK_INFRA_UART0_SEL>;
+                       assigned-clock-parents = <&topckgen CLK_TOP_XTAL>,
+                                                <&topckgen CLK_TOP_UART_SEL>;
                        status = "disabled";
                };
 
                                     "mediatek,mt6577-uart";
                        reg = <0 0x11003000 0 0x400>;
                        interrupts = <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&system_clk>;
+                       clocks = <&infracfg CLK_INFRA_UART1_SEL>,
+                                <&infracfg CLK_INFRA_UART1_CK>;
+                       clock-names = "baud", "bus";
+                       assigned-clocks = <&infracfg CLK_INFRA_UART1_SEL>;
+                       assigned-clock-parents = <&topckgen CLK_TOP_F26M_SEL>;
                        status = "disabled";
                };
 
                                     "mediatek,mt6577-uart";
                        reg = <0 0x11004000 0 0x400>;
                        interrupts = <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&system_clk>;
+                       clocks = <&infracfg CLK_INFRA_UART2_SEL>,
+                                <&infracfg CLK_INFRA_UART2_CK>;
+                       clock-names = "baud", "bus";
+                       assigned-clocks = <&infracfg CLK_INFRA_UART2_SEL>;
+                       assigned-clock-parents = <&topckgen CLK_TOP_F26M_SEL>;
                        status = "disabled";
                };
 
+               ethsys: syscon@15000000 {
+                        #address-cells = <1>;
+                        #size-cells = <1>;
+                        compatible = "mediatek,mt7986-ethsys",
+                                     "syscon";
+                        reg = <0 0x15000000 0 0x1000>;
+                        #clock-cells = <1>;
+                        #reset-cells = <1>;
+               };
+
        };
 
 };
index 5fb752e..d73467e 100644 (file)
@@ -19,7 +19,8 @@
                stdout-path = "serial0:115200n8";
        };
 
-       memory {
+       memory@40000000 {
+               device_type = "memory";
                reg = <0 0x40000000 0 0x40000000>;
        };
 };
index 00f2ddd..4b08691 100644 (file)
                        power-domains = <&spm MT8183_POWER_DOMAIN_VENC>;
                };
 
+               venc_jpg: venc_jpg@17030000 {
+                       compatible = "mediatek,mt8183-jpgenc", "mediatek,mtk-jpgenc";
+                       reg = <0 0x17030000 0 0x1000>;
+                       interrupts = <GIC_SPI 249 IRQ_TYPE_LEVEL_LOW>;
+                       mediatek,larb = <&larb4>;
+                       iommus = <&iommu M4U_PORT_JPGENC_RDMA>,
+                                <&iommu M4U_PORT_JPGENC_BSDMA>;
+                       power-domains = <&spm MT8183_POWER_DOMAIN_VENC>;
+                       clocks = <&vencsys CLK_VENC_JPGENC>;
+                       clock-names = "jpgenc";
+               };
+
                ipu_conn: syscon@19000000 {
                        compatible = "mediatek,mt8183-ipu_conn", "syscon";
                        reg = <0 0x19000000 0 0x1000>;
index 53d790c..411feb2 100644 (file)
@@ -9,6 +9,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/pinctrl/mt8192-pinfunc.h>
+#include <dt-bindings/power/mt8192-power.h>
 
 / {
        compatible = "mediatek,mt8192";
                        #interrupt-cells = <2>;
                };
 
+               scpsys: syscon@10006000 {
+                       compatible = "syscon", "simple-mfd";
+                       reg = <0 0x10006000 0 0x1000>;
+                       #power-domain-cells = <1>;
+
+                       /* System Power Manager */
+                       spm: power-controller {
+                               compatible = "mediatek,mt8192-power-controller";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               #power-domain-cells = <1>;
+
+                               /* power domain of the SoC */
+                               power-domain@MT8192_POWER_DOMAIN_AUDIO {
+                                       reg = <MT8192_POWER_DOMAIN_AUDIO>;
+                                       clocks = <&topckgen CLK_TOP_AUD_INTBUS_SEL>,
+                                                <&infracfg CLK_INFRA_AUDIO_26M_B>,
+                                                <&infracfg CLK_INFRA_AUDIO>;
+                                       clock-names = "audio", "audio1", "audio2";
+                                       mediatek,infracfg = <&infracfg>;
+                                       #power-domain-cells = <0>;
+                               };
+
+                               power-domain@MT8192_POWER_DOMAIN_CONN {
+                                       reg = <MT8192_POWER_DOMAIN_CONN>;
+                                       clocks = <&infracfg CLK_INFRA_PMIC_CONN>;
+                                       clock-names = "conn";
+                                       mediatek,infracfg = <&infracfg>;
+                                       #power-domain-cells = <0>;
+                               };
+
+                               power-domain@MT8192_POWER_DOMAIN_MFG0 {
+                                       reg = <MT8192_POWER_DOMAIN_MFG0>;
+                                       clocks = <&topckgen CLK_TOP_MFG_PLL_SEL>;
+                                       clock-names = "mfg";
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       #power-domain-cells = <1>;
+
+                                       power-domain@MT8192_POWER_DOMAIN_MFG1 {
+                                               reg = <MT8192_POWER_DOMAIN_MFG1>;
+                                               mediatek,infracfg = <&infracfg>;
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+                                               #power-domain-cells = <1>;
+
+                                               power-domain@MT8192_POWER_DOMAIN_MFG2 {
+                                                       reg = <MT8192_POWER_DOMAIN_MFG2>;
+                                                       #power-domain-cells = <0>;
+                                               };
+
+                                               power-domain@MT8192_POWER_DOMAIN_MFG3 {
+                                                       reg = <MT8192_POWER_DOMAIN_MFG3>;
+                                                       #power-domain-cells = <0>;
+                                               };
+
+                                               power-domain@MT8192_POWER_DOMAIN_MFG4 {
+                                                       reg = <MT8192_POWER_DOMAIN_MFG4>;
+                                                       #power-domain-cells = <0>;
+                                               };
+
+                                               power-domain@MT8192_POWER_DOMAIN_MFG5 {
+                                                       reg = <MT8192_POWER_DOMAIN_MFG5>;
+                                                       #power-domain-cells = <0>;
+                                               };
+
+                                               power-domain@MT8192_POWER_DOMAIN_MFG6 {
+                                                       reg = <MT8192_POWER_DOMAIN_MFG6>;
+                                                       #power-domain-cells = <0>;
+                                               };
+                                       };
+                               };
+
+                               power-domain@MT8192_POWER_DOMAIN_DISP {
+                                       reg = <MT8192_POWER_DOMAIN_DISP>;
+                                       clocks = <&topckgen CLK_TOP_DISP_SEL>,
+                                                <&mmsys CLK_MM_SMI_INFRA>,
+                                                <&mmsys CLK_MM_SMI_COMMON>,
+                                                <&mmsys CLK_MM_SMI_GALS>,
+                                                <&mmsys CLK_MM_SMI_IOMMU>;
+                                       clock-names = "disp", "disp-0", "disp-1", "disp-2",
+                                                     "disp-3";
+                                       mediatek,infracfg = <&infracfg>;
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       #power-domain-cells = <1>;
+
+                                       power-domain@MT8192_POWER_DOMAIN_IPE {
+                                               reg = <MT8192_POWER_DOMAIN_IPE>;
+                                               clocks = <&topckgen CLK_TOP_IPE_SEL>,
+                                                        <&ipesys CLK_IPE_LARB19>,
+                                                        <&ipesys CLK_IPE_LARB20>,
+                                                        <&ipesys CLK_IPE_SMI_SUBCOM>,
+                                                        <&ipesys CLK_IPE_GALS>;
+                                               clock-names = "ipe", "ipe-0", "ipe-1", "ipe-2",
+                                                             "ipe-3";
+                                               mediatek,infracfg = <&infracfg>;
+                                               #power-domain-cells = <0>;
+                                       };
+
+                                       power-domain@MT8192_POWER_DOMAIN_ISP {
+                                               reg = <MT8192_POWER_DOMAIN_ISP>;
+                                               clocks = <&topckgen CLK_TOP_IMG1_SEL>,
+                                                        <&imgsys CLK_IMG_LARB9>,
+                                                        <&imgsys CLK_IMG_GALS>;
+                                               clock-names = "isp", "isp-0", "isp-1";
+                                               mediatek,infracfg = <&infracfg>;
+                                               #power-domain-cells = <0>;
+                                       };
+
+                                       power-domain@MT8192_POWER_DOMAIN_ISP2 {
+                                               reg = <MT8192_POWER_DOMAIN_ISP2>;
+                                               clocks = <&topckgen CLK_TOP_IMG2_SEL>,
+                                                        <&imgsys2 CLK_IMG2_LARB11>,
+                                                        <&imgsys2 CLK_IMG2_GALS>;
+                                               clock-names = "isp2", "isp2-0", "isp2-1";
+                                               mediatek,infracfg = <&infracfg>;
+                                               #power-domain-cells = <0>;
+                                       };
+
+                                       power-domain@MT8192_POWER_DOMAIN_MDP {
+                                               reg = <MT8192_POWER_DOMAIN_MDP>;
+                                               clocks = <&topckgen CLK_TOP_MDP_SEL>,
+                                                        <&mdpsys CLK_MDP_SMI0>;
+                                               clock-names = "mdp", "mdp-0";
+                                               mediatek,infracfg = <&infracfg>;
+                                               #power-domain-cells = <0>;
+                                       };
+
+                                       power-domain@MT8192_POWER_DOMAIN_VENC {
+                                               reg = <MT8192_POWER_DOMAIN_VENC>;
+                                               clocks = <&topckgen CLK_TOP_VENC_SEL>,
+                                                        <&vencsys CLK_VENC_SET1_VENC>;
+                                               clock-names = "venc", "venc-0";
+                                               mediatek,infracfg = <&infracfg>;
+                                               #power-domain-cells = <0>;
+                                       };
+
+                                       power-domain@MT8192_POWER_DOMAIN_VDEC {
+                                               reg = <MT8192_POWER_DOMAIN_VDEC>;
+                                               clocks = <&topckgen CLK_TOP_VDEC_SEL>,
+                                                        <&vdecsys_soc CLK_VDEC_SOC_VDEC>,
+                                                        <&vdecsys_soc CLK_VDEC_SOC_LAT>,
+                                                        <&vdecsys_soc CLK_VDEC_SOC_LARB1>;
+                                               clock-names = "vdec", "vdec-0", "vdec-1", "vdec-2";
+                                               mediatek,infracfg = <&infracfg>;
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+                                               #power-domain-cells = <1>;
+
+                                               power-domain@MT8192_POWER_DOMAIN_VDEC2 {
+                                                       reg = <MT8192_POWER_DOMAIN_VDEC2>;
+                                                       clocks = <&vdecsys CLK_VDEC_VDEC>,
+                                                                <&vdecsys CLK_VDEC_LAT>,
+                                                                <&vdecsys CLK_VDEC_LARB1>;
+                                                       clock-names = "vdec2-0", "vdec2-1",
+                                                                     "vdec2-2";
+                                                       #power-domain-cells = <0>;
+                                               };
+                                       };
+
+                                       power-domain@MT8192_POWER_DOMAIN_CAM {
+                                               reg = <MT8192_POWER_DOMAIN_CAM>;
+                                               clocks = <&topckgen CLK_TOP_CAM_SEL>,
+                                                        <&camsys CLK_CAM_LARB13>,
+                                                        <&camsys CLK_CAM_LARB14>,
+                                                        <&camsys CLK_CAM_CCU_GALS>,
+                                                        <&camsys CLK_CAM_CAM2MM_GALS>;
+                                               clock-names = "cam", "cam-0", "cam-1", "cam-2",
+                                                             "cam-3";
+                                               mediatek,infracfg = <&infracfg>;
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+                                               #power-domain-cells = <1>;
+
+                                               power-domain@MT8192_POWER_DOMAIN_CAM_RAWA {
+                                                       reg = <MT8192_POWER_DOMAIN_CAM_RAWA>;
+                                                       clocks = <&camsys_rawa CLK_CAM_RAWA_LARBX>;
+                                                       clock-names = "cam_rawa-0";
+                                                       #power-domain-cells = <0>;
+                                               };
+
+                                               power-domain@MT8192_POWER_DOMAIN_CAM_RAWB {
+                                                       reg = <MT8192_POWER_DOMAIN_CAM_RAWB>;
+                                                       clocks = <&camsys_rawb CLK_CAM_RAWB_LARBX>;
+                                                       clock-names = "cam_rawb-0";
+                                                       #power-domain-cells = <0>;
+                                               };
+
+                                               power-domain@MT8192_POWER_DOMAIN_CAM_RAWC {
+                                                       reg = <MT8192_POWER_DOMAIN_CAM_RAWC>;
+                                                       clocks = <&camsys_rawc CLK_CAM_RAWC_LARBX>;
+                                                       clock-names = "cam_rawc-0";
+                                                       #power-domain-cells = <0>;
+                                               };
+                                       };
+                               };
+                       };
+               };
+
+               watchdog: watchdog@10007000 {
+                       compatible = "mediatek,mt8192-wdt";
+                       reg = <0 0x10007000 0 0x100>;
+                       #reset-cells = <1>;
+               };
+
                apmixedsys: syscon@1000c000 {
                        compatible = "mediatek,mt8192-apmixedsys", "syscon";
                        reg = <0 0x1000c000 0 0x1000>;
                                     "mediatek,mt6765-timer";
                        reg = <0 0x10017000 0 0x1000>;
                        interrupts = <GIC_SPI 233 IRQ_TYPE_LEVEL_HIGH 0>;
-                       clocks = <&clk26m>;
+                       clocks = <&topckgen CLK_TOP_CSW_F26M_D2>;
                        clock-names = "clk13m";
                };
 
                                     "mediatek,mt6577-uart";
                        reg = <0 0x11002000 0 0x1000>;
                        interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH 0>;
-                       clocks = <&clk26m>, <&clk26m>;
+                       clocks = <&clk26m>, <&infracfg CLK_INFRA_UART0>;
                        clock-names = "baud", "bus";
                        status = "disabled";
                };
                                     "mediatek,mt6577-uart";
                        reg = <0 0x11003000 0 0x1000>;
                        interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH 0>;
-                       clocks = <&clk26m>, <&clk26m>;
+                       clocks = <&clk26m>, <&infracfg CLK_INFRA_UART1>;
                        clock-names = "baud", "bus";
                        status = "disabled";
                };
                        #size-cells = <0>;
                        reg = <0 0x1100a000 0 0x1000>;
                        interrupts = <GIC_SPI 159 IRQ_TYPE_LEVEL_HIGH 0>;
-                       clocks = <&clk26m>,
-                                <&clk26m>,
-                                <&clk26m>;
+                       clocks = <&topckgen CLK_TOP_MAINPLL_D5_D4>,
+                                <&topckgen CLK_TOP_SPI_SEL>,
+                                <&infracfg CLK_INFRA_SPI0>;
                        clock-names = "parent-clk", "sel-clk", "spi-clk";
                        status = "disabled";
                };
                        #size-cells = <0>;
                        reg = <0 0x11010000 0 0x1000>;
                        interrupts = <GIC_SPI 160 IRQ_TYPE_LEVEL_HIGH 0>;
-                       clocks = <&clk26m>,
-                                <&clk26m>,
-                                <&clk26m>;
+                       clocks = <&topckgen CLK_TOP_MAINPLL_D5_D4>,
+                                <&topckgen CLK_TOP_SPI_SEL>,
+                                <&infracfg CLK_INFRA_SPI1>;
                        clock-names = "parent-clk", "sel-clk", "spi-clk";
                        status = "disabled";
                };
                        #size-cells = <0>;
                        reg = <0 0x11012000 0 0x1000>;
                        interrupts = <GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH 0>;
-                       clocks = <&clk26m>,
-                                <&clk26m>,
-                                <&clk26m>;
+                       clocks = <&topckgen CLK_TOP_MAINPLL_D5_D4>,
+                                <&topckgen CLK_TOP_SPI_SEL>,
+                                <&infracfg CLK_INFRA_SPI2>;
                        clock-names = "parent-clk", "sel-clk", "spi-clk";
                        status = "disabled";
                };
                        #size-cells = <0>;
                        reg = <0 0x11013000 0 0x1000>;
                        interrupts = <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH 0>;
-                       clocks = <&clk26m>,
-                                <&clk26m>,
-                                <&clk26m>;
+                       clocks = <&topckgen CLK_TOP_MAINPLL_D5_D4>,
+                                <&topckgen CLK_TOP_SPI_SEL>,
+                                <&infracfg CLK_INFRA_SPI3>;
                        clock-names = "parent-clk", "sel-clk", "spi-clk";
                        status = "disabled";
                };
                        #size-cells = <0>;
                        reg = <0 0x11018000 0 0x1000>;
                        interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH 0>;
-                       clocks = <&clk26m>,
-                                <&clk26m>,
-                                <&clk26m>;
+                       clocks = <&topckgen CLK_TOP_MAINPLL_D5_D4>,
+                                <&topckgen CLK_TOP_SPI_SEL>,
+                                <&infracfg CLK_INFRA_SPI4>;
                        clock-names = "parent-clk", "sel-clk", "spi-clk";
                        status = "disabled";
                };
                        #size-cells = <0>;
                        reg = <0 0x11019000 0 0x1000>;
                        interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH 0>;
-                       clocks = <&clk26m>,
-                                <&clk26m>,
-                                <&clk26m>;
+                       clocks = <&topckgen CLK_TOP_MAINPLL_D5_D4>,
+                                <&topckgen CLK_TOP_SPI_SEL>,
+                                <&infracfg CLK_INFRA_SPI5>;
                        clock-names = "parent-clk", "sel-clk", "spi-clk";
                        status = "disabled";
                };
                        #size-cells = <0>;
                        reg = <0 0x1101d000 0 0x1000>;
                        interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH 0>;
-                       clocks = <&clk26m>,
-                                <&clk26m>,
-                                <&clk26m>;
+                       clocks = <&topckgen CLK_TOP_MAINPLL_D5_D4>,
+                                <&topckgen CLK_TOP_SPI_SEL>,
+                                <&infracfg CLK_INFRA_SPI6>;
                        clock-names = "parent-clk", "sel-clk", "spi-clk";
                        status = "disabled";
                };
                        #size-cells = <0>;
                        reg = <0 0x1101e000 0 0x1000>;
                        interrupts = <GIC_SPI 166 IRQ_TYPE_LEVEL_HIGH 0>;
-                       clocks = <&clk26m>,
-                                <&clk26m>,
-                                <&clk26m>;
+                       clocks = <&topckgen CLK_TOP_MAINPLL_D5_D4>,
+                                <&topckgen CLK_TOP_SPI_SEL>,
+                                <&infracfg CLK_INFRA_SPI7>;
                        clock-names = "parent-clk", "sel-clk", "spi-clk";
                        status = "disabled";
                };
                        compatible = "mediatek,mt8192-nor";
                        reg = <0 0x11234000 0 0xe0>;
                        interrupts = <GIC_SPI 431 IRQ_TYPE_LEVEL_HIGH 0>;
-                       clocks = <&clk26m>,
-                                <&clk26m>,
-                                <&clk26m>;
+                       clocks = <&topckgen CLK_TOP_SFLASH_SEL>,
+                                <&infracfg CLK_INFRA_FLASHIF_SFLASH>,
+                                <&infracfg CLK_INFRA_FLASHIF_TOP_H_133M>;
                        clock-names = "spi", "sf", "axi";
+                       assigned-clocks = <&topckgen CLK_TOP_SFLASH_SEL>;
+                       assigned-clock-parents = <&clk26m>;
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "disable";
                        reg = <0 0x11cb0000 0 0x1000>,
                              <0 0x10217300 0 0x80>;
                        interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH 0>;
-                       clocks = <&clk26m>, <&clk26m>;
+                       clocks = <&imp_iic_wrap_e CLK_IMP_IIC_WRAP_E_I2C3>,
+                                <&infracfg CLK_INFRA_AP_DMA>;
                        clock-names = "main", "dma";
                        clock-div = <1>;
                        #address-cells = <1>;
                        reg = <0 0x11d00000 0 0x1000>,
                              <0 0x10217600 0 0x180>;
                        interrupts = <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH 0>;
-                       clocks = <&clk26m>, <&clk26m>;
+                       clocks = <&imp_iic_wrap_s CLK_IMP_IIC_WRAP_S_I2C7>,
+                                <&infracfg CLK_INFRA_AP_DMA>;
                        clock-names = "main", "dma";
                        clock-div = <1>;
                        #address-cells = <1>;
                        reg = <0 0x11d01000 0 0x1000>,
                              <0 0x10217780 0 0x180>;
                        interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH 0>;
-                       clocks = <&clk26m>, <&clk26m>;
+                       clocks = <&imp_iic_wrap_s CLK_IMP_IIC_WRAP_S_I2C8>,
+                                <&infracfg CLK_INFRA_AP_DMA>;
                        clock-names = "main", "dma";
                        clock-div = <1>;
                        #address-cells = <1>;
                        reg = <0 0x11d02000 0 0x1000>,
                              <0 0x10217900 0 0x180>;
                        interrupts = <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH 0>;
-                       clocks = <&clk26m>, <&clk26m>;
+                       clocks = <&imp_iic_wrap_s CLK_IMP_IIC_WRAP_S_I2C9>,
+                                <&infracfg CLK_INFRA_AP_DMA>;
                        clock-names = "main", "dma";
                        clock-div = <1>;
                        #address-cells = <1>;
                        reg = <0 0x11d20000 0 0x1000>,
                              <0 0x10217100 0 0x80>;
                        interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH 0>;
-                       clocks = <&clk26m>, <&clk26m>;
+                       clocks = <&imp_iic_wrap_ws CLK_IMP_IIC_WRAP_WS_I2C1>,
+                                <&infracfg CLK_INFRA_AP_DMA>;
                        clock-names = "main", "dma";
                        clock-div = <1>;
                        #address-cells = <1>;
                        reg = <0 0x11d21000 0 0x1000>,
                              <0 0x10217180 0 0x180>;
                        interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH 0>;
-                       clocks = <&clk26m>, <&clk26m>;
+                       clocks = <&imp_iic_wrap_ws CLK_IMP_IIC_WRAP_WS_I2C2>,
+                                <&infracfg CLK_INFRA_AP_DMA>;
                        clock-names = "main", "dma";
                        clock-div = <1>;
                        #address-cells = <1>;
                        reg = <0 0x11d22000 0 0x1000>,
                              <0 0x10217380 0 0x180>;
                        interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH 0>;
-                       clocks = <&clk26m>, <&clk26m>;
+                       clocks = <&imp_iic_wrap_ws CLK_IMP_IIC_WRAP_WS_I2C4>,
+                                <&infracfg CLK_INFRA_AP_DMA>;
                        clock-names = "main", "dma";
                        clock-div = <1>;
                        #address-cells = <1>;
                        reg = <0 0x11e00000 0 0x1000>,
                              <0 0x10217500 0 0x80>;
                        interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH 0>;
-                       clocks = <&clk26m>, <&clk26m>;
+                       clocks = <&imp_iic_wrap_w CLK_IMP_IIC_WRAP_W_I2C5>,
+                                <&infracfg CLK_INFRA_AP_DMA>;
                        clock-names = "main", "dma";
                        clock-div = <1>;
                        #address-cells = <1>;
                        reg = <0 0x11f00000 0 0x1000>,
                              <0 0x10217080 0 0x80>;
                        interrupts = <GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH 0>;
-                       clocks = <&clk26m>, <&clk26m>;
+                       clocks = <&imp_iic_wrap_n CLK_IMP_IIC_WRAP_N_I2C0>,
+                                <&infracfg CLK_INFRA_AP_DMA>;
                        clock-names = "main", "dma";
                        clock-div = <1>;
                        #address-cells = <1>;
                        reg = <0 0x11f01000 0 0x1000>,
                              <0 0x10217580 0 0x80>;
                        interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH 0>;
-                       clocks = <&clk26m>, <&clk26m>;
+                       clocks = <&imp_iic_wrap_n CLK_IMP_IIC_WRAP_N_I2C6>,
+                                <&infracfg CLK_INFRA_AP_DMA>;
                        clock-names = "main", "dma";
                        clock-div = <1>;
                        #address-cells = <1>;
index ea3f338..bc34c9d 100644 (file)
@@ -1,4 +1,15 @@
 # SPDX-License-Identifier: GPL-2.0
+
+# Enables support for device-tree overlays
+DTC_FLAGS_tegra210-p2371-2180 := -@
+DTC_FLAGS_tegra210-p3450-0000 := -@
+DTC_FLAGS_tegra186-p2771-0000 := -@
+DTC_FLAGS_tegra186-p3509-0000+p3636-0001 := -@
+DTC_FLAGS_tegra194-p2972-0000 := -@
+DTC_FLAGS_tegra194-p3509-0000+p3668-0000 := -@
+DTC_FLAGS_tegra194-p3509-0000+p3668-0001 := -@
+DTC_FLAGS_tegra234-p3737-0000+p3701-0000 := -@
+
 dtb-$(CONFIG_ARCH_TEGRA_132_SOC) += tegra132-norrin.dtb
 dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2371-0000.dtb
 dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2371-2180.dtb
index c91afff..e9b40f5 100644 (file)
                snps,rxpbl = <8>;
        };
 
+       gpcdma: dma-controller@2600000 {
+               compatible = "nvidia,tegra186-gpcdma";
+               reg = <0x0 0x2600000 0x0 0x210000>;
+               resets = <&bpmp TEGRA186_RESET_GPCDMA>;
+               reset-names = "gpcdma";
+               interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
+               #dma-cells = <1>;
+               iommus = <&smmu TEGRA186_SID_GPCDMA_0>;
+               dma-coherent;
+               status = "okay";
+       };
+
        aconnect@2900000 {
                compatible = "nvidia,tegra186-aconnect",
                             "nvidia,tegra210-aconnect";
        };
 
        pmu_denver {
-               compatible = "nvidia,denver-pmu", "arm,armv8-pmuv3";
+               compatible = "nvidia,denver-pmu";
                interrupts = <GIC_SPI 320 IRQ_TYPE_LEVEL_HIGH>,
                             <GIC_SPI 321 IRQ_TYPE_LEVEL_HIGH>;
                interrupt-affinity = <&denver_0 &denver_1>;
        };
 
        pmu_a57 {
-               compatible = "arm,cortex-a57-pmu", "arm,armv8-pmuv3";
+               compatible = "arm,cortex-a57-pmu";
                interrupts = <GIC_SPI 296 IRQ_TYPE_LEVEL_HIGH>,
                             <GIC_SPI 297 IRQ_TYPE_LEVEL_HIGH>,
                             <GIC_SPI 298 IRQ_TYPE_LEVEL_HIGH>,
index 1323fa9..32ce790 100644 (file)
                        pads {
                                usb2 {
                                        lanes {
+                                               usb2-0 {
+                                                       status = "okay";
+                                               };
+
                                                usb2-1 {
                                                        status = "okay";
                                                };
                        };
 
                        ports {
+                               usb2-0 {
+                                       mode = "otg";
+                                       status = "okay";
+                                       usb-role-switch;
+                                       connector {
+                                               compatible = "gpio-usb-b-connector",
+                                                       "usb-b-connector";
+                                               label = "micro-USB";
+                                               type = "micro";
+                                               vbus-gpio = <&gpio TEGRA194_MAIN_GPIO(Z, 1)
+                                                               GPIO_ACTIVE_LOW>;
+                                       };
+                               };
+
                                usb2-1 {
                                        mode = "host";
                                        status = "okay";
                        phy-names = "usb2-1", "usb2-2", "usb3-2";
                };
 
+               usb@3550000 {
+                       status = "okay";
+
+                       phys = <&{/bus@0/padctl@3520000/pads/usb2/lanes/usb2-0}>;
+                       phy-names = "usb2-0";
+               };
+
                spi@3270000 {
                        status = "okay";
 
index 2d48c37..c28bf4d 100644 (file)
                        snps,rxpbl = <8>;
                };
 
+               gpcdma: dma-controller@2600000 {
+                       compatible = "nvidia,tegra194-gpcdma",
+                                    "nvidia,tegra186-gpcdma";
+                       reg = <0x2600000 0x210000>;
+                       resets = <&bpmp TEGRA194_RESET_GPCDMA>;
+                       reset-names = "gpcdma";
+                       interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
+                       #dma-cells = <1>;
+                       iommus = <&smmu TEGRA194_SID_GPCDMA_0>;
+                       dma-coherent;
+                       status = "okay";
+               };
+
                aconnect@2900000 {
                        compatible = "nvidia,tegra194-aconnect",
                                     "nvidia,tegra210-aconnect";
                                                    "rx19", "tx19",
                                                    "rx20", "tx20";
                                        status = "disabled";
+                                       interconnects = <&mc TEGRA194_MEMORY_CLIENT_APEDMAR &emc>,
+                                                       <&mc TEGRA194_MEMORY_CLIENT_APEDMAW &emc>;
+                                       interconnect-names = "dma-mem", "write";
+                                       iommus = <&smmu TEGRA194_SID_APE>;
                                };
 
                                tegra_i2s1: i2s@2901000 {
        };
 
        pmu {
-               compatible = "arm,armv8-pmuv3";
+               compatible = "nvidia,carmel-pmu";
                interrupts = <GIC_SPI 384 IRQ_TYPE_LEVEL_HIGH>,
                             <GIC_SPI 385 IRQ_TYPE_LEVEL_HIGH>,
                             <GIC_SPI 386 IRQ_TYPE_LEVEL_HIGH>,
                 * for 8x and 11.025x sample rate streams.
                 */
                assigned-clock-rates = <258000000>;
-
-               interconnects = <&mc TEGRA194_MEMORY_CLIENT_APEDMAR &emc>,
-                               <&mc TEGRA194_MEMORY_CLIENT_APEDMAW &emc>;
-               interconnect-names = "dma-mem", "write";
-               iommus = <&smmu TEGRA194_SID_APE>;
        };
 
        tcu: serial {
index efbbb87..34d6a01 100644 (file)
@@ -1,6 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0
 /dts-v1/;
 
+#include <dt-bindings/input/linux-event-codes.h>
+#include <dt-bindings/input/gpio-keys.h>
+
 #include "tegra234-p3701-0000.dtsi"
 #include "tegra234-p3737-0000.dtsi"
 
        aliases {
                mmc3 = "/bus@0/mmc@3460000";
                serial0 = &tcu;
+               serial1 = &uarta;
+       };
+
+       bus@0 {
+               aconnect@2900000 {
+                       status = "okay";
+
+                       ahub@2900800 {
+                               status = "okay";
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       port@0 {
+                                               reg = <0x0>;
+
+                                               xbar_admaif0: endpoint {
+                                                       remote-endpoint = <&admaif0>;
+                                               };
+                                       };
+
+                                       port@1 {
+                                               reg = <0x1>;
+
+                                               xbar_admaif1: endpoint {
+                                                       remote-endpoint = <&admaif1>;
+                                               };
+                                       };
+
+                                       port@2 {
+                                               reg = <0x2>;
+
+                                               xbar_admaif2: endpoint {
+                                                       remote-endpoint = <&admaif2>;
+                                               };
+                                       };
+
+                                       port@3 {
+                                               reg = <0x3>;
+
+                                               xbar_admaif3: endpoint {
+                                                       remote-endpoint = <&admaif3>;
+                                               };
+                                       };
+
+                                       port@4 {
+                                               reg = <0x4>;
+
+                                               xbar_admaif4: endpoint {
+                                                       remote-endpoint = <&admaif4>;
+                                               };
+                                       };
+
+                                       port@5 {
+                                               reg = <0x5>;
+
+                                               xbar_admaif5: endpoint {
+                                                       remote-endpoint = <&admaif5>;
+                                               };
+                                       };
+
+                                       port@6 {
+                                               reg = <0x6>;
+
+                                               xbar_admaif6: endpoint {
+                                                       remote-endpoint = <&admaif6>;
+                                               };
+                                       };
+
+                                       port@7 {
+                                               reg = <0x7>;
+
+                                               xbar_admaif7: endpoint {
+                                                       remote-endpoint = <&admaif7>;
+                                               };
+                                       };
+
+                                       port@8 {
+                                               reg = <0x8>;
+
+                                               xbar_admaif8: endpoint {
+                                                       remote-endpoint = <&admaif8>;
+                                               };
+                                       };
+
+                                       port@9 {
+                                               reg = <0x9>;
+
+                                               xbar_admaif9: endpoint {
+                                                       remote-endpoint = <&admaif9>;
+                                               };
+                                       };
+
+                                       port@a {
+                                               reg = <0xa>;
+
+                                               xbar_admaif10: endpoint {
+                                                       remote-endpoint = <&admaif10>;
+                                               };
+                                       };
+
+                                       port@b {
+                                               reg = <0xb>;
+
+                                               xbar_admaif11: endpoint {
+                                                       remote-endpoint = <&admaif11>;
+                                               };
+                                       };
+
+                                       port@c {
+                                               reg = <0xc>;
+
+                                               xbar_admaif12: endpoint {
+                                                       remote-endpoint = <&admaif12>;
+                                               };
+                                       };
+
+                                       port@d {
+                                               reg = <0xd>;
+
+                                               xbar_admaif13: endpoint {
+                                                       remote-endpoint = <&admaif13>;
+                                               };
+                                       };
+
+                                       port@e {
+                                               reg = <0xe>;
+
+                                               xbar_admaif14: endpoint {
+                                                       remote-endpoint = <&admaif14>;
+                                               };
+                                       };
+
+                                       port@f {
+                                               reg = <0xf>;
+
+                                               xbar_admaif15: endpoint {
+                                                       remote-endpoint = <&admaif15>;
+                                               };
+                                       };
+
+                                       port@10 {
+                                               reg = <0x10>;
+
+                                               xbar_admaif16: endpoint {
+                                                       remote-endpoint = <&admaif16>;
+                                               };
+                                       };
+
+                                       port@11 {
+                                               reg = <0x11>;
+
+                                               xbar_admaif17: endpoint {
+                                                       remote-endpoint = <&admaif17>;
+                                               };
+                                       };
+
+                                       port@12 {
+                                               reg = <0x12>;
+
+                                               xbar_admaif18: endpoint {
+                                                       remote-endpoint = <&admaif18>;
+                                               };
+                                       };
+
+                                       port@13 {
+                                               reg = <0x13>;
+
+                                               xbar_admaif19: endpoint {
+                                                       remote-endpoint = <&admaif19>;
+                                               };
+                                       };
+
+                                       xbar_i2s1_port: port@14 {
+                                               reg = <0x14>;
+
+                                               xbar_i2s1: endpoint {
+                                                       remote-endpoint = <&i2s1_cif>;
+                                               };
+                                       };
+
+                                       xbar_i2s2_port: port@15 {
+                                               reg = <0x15>;
+
+                                               xbar_i2s2: endpoint {
+                                                       remote-endpoint = <&i2s2_cif>;
+                                               };
+                                       };
+
+                                       xbar_i2s4_port: port@17 {
+                                               reg = <0x17>;
+
+                                               xbar_i2s4: endpoint {
+                                                       remote-endpoint = <&i2s4_cif>;
+                                               };
+                                       };
+
+                                       xbar_i2s6_port: port@19 {
+                                               reg = <0x19>;
+
+                                               xbar_i2s6: endpoint {
+                                                       remote-endpoint = <&i2s6_cif>;
+                                               };
+                                       };
+
+                                       xbar_dmic3_port: port@1c {
+                                               reg = <0x1c>;
+
+                                               xbar_dmic3: endpoint {
+                                                       remote-endpoint = <&dmic3_cif>;
+                                               };
+                                       };
+
+                                       xbar_sfc1_in_port: port@20 {
+                                               reg = <0x20>;
+
+                                               xbar_sfc1_in: endpoint {
+                                                       remote-endpoint = <&sfc1_cif_in>;
+                                               };
+                                       };
+
+                                       port@21 {
+                                               reg = <0x21>;
+
+                                               xbar_sfc1_out: endpoint {
+                                                       remote-endpoint = <&sfc1_cif_out>;
+                                               };
+                                       };
+
+                                       xbar_sfc2_in_port: port@22 {
+                                               reg = <0x22>;
+
+                                               xbar_sfc2_in: endpoint {
+                                                       remote-endpoint = <&sfc2_cif_in>;
+                                               };
+                                       };
+
+                                       port@23 {
+                                               reg = <0x23>;
+
+                                               xbar_sfc2_out: endpoint {
+                                                       remote-endpoint = <&sfc2_cif_out>;
+                                               };
+                                       };
+
+                                       xbar_sfc3_in_port: port@24 {
+                                               reg = <0x24>;
+
+                                               xbar_sfc3_in: endpoint {
+                                                       remote-endpoint = <&sfc3_cif_in>;
+                                               };
+                                       };
+
+                                       port@25 {
+                                               reg = <0x25>;
+
+                                               xbar_sfc3_out: endpoint {
+                                                       remote-endpoint = <&sfc3_cif_out>;
+                                               };
+                                       };
+
+                                       xbar_sfc4_in_port: port@26 {
+                                               reg = <0x26>;
+
+                                               xbar_sfc4_in: endpoint {
+                                                       remote-endpoint = <&sfc4_cif_in>;
+                                               };
+                                       };
+
+                                       port@27 {
+                                               reg = <0x27>;
+
+                                               xbar_sfc4_out: endpoint {
+                                                       remote-endpoint = <&sfc4_cif_out>;
+                                               };
+                                       };
+
+                                       xbar_mvc1_in_port: port@28 {
+                                               reg = <0x28>;
+
+                                               xbar_mvc1_in: endpoint {
+                                                       remote-endpoint = <&mvc1_cif_in>;
+                                               };
+                                       };
+
+                                       port@29 {
+                                               reg = <0x29>;
+
+                                               xbar_mvc1_out: endpoint {
+                                                       remote-endpoint = <&mvc1_cif_out>;
+                                               };
+                                       };
+
+                                       xbar_mvc2_in_port: port@2a {
+                                               reg = <0x2a>;
+
+                                               xbar_mvc2_in: endpoint {
+                                                       remote-endpoint = <&mvc2_cif_in>;
+                                               };
+                                       };
+
+                                       port@2b {
+                                               reg = <0x2b>;
+
+                                               xbar_mvc2_out: endpoint {
+                                                       remote-endpoint = <&mvc2_cif_out>;
+                                               };
+                                       };
+
+                                       xbar_amx1_in1_port: port@2c {
+                                               reg = <0x2c>;
+
+                                               xbar_amx1_in1: endpoint {
+                                                       remote-endpoint = <&amx1_in1>;
+                                               };
+                                       };
+
+                                       xbar_amx1_in2_port: port@2d {
+                                               reg = <0x2d>;
+
+                                               xbar_amx1_in2: endpoint {
+                                                       remote-endpoint = <&amx1_in2>;
+                                               };
+                                       };
+
+                                       xbar_amx1_in3_port: port@2e {
+                                               reg = <0x2e>;
+
+                                               xbar_amx1_in3: endpoint {
+                                                       remote-endpoint = <&amx1_in3>;
+                                               };
+                                       };
+
+                                       xbar_amx1_in4_port: port@2f {
+                                               reg = <0x2f>;
+
+                                               xbar_amx1_in4: endpoint {
+                                                       remote-endpoint = <&amx1_in4>;
+                                               };
+                                       };
+
+                                       port@30 {
+                                               reg = <0x30>;
+
+                                               xbar_amx1_out: endpoint {
+                                                       remote-endpoint = <&amx1_out>;
+                                               };
+                                       };
+
+                                       xbar_amx2_in1_port: port@31 {
+                                               reg = <0x31>;
+
+                                               xbar_amx2_in1: endpoint {
+                                                       remote-endpoint = <&amx2_in1>;
+                                               };
+                                       };
+
+                                       xbar_amx2_in2_port: port@32 {
+                                               reg = <0x32>;
+
+                                               xbar_amx2_in2: endpoint {
+                                                       remote-endpoint = <&amx2_in2>;
+                                               };
+                                       };
+
+                                       xbar_amx2_in3_port: port@33 {
+                                               reg = <0x33>;
+
+                                               xbar_amx2_in3: endpoint {
+                                                       remote-endpoint = <&amx2_in3>;
+                                               };
+                                       };
+
+                                       xbar_amx2_in4_port: port@34 {
+                                               reg = <0x34>;
+
+                                               xbar_amx2_in4: endpoint {
+                                                       remote-endpoint = <&amx2_in4>;
+                                               };
+                                       };
+
+                                       port@35 {
+                                               reg = <0x35>;
+
+                                               xbar_amx2_out: endpoint {
+                                                       remote-endpoint = <&amx2_out>;
+                                               };
+                                       };
+
+                                       xbar_amx3_in1_port: port@36 {
+                                               reg = <0x36>;
+
+                                               xbar_amx3_in1: endpoint {
+                                                       remote-endpoint = <&amx3_in1>;
+                                               };
+                                       };
+
+                                       xbar_amx3_in2_port: port@37 {
+                                               reg = <0x37>;
+
+                                               xbar_amx3_in2: endpoint {
+                                                       remote-endpoint = <&amx3_in2>;
+                                               };
+                                       };
+
+                                       xbar_amx3_in3_port: port@38 {
+                                               reg = <0x38>;
+
+                                               xbar_amx3_in3: endpoint {
+                                                       remote-endpoint = <&amx3_in3>;
+                                               };
+                                       };
+
+                                       xbar_amx3_in4_port: port@39 {
+                                               reg = <0x39>;
+
+                                               xbar_amx3_in4: endpoint {
+                                                       remote-endpoint = <&amx3_in4>;
+                                               };
+                                       };
+
+                                       port@3a {
+                                               reg = <0x3a>;
+
+                                               xbar_amx3_out: endpoint {
+                                                       remote-endpoint = <&amx3_out>;
+                                               };
+                                       };
+
+                                       xbar_amx4_in1_port: port@3b {
+                                               reg = <0x3b>;
+
+                                               xbar_amx4_in1: endpoint {
+                                                       remote-endpoint = <&amx4_in1>;
+                                               };
+                                       };
+
+                                       xbar_amx4_in2_port: port@3c {
+                                               reg = <0x3c>;
+
+                                               xbar_amx4_in2: endpoint {
+                                                       remote-endpoint = <&amx4_in2>;
+                                               };
+                                       };
+
+                                       xbar_amx4_in3_port: port@3d {
+                                               reg = <0x3d>;
+
+                                               xbar_amx4_in3: endpoint {
+                                                       remote-endpoint = <&amx4_in3>;
+                                               };
+                                       };
+
+                                       xbar_amx4_in4_port: port@3e {
+                                               reg = <0x3e>;
+
+                                               xbar_amx4_in4: endpoint {
+                                                       remote-endpoint = <&amx4_in4>;
+                                               };
+                                       };
+
+                                       port@3f {
+                                               reg = <0x3f>;
+
+                                               xbar_amx4_out: endpoint {
+                                                       remote-endpoint = <&amx4_out>;
+                                               };
+                                       };
+
+                                       xbar_adx1_in_port: port@40 {
+                                               reg = <0x40>;
+
+                                               xbar_adx1_in: endpoint {
+                                                       remote-endpoint = <&adx1_in>;
+                                               };
+                                       };
+
+                                       port@41 {
+                                               reg = <0x41>;
+
+                                               xbar_adx1_out1: endpoint {
+                                                       remote-endpoint = <&adx1_out1>;
+                                               };
+                                       };
+
+                                       port@42 {
+                                               reg = <0x42>;
+
+                                               xbar_adx1_out2: endpoint {
+                                                       remote-endpoint = <&adx1_out2>;
+                                               };
+                                       };
+
+                                       port@43 {
+                                               reg = <0x43>;
+
+                                               xbar_adx1_out3: endpoint {
+                                                       remote-endpoint = <&adx1_out3>;
+                                               };
+                                       };
+
+                                       port@44 {
+                                               reg = <0x44>;
+
+                                               xbar_adx1_out4: endpoint {
+                                                       remote-endpoint = <&adx1_out4>;
+                                               };
+                                       };
+
+                                       xbar_adx2_in_port: port@45 {
+                                               reg = <0x45>;
+
+                                               xbar_adx2_in: endpoint {
+                                                       remote-endpoint = <&adx2_in>;
+                                               };
+                                       };
+
+                                       port@46 {
+                                               reg = <0x46>;
+
+                                               xbar_adx2_out1: endpoint {
+                                                       remote-endpoint = <&adx2_out1>;
+                                               };
+                                       };
+
+                                       port@47 {
+                                               reg = <0x47>;
+
+                                               xbar_adx2_out2: endpoint {
+                                                       remote-endpoint = <&adx2_out2>;
+                                               };
+                                       };
+
+                                       port@48 {
+                                               reg = <0x48>;
+
+                                               xbar_adx2_out3: endpoint {
+                                                       remote-endpoint = <&adx2_out3>;
+                                               };
+                                       };
+
+                                       port@49 {
+                                               reg = <0x49>;
+
+                                               xbar_adx2_out4: endpoint {
+                                                       remote-endpoint = <&adx2_out4>;
+                                               };
+                                       };
+
+                                       xbar_adx3_in_port: port@4a {
+                                               reg = <0x4a>;
+
+                                               xbar_adx3_in: endpoint {
+                                                       remote-endpoint = <&adx3_in>;
+                                               };
+                                       };
+
+                                       port@4b {
+                                               reg = <0x4b>;
+
+                                               xbar_adx3_out1: endpoint {
+                                                       remote-endpoint = <&adx3_out1>;
+                                               };
+                                       };
+
+                                       port@4c {
+                                               reg = <0x4c>;
+
+                                               xbar_adx3_out2: endpoint {
+                                                       remote-endpoint = <&adx3_out2>;
+                                               };
+                                       };
+
+                                       port@4d {
+                                               reg = <0x4d>;
+
+                                               xbar_adx3_out3: endpoint {
+                                                       remote-endpoint = <&adx3_out3>;
+                                               };
+                                       };
+
+                                       port@4e {
+                                               reg = <0x4e>;
+
+                                               xbar_adx3_out4: endpoint {
+                                                       remote-endpoint = <&adx3_out4>;
+                                               };
+                                       };
+
+                                       xbar_adx4_in_port: port@4f {
+                                               reg = <0x4f>;
+
+                                               xbar_adx4_in: endpoint {
+                                                       remote-endpoint = <&adx4_in>;
+                                               };
+                                       };
+
+                                       port@50 {
+                                               reg = <0x50>;
+
+                                               xbar_adx4_out1: endpoint {
+                                                       remote-endpoint = <&adx4_out1>;
+                                               };
+                                       };
+
+                                       port@51 {
+                                               reg = <0x51>;
+
+                                               xbar_adx4_out2: endpoint {
+                                                       remote-endpoint = <&adx4_out2>;
+                                               };
+                                       };
+
+                                       port@52 {
+                                               reg = <0x52>;
+
+                                               xbar_adx4_out3: endpoint {
+                                                       remote-endpoint = <&adx4_out3>;
+                                               };
+                                       };
+
+                                       port@53 {
+                                               reg = <0x53>;
+
+                                               xbar_adx4_out4: endpoint {
+                                                       remote-endpoint = <&adx4_out4>;
+                                               };
+                                       };
+
+                                       xbar_mix_in1_port: port@54 {
+                                               reg = <0x54>;
+
+                                               xbar_mix_in1: endpoint {
+                                                       remote-endpoint = <&mix_in1>;
+                                               };
+                                       };
+
+                                       xbar_mix_in2_port: port@55 {
+                                               reg = <0x55>;
+
+                                               xbar_mix_in2: endpoint {
+                                                       remote-endpoint = <&mix_in2>;
+                                               };
+                                       };
+
+                                       xbar_mix_in3_port: port@56 {
+                                               reg = <0x56>;
+
+                                               xbar_mix_in3: endpoint {
+                                                       remote-endpoint = <&mix_in3>;
+                                               };
+                                       };
+
+                                       xbar_mix_in4_port: port@57 {
+                                               reg = <0x57>;
+
+                                               xbar_mix_in4: endpoint {
+                                                       remote-endpoint = <&mix_in4>;
+                                               };
+                                       };
+
+                                       xbar_mix_in5_port: port@58 {
+                                               reg = <0x58>;
+
+                                               xbar_mix_in5: endpoint {
+                                                       remote-endpoint = <&mix_in5>;
+                                               };
+                                       };
+
+                                       xbar_mix_in6_port: port@59 {
+                                               reg = <0x59>;
+
+                                               xbar_mix_in6: endpoint {
+                                                       remote-endpoint = <&mix_in6>;
+                                               };
+                                       };
+
+                                       xbar_mix_in7_port: port@5a {
+                                               reg = <0x5a>;
+
+                                               xbar_mix_in7: endpoint {
+                                                       remote-endpoint = <&mix_in7>;
+                                               };
+                                       };
+
+                                       xbar_mix_in8_port: port@5b {
+                                               reg = <0x5b>;
+
+                                               xbar_mix_in8: endpoint {
+                                                       remote-endpoint = <&mix_in8>;
+                                               };
+                                       };
+
+                                       xbar_mix_in9_port: port@5c {
+                                               reg = <0x5c>;
+
+                                               xbar_mix_in9: endpoint {
+                                                       remote-endpoint = <&mix_in9>;
+                                               };
+                                       };
+
+                                       xbar_mix_in10_port: port@5d {
+                                               reg = <0x5d>;
+
+                                               xbar_mix_in10: endpoint {
+                                                       remote-endpoint = <&mix_in10>;
+                                               };
+                                       };
+
+                                       port@5e {
+                                               reg = <0x5e>;
+
+                                               xbar_mix_out1: endpoint {
+                                                       remote-endpoint = <&mix_out1>;
+                                               };
+                                       };
+
+                                       port@5f {
+                                               reg = <0x5f>;
+
+                                               xbar_mix_out2: endpoint {
+                                                       remote-endpoint = <&mix_out2>;
+                                               };
+                                       };
+
+                                       port@60 {
+                                               reg = <0x60>;
+
+                                               xbar_mix_out3: endpoint {
+                                                       remote-endpoint = <&mix_out3>;
+                                               };
+                                       };
+
+                                       port@61 {
+                                               reg = <0x61>;
+
+                                               xbar_mix_out4: endpoint {
+                                                       remote-endpoint = <&mix_out4>;
+                                               };
+                                       };
+
+                                       port@62 {
+                                               reg = <0x62>;
+
+                                               xbar_mix_out5: endpoint {
+                                                       remote-endpoint = <&mix_out5>;
+                                               };
+                                       };
+                               };
+
+                               i2s@2901000 {
+                                       status = "okay";
+
+                                       ports {
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+
+                                               port@0 {
+                                                       reg = <0>;
+
+                                                       i2s1_cif: endpoint {
+                                                               remote-endpoint = <&xbar_i2s1>;
+                                                       };
+                                               };
+
+                                               i2s1_port: port@1 {
+                                                       reg = <1>;
+
+                                                       i2s1_dap: endpoint {
+                                                               dai-format = "i2s";
+                                                               /* placeholder for external codec */
+                                                       };
+                                               };
+                                       };
+                               };
+
+                               i2s@2901100 {
+                                       status = "okay";
+
+                                       ports {
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+
+                                               port@0 {
+                                                       reg = <0>;
+
+                                                       i2s2_cif: endpoint {
+                                                               remote-endpoint = <&xbar_i2s2>;
+                                                       };
+                                               };
+
+                                               i2s2_port: port@1 {
+                                                       reg = <1>;
+
+                                                       i2s2_dap: endpoint {
+                                                               dai-format = "i2s";
+                                                               /* placeholder for external codec */
+                                                       };
+                                               };
+                                       };
+                               };
+
+                               i2s@2901300 {
+                                       status = "okay";
+
+                                       ports {
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+
+                                               port@0 {
+                                                       reg = <0>;
+
+                                                       i2s4_cif: endpoint {
+                                                               remote-endpoint = <&xbar_i2s4>;
+                                                       };
+                                               };
+
+                                               i2s4_port: port@1 {
+                                                       reg = <1>;
+
+                                                       i2s4_dap: endpoint {
+                                                               dai-format = "i2s";
+                                                               /* placeholder for external codec */
+                                                       };
+                                               };
+                                       };
+                               };
+
+                               i2s@2901500 {
+                                       status = "okay";
+
+                                       ports {
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+
+                                               port@0 {
+                                                       reg = <0>;
+
+                                                       i2s6_cif: endpoint {
+                                                               remote-endpoint = <&xbar_i2s6>;
+                                                       };
+                                               };
+
+                                               i2s6_port: port@1 {
+                                                       reg = <1>;
+
+                                                       i2s6_dap: endpoint {
+                                                               dai-format = "i2s";
+                                                               /* placeholder for external codec */
+                                                       };
+                                               };
+                                       };
+                               };
+
+                               sfc@2902000 {
+                                       status = "okay";
+
+                                       ports {
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+
+                                               port@0 {
+                                                       reg = <0>;
+
+                                                       sfc1_cif_in: endpoint {
+                                                               remote-endpoint = <&xbar_sfc1_in>;
+                                                       };
+                                               };
+
+                                               sfc1_out_port: port@1 {
+                                                       reg = <1>;
+
+                                                       sfc1_cif_out: endpoint {
+                                                               remote-endpoint = <&xbar_sfc1_out>;
+                                                       };
+                                               };
+                                       };
+                               };
+
+                               sfc@2902200 {
+                                       status = "okay";
+
+                                       ports {
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+
+                                               port@0 {
+                                                       reg = <0>;
+
+                                                       sfc2_cif_in: endpoint {
+                                                               remote-endpoint = <&xbar_sfc2_in>;
+                                                       };
+                                               };
+
+                                               sfc2_out_port: port@1 {
+                                                       reg = <1>;
+
+                                                       sfc2_cif_out: endpoint {
+                                                               remote-endpoint = <&xbar_sfc2_out>;
+                                                       };
+                                               };
+                                       };
+                               };
+
+                               sfc@2902400 {
+                                       status = "okay";
+
+                                       ports {
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+
+                                               port@0 {
+                                                       reg = <0>;
+
+                                                       sfc3_cif_in: endpoint {
+                                                               remote-endpoint = <&xbar_sfc3_in>;
+                                                       };
+                                               };
+
+                                               sfc3_out_port: port@1 {
+                                                       reg = <1>;
+
+                                                       sfc3_cif_out: endpoint {
+                                                               remote-endpoint = <&xbar_sfc3_out>;
+                                                       };
+                                               };
+                                       };
+                               };
+
+                               sfc@2902600 {
+                                       status = "okay";
+
+                                       ports {
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+
+                                               port@0 {
+                                                       reg = <0>;
+
+                                                       sfc4_cif_in: endpoint {
+                                                               remote-endpoint = <&xbar_sfc4_in>;
+                                                       };
+                                               };
+
+                                               sfc4_out_port: port@1 {
+                                                       reg = <1>;
+
+                                                       sfc4_cif_out: endpoint {
+                                                               remote-endpoint = <&xbar_sfc4_out>;
+                                                       };
+                                               };
+                                       };
+                               };
+
+                               amx@2903000 {
+                                       status = "okay";
+
+                                       ports {
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+
+                                               port@0 {
+                                                       reg = <0>;
+
+                                                       amx1_in1: endpoint {
+                                                               remote-endpoint = <&xbar_amx1_in1>;
+                                                       };
+                                               };
+
+                                               port@1 {
+                                                       reg = <1>;
+
+                                                       amx1_in2: endpoint {
+                                                               remote-endpoint = <&xbar_amx1_in2>;
+                                                       };
+                                               };
+
+                                               port@2 {
+                                                       reg = <2>;
+
+                                                       amx1_in3: endpoint {
+                                                               remote-endpoint = <&xbar_amx1_in3>;
+                                                       };
+                                               };
+
+                                               port@3 {
+                                                       reg = <3>;
+
+                                                       amx1_in4: endpoint {
+                                                               remote-endpoint = <&xbar_amx1_in4>;
+                                                       };
+                                               };
+
+                                               amx1_out_port: port@4 {
+                                                       reg = <4>;
+
+                                                       amx1_out: endpoint {
+                                                               remote-endpoint = <&xbar_amx1_out>;
+                                                       };
+                                               };
+                                       };
+                               };
+
+                               amx@2903100 {
+                                       status = "okay";
+
+                                       ports {
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+
+                                               port@0 {
+                                                       reg = <0>;
+
+                                                       amx2_in1: endpoint {
+                                                               remote-endpoint = <&xbar_amx2_in1>;
+                                                       };
+                                               };
+
+                                               port@1 {
+                                                       reg = <1>;
+
+                                                       amx2_in2: endpoint {
+                                                               remote-endpoint = <&xbar_amx2_in2>;
+                                                       };
+                                               };
+
+                                               port@2 {
+                                                       reg = <2>;
+
+                                                       amx2_in3: endpoint {
+                                                               remote-endpoint = <&xbar_amx2_in3>;
+                                                       };
+                                               };
+
+                                               port@3 {
+                                                       reg = <3>;
+
+                                                       amx2_in4: endpoint {
+                                                               remote-endpoint = <&xbar_amx2_in4>;
+                                                       };
+                                               };
+
+                                               amx2_out_port: port@4 {
+                                                       reg = <4>;
+
+                                                       amx2_out: endpoint {
+                                                               remote-endpoint = <&xbar_amx2_out>;
+                                                       };
+                                               };
+                                       };
+                               };
+
+                               amx@2903200 {
+                                       status = "okay";
+
+                                       ports {
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+
+                                               port@0 {
+                                                       reg = <0>;
+
+                                                       amx3_in1: endpoint {
+                                                               remote-endpoint = <&xbar_amx3_in1>;
+                                                       };
+                                               };
+
+                                               port@1 {
+                                                       reg = <1>;
+
+                                                       amx3_in2: endpoint {
+                                                               remote-endpoint = <&xbar_amx3_in2>;
+                                                       };
+                                               };
+
+                                               port@2 {
+                                                       reg = <2>;
+
+                                                       amx3_in3: endpoint {
+                                                               remote-endpoint = <&xbar_amx3_in3>;
+                                                       };
+                                               };
+
+                                               port@3 {
+                                                       reg = <3>;
+
+                                                       amx3_in4: endpoint {
+                                                               remote-endpoint = <&xbar_amx3_in4>;
+                                                       };
+                                               };
+
+                                               amx3_out_port: port@4 {
+                                                       reg = <4>;
+
+                                                       amx3_out: endpoint {
+                                                               remote-endpoint = <&xbar_amx3_out>;
+                                                       };
+                                               };
+                                       };
+                               };
+
+                               amx@2903300 {
+                                       status = "okay";
+
+                                       ports {
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+
+                                               port@0 {
+                                                       reg = <0>;
+
+                                                       amx4_in1: endpoint {
+                                                               remote-endpoint = <&xbar_amx4_in1>;
+                                                       };
+                                               };
+
+                                               port@1 {
+                                                       reg = <1>;
+
+                                                       amx4_in2: endpoint {
+                                                               remote-endpoint = <&xbar_amx4_in2>;
+                                                       };
+                                               };
+
+                                               port@2 {
+                                                       reg = <2>;
+
+                                                       amx4_in3: endpoint {
+                                                               remote-endpoint = <&xbar_amx4_in3>;
+                                                       };
+                                               };
+
+                                               port@3 {
+                                                       reg = <3>;
+
+                                                       amx4_in4: endpoint {
+                                                               remote-endpoint = <&xbar_amx4_in4>;
+                                                       };
+                                               };
+
+                                               amx4_out_port: port@4 {
+                                                       reg = <4>;
+
+                                                       amx4_out: endpoint {
+                                                               remote-endpoint = <&xbar_amx4_out>;
+                                                       };
+                                               };
+                                       };
+                               };
+
+                               adx@2903800 {
+                                       status = "okay";
+
+                                       ports {
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+
+                                               port@0 {
+                                                       reg = <0>;
+
+                                                       adx1_in: endpoint {
+                                                               remote-endpoint = <&xbar_adx1_in>;
+                                                       };
+                                               };
+
+                                               adx1_out1_port: port@1 {
+                                                       reg = <1>;
+
+                                                       adx1_out1: endpoint {
+                                                               remote-endpoint = <&xbar_adx1_out1>;
+                                                       };
+                                               };
+
+                                               adx1_out2_port: port@2 {
+                                                       reg = <2>;
+
+                                                       adx1_out2: endpoint {
+                                                               remote-endpoint = <&xbar_adx1_out2>;
+                                                       };
+                                               };
+
+                                               adx1_out3_port: port@3 {
+                                                       reg = <3>;
+
+                                                       adx1_out3: endpoint {
+                                                               remote-endpoint = <&xbar_adx1_out3>;
+                                                       };
+                                               };
+
+                                               adx1_out4_port: port@4 {
+                                                       reg = <4>;
+
+                                                       adx1_out4: endpoint {
+                                                               remote-endpoint = <&xbar_adx1_out4>;
+                                                       };
+                                               };
+                                       };
+                               };
+
+                               adx@2903900 {
+                                       status = "okay";
+
+                                       ports {
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+
+                                               port@0 {
+                                                       reg = <0>;
+
+                                                       adx2_in: endpoint {
+                                                               remote-endpoint = <&xbar_adx2_in>;
+                                                       };
+                                               };
+
+                                               adx2_out1_port: port@1 {
+                                                       reg = <1>;
+
+                                                       adx2_out1: endpoint {
+                                                               remote-endpoint = <&xbar_adx2_out1>;
+                                                       };
+                                               };
+
+                                               adx2_out2_port: port@2 {
+                                                       reg = <2>;
+
+                                                       adx2_out2: endpoint {
+                                                               remote-endpoint = <&xbar_adx2_out2>;
+                                                       };
+                                               };
+
+                                               adx2_out3_port: port@3 {
+                                                       reg = <3>;
+
+                                                       adx2_out3: endpoint {
+                                                               remote-endpoint = <&xbar_adx2_out3>;
+                                                       };
+                                               };
+
+                                               adx2_out4_port: port@4 {
+                                                       reg = <4>;
+
+                                                       adx2_out4: endpoint {
+                                                               remote-endpoint = <&xbar_adx2_out4>;
+                                                       };
+                                               };
+                                       };
+                               };
+
+                               adx@2903a00 {
+                                       status = "okay";
+
+                                       ports {
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+
+                                               port@0 {
+                                                       reg = <0>;
+
+                                                       adx3_in: endpoint {
+                                                               remote-endpoint = <&xbar_adx3_in>;
+                                                       };
+                                               };
+
+                                               adx3_out1_port: port@1 {
+                                                       reg = <1>;
+
+                                                       adx3_out1: endpoint {
+                                                               remote-endpoint = <&xbar_adx3_out1>;
+                                                       };
+                                               };
+
+                                               adx3_out2_port: port@2 {
+                                                       reg = <2>;
+
+                                                       adx3_out2: endpoint {
+                                                               remote-endpoint = <&xbar_adx3_out2>;
+                                                       };
+                                               };
+
+                                               adx3_out3_port: port@3 {
+                                                       reg = <3>;
+
+                                                       adx3_out3: endpoint {
+                                                               remote-endpoint = <&xbar_adx3_out3>;
+                                                       };
+                                               };
+
+                                               adx3_out4_port: port@4 {
+                                                       reg = <4>;
+
+                                                       adx3_out4: endpoint {
+                                                               remote-endpoint = <&xbar_adx3_out4>;
+                                                       };
+                                               };
+                                       };
+                               };
+
+                               adx@2903b00 {
+                                       status = "okay";
+
+                                       ports {
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+
+                                               port@0 {
+                                                       reg = <0>;
+
+                                                       adx4_in: endpoint {
+                                                               remote-endpoint = <&xbar_adx4_in>;
+                                                       };
+                                               };
+
+                                               adx4_out1_port: port@1 {
+                                                       reg = <1>;
+
+                                                       adx4_out1: endpoint {
+                                                               remote-endpoint = <&xbar_adx4_out1>;
+                                                       };
+                                               };
+
+                                               adx4_out2_port: port@2 {
+                                                       reg = <2>;
+
+                                                       adx4_out2: endpoint {
+                                                               remote-endpoint = <&xbar_adx4_out2>;
+                                                       };
+                                               };
+
+                                               adx4_out3_port: port@3 {
+                                                       reg = <3>;
+
+                                                       adx4_out3: endpoint {
+                                                               remote-endpoint = <&xbar_adx4_out3>;
+                                                       };
+                                               };
+
+                                               adx4_out4_port: port@4 {
+                                                       reg = <4>;
+
+                                                       adx4_out4: endpoint {
+                                                               remote-endpoint = <&xbar_adx4_out4>;
+                                                       };
+                                               };
+                                       };
+                               };
+
+                               dmic@2904200 {
+                                       status = "okay";
+
+                                       ports {
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+
+                                               port@0 {
+                                                       reg = <0>;
+
+                                                       dmic3_cif: endpoint {
+                                                               remote-endpoint = <&xbar_dmic3>;
+                                                       };
+                                               };
+
+                                               dmic3_port: port@1 {
+                                                       reg = <1>;
+
+                                                       dmic3_dap: endpoint {
+                                                               /* placeholder for external codec */
+                                                       };
+                                               };
+                                       };
+                               };
+
+                               mvc@290a000 {
+                                       status = "okay";
+
+                                       ports {
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+
+                                               port@0 {
+                                                       reg = <0>;
+
+                                                       mvc1_cif_in: endpoint {
+                                                               remote-endpoint = <&xbar_mvc1_in>;
+                                                       };
+                                               };
+
+                                               mvc1_out_port: port@1 {
+                                                       reg = <1>;
+
+                                                       mvc1_cif_out: endpoint {
+                                                               remote-endpoint = <&xbar_mvc1_out>;
+                                                       };
+                                               };
+                                       };
+                               };
+
+                               mvc@290a200 {
+                                       status = "okay";
+
+                                       ports {
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+
+                                               port@0 {
+                                                       reg = <0>;
+
+                                                       mvc2_cif_in: endpoint {
+                                                               remote-endpoint = <&xbar_mvc2_in>;
+                                                       };
+                                               };
+
+                                               mvc2_out_port: port@1 {
+                                                       reg = <1>;
+
+                                                       mvc2_cif_out: endpoint {
+                                                               remote-endpoint = <&xbar_mvc2_out>;
+                                                       };
+                                               };
+                                       };
+                               };
+
+                               amixer@290bb00 {
+                                       status = "okay";
+
+                                       ports {
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+
+                                               port@0 {
+                                                       reg = <0x0>;
+
+                                                       mix_in1: endpoint {
+                                                               remote-endpoint = <&xbar_mix_in1>;
+                                                       };
+                                               };
+
+                                               port@1 {
+                                                       reg = <0x1>;
+
+                                                       mix_in2: endpoint {
+                                                               remote-endpoint = <&xbar_mix_in2>;
+                                                       };
+                                               };
+
+                                               port@2 {
+                                                       reg = <0x2>;
+
+                                                       mix_in3: endpoint {
+                                                               remote-endpoint = <&xbar_mix_in3>;
+                                                       };
+                                               };
+
+                                               port@3 {
+                                                       reg = <0x3>;
+
+                                                       mix_in4: endpoint {
+                                                               remote-endpoint = <&xbar_mix_in4>;
+                                                       };
+                                               };
+
+                                               port@4 {
+                                                       reg = <0x4>;
+
+                                                       mix_in5: endpoint {
+                                                               remote-endpoint = <&xbar_mix_in5>;
+                                                       };
+                                               };
+
+                                               port@5 {
+                                                       reg = <0x5>;
+
+                                                       mix_in6: endpoint {
+                                                               remote-endpoint = <&xbar_mix_in6>;
+                                                       };
+                                               };
+
+                                               port@6 {
+                                                       reg = <0x6>;
+
+                                                       mix_in7: endpoint {
+                                                               remote-endpoint = <&xbar_mix_in7>;
+                                                       };
+                                               };
+
+                                               port@7 {
+                                                       reg = <0x7>;
+
+                                                       mix_in8: endpoint {
+                                                               remote-endpoint = <&xbar_mix_in8>;
+                                                       };
+                                               };
+
+                                               port@8 {
+                                                       reg = <0x8>;
+
+                                                       mix_in9: endpoint {
+                                                               remote-endpoint = <&xbar_mix_in9>;
+                                                       };
+                                               };
+
+                                               port@9 {
+                                                       reg = <0x9>;
+
+                                                       mix_in10: endpoint {
+                                                               remote-endpoint = <&xbar_mix_in10>;
+                                                       };
+                                               };
+
+                                               mix_out1_port: port@a {
+                                                       reg = <0xa>;
+
+                                                       mix_out1: endpoint {
+                                                               remote-endpoint = <&xbar_mix_out1>;
+                                                       };
+                                               };
+
+                                               mix_out2_port: port@b {
+                                                       reg = <0xb>;
+
+                                                       mix_out2: endpoint {
+                                                               remote-endpoint = <&xbar_mix_out2>;
+                                                       };
+                                               };
+
+                                               mix_out3_port: port@c {
+                                                       reg = <0xc>;
+
+                                                       mix_out3: endpoint {
+                                                               remote-endpoint = <&xbar_mix_out3>;
+                                                       };
+                                               };
+
+                                               mix_out4_port: port@d {
+                                                       reg = <0xd>;
+
+                                                       mix_out4: endpoint {
+                                                               remote-endpoint = <&xbar_mix_out4>;
+                                                       };
+                                               };
+
+                                               mix_out5_port: port@e {
+                                                       reg = <0xe>;
+
+                                                       mix_out5: endpoint {
+                                                               remote-endpoint = <&xbar_mix_out5>;
+                                                       };
+                                               };
+                                       };
+                               };
+
+                               admaif@290f000 {
+                                       status = "okay";
+
+                                       ports {
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+
+                                               admaif0_port: port@0 {
+                                                       reg = <0x0>;
+
+                                                       admaif0: endpoint {
+                                                               remote-endpoint = <&xbar_admaif0>;
+                                                       };
+                                               };
+
+                                               admaif1_port: port@1 {
+                                                       reg = <0x1>;
+
+                                                       admaif1: endpoint {
+                                                               remote-endpoint = <&xbar_admaif1>;
+                                                       };
+                                               };
+
+                                               admaif2_port: port@2 {
+                                                       reg = <0x2>;
+
+                                                       admaif2: endpoint {
+                                                               remote-endpoint = <&xbar_admaif2>;
+                                                       };
+                                               };
+
+                                               admaif3_port: port@3 {
+                                                       reg = <0x3>;
+
+                                                       admaif3: endpoint {
+                                                               remote-endpoint = <&xbar_admaif3>;
+                                                       };
+                                               };
+
+                                               admaif4_port: port@4 {
+                                                       reg = <0x4>;
+
+                                                       admaif4: endpoint {
+                                                               remote-endpoint = <&xbar_admaif4>;
+                                                       };
+                                               };
+
+                                               admaif5_port: port@5 {
+                                                       reg = <0x5>;
+
+                                                       admaif5: endpoint {
+                                                               remote-endpoint = <&xbar_admaif5>;
+                                                       };
+                                               };
+
+                                               admaif6_port: port@6 {
+                                                       reg = <0x6>;
+
+                                                       admaif6: endpoint {
+                                                               remote-endpoint = <&xbar_admaif6>;
+                                                       };
+                                               };
+
+                                               admaif7_port: port@7 {
+                                                       reg = <0x7>;
+
+                                                       admaif7: endpoint {
+                                                               remote-endpoint = <&xbar_admaif7>;
+                                                       };
+                                               };
+
+                                               admaif8_port: port@8 {
+                                                       reg = <0x8>;
+
+                                                       admaif8: endpoint {
+                                                               remote-endpoint = <&xbar_admaif8>;
+                                                       };
+                                               };
+
+                                               admaif9_port: port@9 {
+                                                       reg = <0x9>;
+
+                                                       admaif9: endpoint {
+                                                               remote-endpoint = <&xbar_admaif9>;
+                                                       };
+                                               };
+
+                                               admaif10_port: port@a {
+                                                       reg = <0xa>;
+
+                                                       admaif10: endpoint {
+                                                               remote-endpoint = <&xbar_admaif10>;
+                                                       };
+                                               };
+
+                                               admaif11_port: port@b {
+                                                       reg = <0xb>;
+
+                                                       admaif11: endpoint {
+                                                               remote-endpoint = <&xbar_admaif11>;
+                                                       };
+                                               };
+
+                                               admaif12_port: port@c {
+                                                       reg = <0xc>;
+
+                                                       admaif12: endpoint {
+                                                               remote-endpoint = <&xbar_admaif12>;
+                                                       };
+                                               };
+
+                                               admaif13_port: port@d {
+                                                       reg = <0xd>;
+
+                                                       admaif13: endpoint {
+                                                               remote-endpoint = <&xbar_admaif13>;
+                                                       };
+                                               };
+
+                                               admaif14_port: port@e {
+                                                       reg = <0xe>;
+
+                                                       admaif14: endpoint {
+                                                               remote-endpoint = <&xbar_admaif14>;
+                                                       };
+                                               };
+
+                                               admaif15_port: port@f {
+                                                       reg = <0xf>;
+
+                                                       admaif15: endpoint {
+                                                               remote-endpoint = <&xbar_admaif15>;
+                                                       };
+                                               };
+
+                                               admaif16_port: port@10 {
+                                                       reg = <0x10>;
+
+                                                       admaif16: endpoint {
+                                                               remote-endpoint = <&xbar_admaif16>;
+                                                       };
+                                               };
+
+                                               admaif17_port: port@11 {
+                                                       reg = <0x11>;
+
+                                                       admaif17: endpoint {
+                                                               remote-endpoint = <&xbar_admaif17>;
+                                                       };
+                                               };
+
+                                               admaif18_port: port@12 {
+                                                       reg = <0x12>;
+
+                                                       admaif18: endpoint {
+                                                               remote-endpoint = <&xbar_admaif18>;
+                                                       };
+                                               };
+
+                                               admaif19_port: port@13 {
+                                                       reg = <0x13>;
+
+                                                       admaif19: endpoint {
+                                                               remote-endpoint = <&xbar_admaif19>;
+                                                       };
+                                               };
+                                       };
+                               };
+                       };
+
+                       dma-controller@2930000 {
+                               status = "okay";
+                       };
+
+                       interrupt-controller@2a40000 {
+                               status = "okay";
+                       };
+               };
+
+               serial@3100000 {
+                       compatible = "nvidia,tegra194-hsuart";
+                       status = "okay";
+               };
+
+               hda@3510000 {
+                       nvidia,model = "NVIDIA Jetson AGX Orin HDA";
+               };
        };
 
        chosen {
                stdout-path = "serial0:115200n8";
        };
 
+       gpio-keys {
+               compatible = "gpio-keys";
+               status = "okay";
+
+               force-recovery {
+                       label = "Force Recovery";
+                       gpios = <&gpio TEGRA234_MAIN_GPIO(G, 0) GPIO_ACTIVE_LOW>;
+                       linux,input-type = <EV_KEY>;
+                       linux,code = <BTN_1>;
+               };
+
+               power-key {
+                       label = "Power";
+                       gpios = <&gpio_aon TEGRA234_AON_GPIO(EE, 4) GPIO_ACTIVE_LOW>;
+                       linux,input-type = <EV_KEY>;
+                       linux,code = <KEY_POWER>;
+                       wakeup-event-action = <EV_ACT_ASSERTED>;
+                       wakeup-source;
+               };
+
+               suspend {
+                       label = "Suspend";
+                       gpios = <&gpio TEGRA234_MAIN_GPIO(G, 2) GPIO_ACTIVE_LOW>;
+                       linux,input-type = <EV_KEY>;
+                       linux,code = <KEY_SLEEP>;
+               };
+       };
+
        serial {
                status = "okay";
        };
+
+       sound {
+               status = "okay";
+
+               compatible = "nvidia,tegra186-audio-graph-card";
+
+               dais = /* ADMAIF (FE) Ports */
+                      <&admaif0_port>, <&admaif1_port>, <&admaif2_port>, <&admaif3_port>,
+                      <&admaif4_port>, <&admaif5_port>, <&admaif6_port>, <&admaif7_port>,
+                      <&admaif8_port>, <&admaif9_port>, <&admaif10_port>, <&admaif11_port>,
+                      <&admaif12_port>, <&admaif13_port>, <&admaif14_port>, <&admaif15_port>,
+                      <&admaif16_port>, <&admaif17_port>, <&admaif18_port>, <&admaif19_port>,
+                      /* XBAR Ports */
+                      <&xbar_i2s1_port>, <&xbar_i2s2_port>, <&xbar_i2s4_port>,
+                      <&xbar_i2s6_port>, <&xbar_dmic3_port>,
+                      <&xbar_sfc1_in_port>, <&xbar_sfc2_in_port>,
+                      <&xbar_sfc3_in_port>, <&xbar_sfc4_in_port>,
+                      <&xbar_mvc1_in_port>, <&xbar_mvc2_in_port>,
+                      <&xbar_amx1_in1_port>, <&xbar_amx1_in2_port>,
+                      <&xbar_amx1_in3_port>, <&xbar_amx1_in4_port>,
+                      <&xbar_amx2_in1_port>, <&xbar_amx2_in2_port>,
+                      <&xbar_amx2_in3_port>, <&xbar_amx2_in4_port>,
+                      <&xbar_amx3_in1_port>, <&xbar_amx3_in2_port>,
+                      <&xbar_amx3_in3_port>, <&xbar_amx3_in4_port>,
+                      <&xbar_amx4_in1_port>, <&xbar_amx4_in2_port>,
+                      <&xbar_amx4_in3_port>, <&xbar_amx4_in4_port>,
+                      <&xbar_adx1_in_port>, <&xbar_adx2_in_port>,
+                      <&xbar_adx3_in_port>, <&xbar_adx4_in_port>,
+                      <&xbar_mix_in1_port>, <&xbar_mix_in2_port>,
+                      <&xbar_mix_in3_port>, <&xbar_mix_in4_port>,
+                      <&xbar_mix_in5_port>, <&xbar_mix_in6_port>,
+                      <&xbar_mix_in7_port>, <&xbar_mix_in8_port>,
+                      <&xbar_mix_in9_port>, <&xbar_mix_in10_port>,
+                      /* HW accelerators */
+                      <&sfc1_out_port>, <&sfc2_out_port>,
+                      <&sfc3_out_port>, <&sfc4_out_port>,
+                      <&mvc1_out_port>, <&mvc2_out_port>,
+                      <&amx1_out_port>, <&amx2_out_port>,
+                      <&amx3_out_port>, <&amx4_out_port>,
+                      <&adx1_out1_port>, <&adx1_out2_port>,
+                      <&adx1_out3_port>, <&adx1_out4_port>,
+                      <&adx2_out1_port>, <&adx2_out2_port>,
+                      <&adx2_out3_port>, <&adx2_out4_port>,
+                      <&adx3_out1_port>, <&adx3_out2_port>,
+                      <&adx3_out3_port>, <&adx3_out4_port>,
+                      <&adx4_out1_port>, <&adx4_out2_port>,
+                      <&adx4_out3_port>, <&adx4_out4_port>,
+                      <&mix_out1_port>, <&mix_out2_port>, <&mix_out3_port>,
+                      <&mix_out4_port>, <&mix_out5_port>,
+                      /* BE I/O Ports */
+                      <&i2s1_port>, <&i2s2_port>, <&i2s4_port>, <&i2s6_port>,
+                      <&dmic3_port>;
+
+               label = "NVIDIA Jetson AGX Orin APE";
+       };
 };
index 6b6f158..aaace60 100644 (file)
@@ -1,9 +1,11 @@
 // SPDX-License-Identifier: GPL-2.0
 
 #include <dt-bindings/clock/tegra234-clock.h>
+#include <dt-bindings/gpio/tegra234-gpio.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/mailbox/tegra186-hsp.h>
 #include <dt-bindings/memory/tegra234-mc.h>
+#include <dt-bindings/power/tegra234-powergate.h>
 #include <dt-bindings/reset/tegra234-reset.h>
 
 / {
 
                ranges = <0x0 0x0 0x0 0x40000000>;
 
+               aconnect@2900000 {
+                       compatible = "nvidia,tegra234-aconnect",
+                                    "nvidia,tegra210-aconnect";
+                       clocks = <&bpmp TEGRA234_CLK_APE>,
+                                <&bpmp TEGRA234_CLK_APB2APE>;
+                       clock-names = "ape", "apb2ape";
+                       power-domains = <&bpmp TEGRA234_POWER_DOMAIN_AUD>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0x02900000 0x02900000 0x200000>;
+                       status = "disabled";
+
+                       tegra_ahub: ahub@2900800 {
+                               compatible = "nvidia,tegra234-ahub";
+                               reg = <0x02900800 0x800>;
+                               clocks = <&bpmp TEGRA234_CLK_AHUB>;
+                               clock-names = "ahub";
+                               assigned-clocks = <&bpmp TEGRA234_CLK_AHUB>;
+                               assigned-clock-parents = <&bpmp TEGRA234_CLK_PLLA_OUT0>;
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               ranges = <0x02900800 0x02900800 0x11800>;
+                               status = "disabled";
+
+                               tegra_i2s1: i2s@2901000 {
+                                       compatible = "nvidia,tegra234-i2s",
+                                                    "nvidia,tegra210-i2s";
+                                       reg = <0x2901000 0x100>;
+                                       clocks = <&bpmp TEGRA234_CLK_I2S1>,
+                                                <&bpmp TEGRA234_CLK_I2S1_SYNC_INPUT>;
+                                       clock-names = "i2s", "sync_input";
+                                       assigned-clocks = <&bpmp TEGRA234_CLK_I2S1>;
+                                       assigned-clock-parents = <&bpmp TEGRA234_CLK_PLLA_OUT0>;
+                                       assigned-clock-rates = <1536000>;
+                                       sound-name-prefix = "I2S1";
+                                       status = "disabled";
+                               };
+
+                               tegra_i2s2: i2s@2901100 {
+                                       compatible = "nvidia,tegra234-i2s",
+                                                    "nvidia,tegra210-i2s";
+                                       reg = <0x2901100 0x100>;
+                                       clocks = <&bpmp TEGRA234_CLK_I2S2>,
+                                                <&bpmp TEGRA234_CLK_I2S2_SYNC_INPUT>;
+                                       clock-names = "i2s", "sync_input";
+                                       assigned-clocks = <&bpmp TEGRA234_CLK_I2S2>;
+                                       assigned-clock-parents = <&bpmp TEGRA234_CLK_PLLA_OUT0>;
+                                       assigned-clock-rates = <1536000>;
+                                       sound-name-prefix = "I2S2";
+                                       status = "disabled";
+                               };
+
+                               tegra_i2s3: i2s@2901200 {
+                                       compatible = "nvidia,tegra234-i2s",
+                                                    "nvidia,tegra210-i2s";
+                                       reg = <0x2901200 0x100>;
+                                       clocks = <&bpmp TEGRA234_CLK_I2S3>,
+                                                <&bpmp TEGRA234_CLK_I2S3_SYNC_INPUT>;
+                                       clock-names = "i2s", "sync_input";
+                                       assigned-clocks = <&bpmp TEGRA234_CLK_I2S3>;
+                                       assigned-clock-parents = <&bpmp TEGRA234_CLK_PLLA_OUT0>;
+                                       assigned-clock-rates = <1536000>;
+                                       sound-name-prefix = "I2S3";
+                                       status = "disabled";
+                               };
+
+                               tegra_i2s4: i2s@2901300 {
+                                       compatible = "nvidia,tegra234-i2s",
+                                                    "nvidia,tegra210-i2s";
+                                       reg = <0x2901300 0x100>;
+                                       clocks = <&bpmp TEGRA234_CLK_I2S4>,
+                                                <&bpmp TEGRA234_CLK_I2S4_SYNC_INPUT>;
+                                       clock-names = "i2s", "sync_input";
+                                       assigned-clocks = <&bpmp TEGRA234_CLK_I2S4>;
+                                       assigned-clock-parents = <&bpmp TEGRA234_CLK_PLLA_OUT0>;
+                                       assigned-clock-rates = <1536000>;
+                                       sound-name-prefix = "I2S4";
+                                       status = "disabled";
+                               };
+
+                               tegra_i2s5: i2s@2901400 {
+                                       compatible = "nvidia,tegra234-i2s",
+                                                    "nvidia,tegra210-i2s";
+                                       reg = <0x2901400 0x100>;
+                                       clocks = <&bpmp TEGRA234_CLK_I2S5>,
+                                                <&bpmp TEGRA234_CLK_I2S5_SYNC_INPUT>;
+                                       clock-names = "i2s", "sync_input";
+                                       assigned-clocks = <&bpmp TEGRA234_CLK_I2S5>;
+                                       assigned-clock-parents = <&bpmp TEGRA234_CLK_PLLA_OUT0>;
+                                       assigned-clock-rates = <1536000>;
+                                       sound-name-prefix = "I2S5";
+                                       status = "disabled";
+                               };
+
+                               tegra_i2s6: i2s@2901500 {
+                                       compatible = "nvidia,tegra234-i2s",
+                                                    "nvidia,tegra210-i2s";
+                                       reg = <0x2901500 0x100>;
+                                       clocks = <&bpmp TEGRA234_CLK_I2S6>,
+                                                <&bpmp TEGRA234_CLK_I2S6_SYNC_INPUT>;
+                                       clock-names = "i2s", "sync_input";
+                                       assigned-clocks = <&bpmp TEGRA234_CLK_I2S6>;
+                                       assigned-clock-parents = <&bpmp TEGRA234_CLK_PLLA_OUT0>;
+                                       assigned-clock-rates = <1536000>;
+                                       sound-name-prefix = "I2S6";
+                                       status = "disabled";
+                               };
+
+                               tegra_sfc1: sfc@2902000 {
+                                       compatible = "nvidia,tegra234-sfc",
+                                                    "nvidia,tegra210-sfc";
+                                       reg = <0x2902000 0x200>;
+                                       sound-name-prefix = "SFC1";
+                                       status = "disabled";
+                               };
+
+                               tegra_sfc2: sfc@2902200 {
+                                       compatible = "nvidia,tegra234-sfc",
+                                                    "nvidia,tegra210-sfc";
+                                       reg = <0x2902200 0x200>;
+                                       sound-name-prefix = "SFC2";
+                                       status = "disabled";
+                               };
+
+                               tegra_sfc3: sfc@2902400 {
+                                       compatible = "nvidia,tegra234-sfc",
+                                                    "nvidia,tegra210-sfc";
+                                       reg = <0x2902400 0x200>;
+                                       sound-name-prefix = "SFC3";
+                                       status = "disabled";
+                               };
+
+                               tegra_sfc4: sfc@2902600 {
+                                       compatible = "nvidia,tegra234-sfc",
+                                                    "nvidia,tegra210-sfc";
+                                       reg = <0x2902600 0x200>;
+                                       sound-name-prefix = "SFC4";
+                                       status = "disabled";
+                               };
+
+                               tegra_amx1: amx@2903000 {
+                                       compatible = "nvidia,tegra234-amx",
+                                                    "nvidia,tegra194-amx";
+                                       reg = <0x2903000 0x100>;
+                                       sound-name-prefix = "AMX1";
+                                       status = "disabled";
+                               };
+
+                               tegra_amx2: amx@2903100 {
+                                       compatible = "nvidia,tegra234-amx",
+                                                    "nvidia,tegra194-amx";
+                                       reg = <0x2903100 0x100>;
+                                       sound-name-prefix = "AMX2";
+                                       status = "disabled";
+                               };
+
+                               tegra_amx3: amx@2903200 {
+                                       compatible = "nvidia,tegra234-amx",
+                                                    "nvidia,tegra194-amx";
+                                       reg = <0x2903200 0x100>;
+                                       sound-name-prefix = "AMX3";
+                                       status = "disabled";
+                               };
+
+                               tegra_amx4: amx@2903300 {
+                                       compatible = "nvidia,tegra234-amx",
+                                                    "nvidia,tegra194-amx";
+                                       reg = <0x2903300 0x100>;
+                                       sound-name-prefix = "AMX4";
+                                       status = "disabled";
+                               };
+
+                               tegra_adx1: adx@2903800 {
+                                       compatible = "nvidia,tegra234-adx",
+                                                    "nvidia,tegra210-adx";
+                                       reg = <0x2903800 0x100>;
+                                       sound-name-prefix = "ADX1";
+                                       status = "disabled";
+                               };
+
+                               tegra_adx2: adx@2903900 {
+                                       compatible = "nvidia,tegra234-adx",
+                                                    "nvidia,tegra210-adx";
+                                       reg = <0x2903900 0x100>;
+                                       sound-name-prefix = "ADX2";
+                                       status = "disabled";
+                               };
+
+                               tegra_adx3: adx@2903a00 {
+                                       compatible = "nvidia,tegra234-adx",
+                                                    "nvidia,tegra210-adx";
+                                       reg = <0x2903a00 0x100>;
+                                       sound-name-prefix = "ADX3";
+                                       status = "disabled";
+                               };
+
+                               tegra_adx4: adx@2903b00 {
+                                       compatible = "nvidia,tegra234-adx",
+                                                    "nvidia,tegra210-adx";
+                                       reg = <0x2903b00 0x100>;
+                                       sound-name-prefix = "ADX4";
+                                       status = "disabled";
+                               };
+
+
+                               tegra_dmic1: dmic@2904000 {
+                                       compatible = "nvidia,tegra234-dmic",
+                                                    "nvidia,tegra210-dmic";
+                                       reg = <0x2904000 0x100>;
+                                       clocks = <&bpmp TEGRA234_CLK_DMIC1>;
+                                       clock-names = "dmic";
+                                       assigned-clocks = <&bpmp TEGRA234_CLK_DMIC1>;
+                                       assigned-clock-parents = <&bpmp TEGRA234_CLK_PLLA_OUT0>;
+                                       assigned-clock-rates = <3072000>;
+                                       sound-name-prefix = "DMIC1";
+                                       status = "disabled";
+                               };
+
+                               tegra_dmic2: dmic@2904100 {
+                                       compatible = "nvidia,tegra234-dmic",
+                                                    "nvidia,tegra210-dmic";
+                                       reg = <0x2904100 0x100>;
+                                       clocks = <&bpmp TEGRA234_CLK_DMIC2>;
+                                       clock-names = "dmic";
+                                       assigned-clocks = <&bpmp TEGRA234_CLK_DMIC2>;
+                                       assigned-clock-parents = <&bpmp TEGRA234_CLK_PLLA_OUT0>;
+                                       assigned-clock-rates = <3072000>;
+                                       sound-name-prefix = "DMIC2";
+                                       status = "disabled";
+                               };
+
+                               tegra_dmic3: dmic@2904200 {
+                                       compatible = "nvidia,tegra234-dmic",
+                                                    "nvidia,tegra210-dmic";
+                                       reg = <0x2904200 0x100>;
+                                       clocks = <&bpmp TEGRA234_CLK_DMIC3>;
+                                       clock-names = "dmic";
+                                       assigned-clocks = <&bpmp TEGRA234_CLK_DMIC3>;
+                                       assigned-clock-parents = <&bpmp TEGRA234_CLK_PLLA_OUT0>;
+                                       assigned-clock-rates = <3072000>;
+                                       sound-name-prefix = "DMIC3";
+                                       status = "disabled";
+                               };
+
+                               tegra_dmic4: dmic@2904300 {
+                                       compatible = "nvidia,tegra234-dmic",
+                                                    "nvidia,tegra210-dmic";
+                                       reg = <0x2904300 0x100>;
+                                       clocks = <&bpmp TEGRA234_CLK_DMIC4>;
+                                       clock-names = "dmic";
+                                       assigned-clocks = <&bpmp TEGRA234_CLK_DMIC4>;
+                                       assigned-clock-parents = <&bpmp TEGRA234_CLK_PLLA_OUT0>;
+                                       assigned-clock-rates = <3072000>;
+                                       sound-name-prefix = "DMIC4";
+                                       status = "disabled";
+                               };
+
+                               tegra_dspk1: dspk@2905000 {
+                                       compatible = "nvidia,tegra234-dspk",
+                                                    "nvidia,tegra186-dspk";
+                                       reg = <0x2905000 0x100>;
+                                       clocks = <&bpmp TEGRA234_CLK_DSPK1>;
+                                       clock-names = "dspk";
+                                       assigned-clocks = <&bpmp TEGRA234_CLK_DSPK1>;
+                                       assigned-clock-parents = <&bpmp TEGRA234_CLK_PLLA_OUT0>;
+                                       assigned-clock-rates = <12288000>;
+                                       sound-name-prefix = "DSPK1";
+                                       status = "disabled";
+                               };
+
+                               tegra_dspk2: dspk@2905100 {
+                                       compatible = "nvidia,tegra234-dspk",
+                                                    "nvidia,tegra186-dspk";
+                                       reg = <0x2905100 0x100>;
+                                       clocks = <&bpmp TEGRA234_CLK_DSPK2>;
+                                       clock-names = "dspk";
+                                       assigned-clocks = <&bpmp TEGRA234_CLK_DSPK2>;
+                                       assigned-clock-parents = <&bpmp TEGRA234_CLK_PLLA_OUT0>;
+                                       assigned-clock-rates = <12288000>;
+                                       sound-name-prefix = "DSPK2";
+                                       status = "disabled";
+                               };
+
+                               tegra_mvc1: mvc@290a000 {
+                                       compatible = "nvidia,tegra234-mvc",
+                                                    "nvidia,tegra210-mvc";
+                                       reg = <0x290a000 0x200>;
+                                       sound-name-prefix = "MVC1";
+                                       status = "disabled";
+                               };
+
+                               tegra_mvc2: mvc@290a200 {
+                                       compatible = "nvidia,tegra234-mvc",
+                                                    "nvidia,tegra210-mvc";
+                                       reg = <0x290a200 0x200>;
+                                       sound-name-prefix = "MVC2";
+                                       status = "disabled";
+                               };
+
+                               tegra_amixer: amixer@290bb00 {
+                                       compatible = "nvidia,tegra234-amixer",
+                                                    "nvidia,tegra210-amixer";
+                                       reg = <0x290bb00 0x800>;
+                                       sound-name-prefix = "MIXER1";
+                                       status = "disabled";
+                               };
+
+                               tegra_admaif: admaif@290f000 {
+                                       compatible = "nvidia,tegra234-admaif",
+                                                    "nvidia,tegra186-admaif";
+                                       reg = <0x0290f000 0x1000>;
+                                       dmas = <&adma 1>, <&adma 1>,
+                                              <&adma 2>, <&adma 2>,
+                                              <&adma 3>, <&adma 3>,
+                                              <&adma 4>, <&adma 4>,
+                                              <&adma 5>, <&adma 5>,
+                                              <&adma 6>, <&adma 6>,
+                                              <&adma 7>, <&adma 7>,
+                                              <&adma 8>, <&adma 8>,
+                                              <&adma 9>, <&adma 9>,
+                                              <&adma 10>, <&adma 10>,
+                                              <&adma 11>, <&adma 11>,
+                                              <&adma 12>, <&adma 12>,
+                                              <&adma 13>, <&adma 13>,
+                                              <&adma 14>, <&adma 14>,
+                                              <&adma 15>, <&adma 15>,
+                                              <&adma 16>, <&adma 16>,
+                                              <&adma 17>, <&adma 17>,
+                                              <&adma 18>, <&adma 18>,
+                                              <&adma 19>, <&adma 19>,
+                                              <&adma 20>, <&adma 20>;
+                                       dma-names = "rx1", "tx1",
+                                                   "rx2", "tx2",
+                                                   "rx3", "tx3",
+                                                   "rx4", "tx4",
+                                                   "rx5", "tx5",
+                                                   "rx6", "tx6",
+                                                   "rx7", "tx7",
+                                                   "rx8", "tx8",
+                                                   "rx9", "tx9",
+                                                   "rx10", "tx10",
+                                                   "rx11", "tx11",
+                                                   "rx12", "tx12",
+                                                   "rx13", "tx13",
+                                                   "rx14", "tx14",
+                                                   "rx15", "tx15",
+                                                   "rx16", "tx16",
+                                                   "rx17", "tx17",
+                                                   "rx18", "tx18",
+                                                   "rx19", "tx19",
+                                                   "rx20", "tx20";
+                                       interconnects = <&mc TEGRA234_MEMORY_CLIENT_APEDMAR &emc>,
+                                                       <&mc TEGRA234_MEMORY_CLIENT_APEDMAW &emc>;
+                                       interconnect-names = "dma-mem", "write";
+                                       iommus = <&smmu_niso0 TEGRA234_SID_APE>;
+                                       status = "disabled";
+                               };
+                       };
+
+                       adma: dma-controller@2930000 {
+                               compatible = "nvidia,tegra234-adma",
+                                            "nvidia,tegra186-adma";
+                               reg = <0x02930000 0x20000>;
+                               interrupt-parent = <&agic>;
+                               interrupts =  <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>,
+                                             <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
+                               #dma-cells = <1>;
+                               clocks = <&bpmp TEGRA234_CLK_AHUB>;
+                               clock-names = "d_audio";
+                               status = "disabled";
+                       };
+
+                       agic: interrupt-controller@2a40000 {
+                               compatible = "nvidia,tegra234-agic",
+                                            "nvidia,tegra210-agic";
+                               #interrupt-cells = <3>;
+                               interrupt-controller;
+                               reg = <0x02a41000 0x1000>,
+                                     <0x02a42000 0x2000>;
+                               interrupts = <GIC_SPI 145
+                                             (GIC_CPU_MASK_SIMPLE(4) |
+                                              IRQ_TYPE_LEVEL_HIGH)>;
+                               clocks = <&bpmp TEGRA234_CLK_APE>;
+                               clock-names = "clk";
+                               status = "disabled";
+                       };
+               };
+
                misc@100000 {
                        compatible = "nvidia,tegra234-misc";
                        reg = <0x00100000 0xf000>,
                        status = "disabled";
                };
 
+               gen1_i2c: i2c@3160000 {
+                       compatible = "nvidia,tegra194-i2c";
+                       reg = <0x3160000 0x100>;
+                       status = "disabled";
+                       interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
+                       clock-frequency = <400000>;
+                       clocks = <&bpmp TEGRA234_CLK_I2C1
+                                 &bpmp TEGRA234_CLK_PLLP_OUT0>;
+                       assigned-clocks = <&bpmp TEGRA234_CLK_I2C1>;
+                       assigned-clock-parents = <&bpmp TEGRA234_CLK_PLLP_OUT0>;
+                       clock-names = "div-clk", "parent";
+                       resets = <&bpmp TEGRA234_RESET_I2C1>;
+                       reset-names = "i2c";
+               };
+
+               cam_i2c: i2c@3180000 {
+                       compatible = "nvidia,tegra194-i2c";
+                       reg = <0x3180000 0x100>;
+                       interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
+                       status = "disabled";
+                       clock-frequency = <400000>;
+                       clocks = <&bpmp TEGRA234_CLK_I2C3
+                               &bpmp TEGRA234_CLK_PLLP_OUT0>;
+                       assigned-clocks = <&bpmp TEGRA234_CLK_I2C3>;
+                       assigned-clock-parents = <&bpmp TEGRA234_CLK_PLLP_OUT0>;
+                       clock-names = "div-clk", "parent";
+                       resets = <&bpmp TEGRA234_RESET_I2C3>;
+                       reset-names = "i2c";
+               };
+
+               dp_aux_ch1_i2c: i2c@3190000 {
+                       compatible = "nvidia,tegra194-i2c";
+                       reg = <0x3190000 0x100>;
+                       interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
+                       status = "disabled";
+                       clock-frequency = <100000>;
+                       clocks = <&bpmp TEGRA234_CLK_I2C4
+                               &bpmp TEGRA234_CLK_PLLP_OUT0>;
+                       assigned-clocks = <&bpmp TEGRA234_CLK_I2C4>;
+                       assigned-clock-parents = <&bpmp TEGRA234_CLK_PLLP_OUT0>;
+                       clock-names = "div-clk", "parent";
+                       resets = <&bpmp TEGRA234_RESET_I2C4>;
+                       reset-names = "i2c";
+               };
+
+               dp_aux_ch0_i2c: i2c@31b0000 {
+                       compatible = "nvidia,tegra194-i2c";
+                       reg = <0x31b0000 0x100>;
+                       interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
+                       status = "disabled";
+                       clock-frequency = <100000>;
+                       clocks = <&bpmp TEGRA234_CLK_I2C6
+                               &bpmp TEGRA234_CLK_PLLP_OUT0>;
+                       assigned-clocks = <&bpmp TEGRA234_CLK_I2C6>;
+                       assigned-clock-parents = <&bpmp TEGRA234_CLK_PLLP_OUT0>;
+                       clock-names = "div-clk", "parent";
+                       resets = <&bpmp TEGRA234_RESET_I2C6>;
+                       reset-names = "i2c";
+               };
+
+               dp_aux_ch2_i2c: i2c@31c0000 {
+                       compatible = "nvidia,tegra194-i2c";
+                       reg = <0x31c0000 0x100>;
+                       interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
+                       status = "disabled";
+                       clock-frequency = <100000>;
+                       clocks = <&bpmp TEGRA234_CLK_I2C7
+                               &bpmp TEGRA234_CLK_PLLP_OUT0>;
+                       assigned-clocks = <&bpmp TEGRA234_CLK_I2C7>;
+                       assigned-clock-parents = <&bpmp TEGRA234_CLK_PLLP_OUT0>;
+                       clock-names = "div-clk", "parent";
+                       resets = <&bpmp TEGRA234_RESET_I2C7>;
+                       reset-names = "i2c";
+               };
+
+               dp_aux_ch3_i2c: i2c@31e0000 {
+                       compatible = "nvidia,tegra194-i2c";
+                       reg = <0x31e0000 0x100>;
+                       interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
+                       status = "disabled";
+                       clock-frequency = <100000>;
+                       clocks = <&bpmp TEGRA234_CLK_I2C9
+                               &bpmp TEGRA234_CLK_PLLP_OUT0>;
+                       assigned-clocks = <&bpmp TEGRA234_CLK_I2C9>;
+                       assigned-clock-parents = <&bpmp TEGRA234_CLK_PLLP_OUT0>;
+                       clock-names = "div-clk", "parent";
+                       resets = <&bpmp TEGRA234_RESET_I2C9>;
+                       reset-names = "i2c";
+               };
+
+               pwm1: pwm@3280000 {
+                       compatible = "nvidia,tegra194-pwm",
+                                    "nvidia,tegra186-pwm";
+                       reg = <0x3280000 0x10000>;
+                       clocks = <&bpmp TEGRA234_CLK_PWM1>;
+                       clock-names = "pwm";
+                       resets = <&bpmp TEGRA234_RESET_PWM1>;
+                       reset-names = "pwm";
+                       status = "disabled";
+                       #pwm-cells = <2>;
+               };
+
                mmc@3460000 {
                        compatible = "nvidia,tegra234-sdhci", "nvidia,tegra186-sdhci";
                        reg = <0x03460000 0x20000>;
                        interconnects = <&mc TEGRA234_MEMORY_CLIENT_SDMMCRAB &emc>,
                                        <&mc TEGRA234_MEMORY_CLIENT_SDMMCWAB &emc>;
                        interconnect-names = "dma-mem", "write";
+                       iommus = <&smmu_niso1 TEGRA234_SID_SDMMC4>;
                        nvidia,pad-autocal-pull-up-offset-hs400 = <0x00>;
                        nvidia,pad-autocal-pull-down-offset-hs400 = <0x00>;
                        nvidia,pad-autocal-pull-up-offset-1v8-timeout = <0x0a>;
                        status = "disabled";
                };
 
+               hda@3510000 {
+                       compatible = "nvidia,tegra234-hda", "nvidia,tegra30-hda";
+                       reg = <0x3510000 0x10000>;
+                       interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&bpmp TEGRA234_CLK_AZA_BIT>,
+                                <&bpmp TEGRA234_CLK_AZA_2XBIT>;
+                       clock-names = "hda", "hda2codec_2x";
+                       resets = <&bpmp TEGRA234_RESET_HDA>,
+                                <&bpmp TEGRA234_RESET_HDACODEC>;
+                       reset-names = "hda", "hda2codec_2x";
+                       power-domains = <&bpmp TEGRA234_POWER_DOMAIN_DISP>;
+                       interconnects = <&mc TEGRA234_MEMORY_CLIENT_HDAR &emc>,
+                                       <&mc TEGRA234_MEMORY_CLIENT_HDAW &emc>;
+                       interconnect-names = "dma-mem", "write";
+                       status = "disabled";
+               };
+
                fuse@3810000 {
                        compatible = "nvidia,tegra234-efuse";
                        reg = <0x03810000 0x10000>;
                        #mbox-cells = <2>;
                };
 
+               smmu_niso1: iommu@8000000 {
+                       compatible = "nvidia,tegra234-smmu", "nvidia,smmu-500";
+                       reg = <0x8000000 0x1000000>,
+                             <0x7000000 0x1000000>;
+                       interrupts = <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 242 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 242 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>;
+                       stream-match-mask = <0x7f80>;
+                       #global-interrupts = <2>;
+                       #iommu-cells = <1>;
+
+                       nvidia,memory-controller = <&mc>;
+                       status = "okay";
+               };
+
                hsp_aon: hsp@c150000 {
                        compatible = "nvidia,tegra234-hsp", "nvidia,tegra194-hsp";
                        reg = <0x0c150000 0x90000>;
                        #mbox-cells = <2>;
                };
 
+               gen2_i2c: i2c@c240000 {
+                       compatible = "nvidia,tegra194-i2c";
+                       reg = <0xc240000 0x100>;
+                       interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
+                       status = "disabled";
+                       clock-frequency = <100000>;
+                       clocks = <&bpmp TEGRA234_CLK_I2C2
+                               &bpmp TEGRA234_CLK_PLLP_OUT0>;
+                       clock-names = "div-clk", "parent";
+                       assigned-clocks = <&bpmp TEGRA234_CLK_I2C2>;
+                       assigned-clock-parents = <&bpmp TEGRA234_CLK_PLLP_OUT0>;
+                       resets = <&bpmp TEGRA234_RESET_I2C2>;
+                       reset-names = "i2c";
+               };
+
+               gen8_i2c: i2c@c250000 {
+                       compatible = "nvidia,tegra194-i2c";
+                       reg = <0xc250000 0x100>;
+                       nvidia,hw-instance-id = <0x7>;
+                       interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+                       status = "disabled";
+                       clock-frequency = <400000>;
+                       clocks = <&bpmp TEGRA234_CLK_I2C8
+                               &bpmp TEGRA234_CLK_PLLP_OUT0>;
+                       clock-names = "div-clk", "parent";
+                       assigned-clocks = <&bpmp TEGRA234_CLK_I2C8>;
+                       assigned-clock-parents = <&bpmp TEGRA234_CLK_PLLP_OUT0>;
+                       resets = <&bpmp TEGRA234_RESET_I2C8>;
+                       reset-names = "i2c";
+               };
+
                rtc@c2a0000 {
                        compatible = "nvidia,tegra234-rtc", "nvidia,tegra20-rtc";
                        reg = <0x0c2a0000 0x10000>;
                        #interrupt-cells = <3>;
                        interrupt-controller;
                };
+
+               smmu_iso: iommu@10000000{
+                       compatible = "nvidia,tegra234-smmu", "nvidia,smmu-500";
+                       reg = <0x10000000 0x1000000>;
+                       interrupts = <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>;
+                       stream-match-mask = <0x7f80>;
+                       #global-interrupts = <1>;
+                       #iommu-cells = <1>;
+
+                       nvidia,memory-controller = <&mc>;
+                       status = "okay";
+               };
+
+               smmu_niso0: iommu@12000000 {
+                       compatible = "nvidia,tegra234-smmu", "nvidia,smmu-500";
+                       reg = <0x12000000 0x1000000>,
+                             <0x11000000 0x1000000>;
+                       interrupts = <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 232 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 232 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>;
+                       stream-match-mask = <0x7f80>;
+                       #global-interrupts = <2>;
+                       #iommu-cells = <1>;
+
+                       nvidia,memory-controller = <&mc>;
+                       status = "okay";
+               };
        };
 
        sram@40000000 {
                                <&mc TEGRA234_MEMORY_CLIENT_BPMPDMAR &emc>,
                                <&mc TEGRA234_MEMORY_CLIENT_BPMPDMAW &emc>;
                interconnect-names = "read", "write", "dma-mem", "dma-write";
+               iommus = <&smmu_niso1 TEGRA234_SID_BPMP>;
 
                bpmp_i2c: i2c {
                        compatible = "nvidia,tegra186-bpmp-i2c";
                status = "disabled";
        };
 
+       sound {
+               status = "disabled";
+
+               clocks = <&bpmp TEGRA234_CLK_PLLA>,
+                        <&bpmp TEGRA234_CLK_PLLA_OUT0>;
+               clock-names = "pll_a", "plla_out0";
+               assigned-clocks = <&bpmp TEGRA234_CLK_PLLA>,
+                                 <&bpmp TEGRA234_CLK_PLLA_OUT0>,
+                                 <&bpmp TEGRA234_CLK_AUD_MCLK>;
+               assigned-clock-parents = <0>,
+                                        <&bpmp TEGRA234_CLK_PLLA>,
+                                        <&bpmp TEGRA234_CLK_PLLA_OUT0>;
+       };
+
        timer {
                compatible = "arm,armv8-timer";
                interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
index f723205..f9e6343 100644 (file)
@@ -18,10 +18,11 @@ dtb-$(CONFIG_ARCH_QCOM)     += msm8916-samsung-a5u-eur.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += msm8916-samsung-j5.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += msm8916-samsung-serranove.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += msm8916-wingtech-wt88047.dtb
-dtb-$(CONFIG_ARCH_QCOM)        += msm8992-bullhead-rev-101.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += msm8992-lg-bullhead-rev-10.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += msm8992-lg-bullhead-rev-101.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += msm8992-msft-lumia-octagon-talkman.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += msm8992-xiaomi-libra.dtb
-dtb-$(CONFIG_ARCH_QCOM)        += msm8994-angler-rev-101.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += msm8994-huawei-angler-rev-101.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += msm8994-msft-lumia-octagon-cityman.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += msm8994-sony-xperia-kitakami-ivy.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += msm8994-sony-xperia-kitakami-karin.dtb
@@ -82,7 +83,8 @@ dtb-$(CONFIG_ARCH_QCOM)       += sc7180-trogdor-pompom-r3.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-pompom-r3-lte.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-r1.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-r1-lte.dtb
-dtb-$(CONFIG_ARCH_QCOM)        += sc7280-herobrine.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sc7280-herobrine-herobrine-r0.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sc7280-herobrine-herobrine-r1.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7280-idp.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7280-idp2.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7280-crd.dtb
@@ -90,6 +92,7 @@ dtb-$(CONFIG_ARCH_QCOM)       += sdm630-sony-xperia-ganges-kirin.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sdm630-sony-xperia-nile-discovery.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sdm630-sony-xperia-nile-pioneer.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sdm630-sony-xperia-nile-voyager.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sdm632-fairphone-fp3.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sdm636-sony-xperia-ganges-mermaid.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sdm660-xiaomi-lavender.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sdm845-cheza-r1.dtb
@@ -103,7 +106,9 @@ dtb-$(CONFIG_ARCH_QCOM)     += sdm845-sony-xperia-tama-akari.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sdm845-sony-xperia-tama-akatsuki.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sdm845-sony-xperia-tama-apollo.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sdm845-xiaomi-beryllium.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sdm845-shift-axolotl.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sdm850-lenovo-yoga-c630.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sdm850-samsung-w737.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sm6125-sony-xperia-seine-pdx201.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sm6350-sony-xperia-lena-pdx213.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sm7225-fairphone-fp4.dtb
@@ -121,4 +126,5 @@ dtb-$(CONFIG_ARCH_QCOM)     += sm8350-microsoft-surface-duo2.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sm8350-mtp.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sm8350-sony-xperia-sagami-pdx214.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sm8350-sony-xperia-sagami-pdx215.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sm8450-hdk.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sm8450-qrd.dtb
index a5320d6..7c1eab6 100644 (file)
                port@0 {
                        reg = <0>;
                        csiphy0_ep: endpoint {
-                               clock-lanes = <1>;
                                data-lanes = <0 2>;
                                remote-endpoint = <&ov5640_ep>;
                                status = "okay";
 
                port {
                        ov5640_ep: endpoint {
-                               clock-lanes = <1>;
                                data-lanes = <0 2>;
                                remote-endpoint = <&csiphy0_ep>;
                        };
        pinctrl-0 = <&cdc_pdm_lines_act &ext_sec_tlmm_lines_act &ext_mclk_tlmm_lines_act>;
        pinctrl-1 = <&cdc_pdm_lines_sus &ext_sec_tlmm_lines_sus &ext_mclk_tlmm_lines_sus>;
        pinctrl-names = "default", "sleep";
-       qcom,model = "DB410c";
-       qcom,audio-routing =
+       model = "DB410c";
+       audio-routing =
                "AMIC2", "MIC BIAS Internal2",
                "AMIC3", "MIC BIAS External1";
 
-       external-dai-link@0 {
+       quaternary-dai-link {
                link-name = "ADV7533";
                cpu {
                        sound-dai = <&lpass MI2S_QUATERNARY>;
                };
        };
 
-       internal-codec-playback-dai-link@0 {
+       primary-dai-link {
                link-name = "WCD";
                cpu {
                        sound-dai = <&lpass MI2S_PRIMARY>;
                };
        };
 
-       internal-codec-capture-dai-link@0 {
+       tertiary-dai-link {
                link-name = "WCD-Capture";
                cpu {
                        sound-dai = <&lpass MI2S_TERTIARY>;
index 66ec561..4e7efa9 100644 (file)
 
                intc: interrupt-controller@b000000 {
                        compatible = "qcom,msm-qgic2";
+                       #address-cells = <2>;
+                       #size-cells = <2>;
                        interrupt-controller;
                        #interrupt-cells = <0x3>;
                        reg =   <0x0 0x0b000000 0x0 0x1000>,  /*GICD*/
                                <0x0 0x0b001000 0x0 0x1000>,  /*GICH*/
                                <0x0 0x0b004000 0x0 0x1000>;  /*GICV*/
                        interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;
+                       ranges = <0 0 0 0xb00a000 0 0xffd>;
+
+                       v2m@0 {
+                               compatible = "arm,gic-v2m-frame";
+                               msi-controller;
+                               reg = <0x0 0x0 0x0 0xffd>;
+                       };
                };
 
                pcie_phy: phy@84000 {
                        linux,pci-domain = <0>;
                        bus-range = <0x00 0xff>;
                        num-lanes = <1>;
+                       max-link-speed = <3>;
                        #address-cells = <3>;
                        #size-cells = <2>;
 
                        ranges;
                        compatible = "arm,armv7-timer-mem";
                        reg = <0x0 0x0b120000 0x0 0x1000>;
-                       clock-frequency = <19200000>;
 
                        frame@b120000 {
                                frame-number = <0>;
                                snps,hird-threshold = /bits/ 8 <0x0>;
                                snps,dis_u2_susphy_quirk;
                                snps,dis_u3_susphy_quirk;
-                               snps,ref-clock-period-ns = <0x32>;
+                               snps,ref-clock-period-ns = <0x29>;
                                dr_mode = "host";
                        };
                };
index e6cc261..d80b1ce 100644 (file)
                method = "smc";
        };
 
+       reserved-memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               smem@4ab00000 {
+                       compatible = "qcom,smem";
+                       reg = <0x0 0x4ab00000 0x0 0x00100000>;
+                       no-map;
+
+                       hwlocks = <&tcsr_mutex 0>;
+               };
+
+               memory@4ac00000 {
+                       no-map;
+                       reg = <0x0 0x4ac00000 0x0 0x00400000>;
+               };
+       };
+
        firmware {
                scm {
                        compatible = "qcom,scm-ipq8074", "qcom,scm";
                        #reset-cells = <0x1>;
                };
 
+               tcsr_mutex: hwlock@1905000 {
+                       compatible = "qcom,tcsr-mutex";
+                       reg = <0x01905000 0x20000>;
+                       #hwlock-cells = <1>;
+               };
+
                spmi_bus: spmi@200f000 {
                        compatible = "qcom,spmi-pmic-arb";
                        reg = <0x0200f000 0x001000>,
 
                intc: interrupt-controller@b000000 {
                        compatible = "qcom,msm-qgic2";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
                        interrupt-controller;
                        #interrupt-cells = <0x3>;
                        reg = <0x0b000000 0x1000>, <0x0b002000 0x1000>;
+                       ranges = <0 0xb00a000 0xffd>;
+
+                       v2m@0 {
+                               compatible = "arm,gic-v2m-frame";
+                               msi-controller;
+                               reg = <0x0 0xffd>;
+                       };
                };
 
                timer {
                        ranges;
                        compatible = "arm,armv7-timer-mem";
                        reg = <0x0b120000 0x1000>;
-                       clock-frequency = <19200000>;
 
                        frame@b120000 {
                                frame-number = <0>;
index 852de62..b3836dd 100644 (file)
                vddio-supply = <&pm8916_l6>;
        };
 
+       light-sensor@23 {
+               compatible = "liteon,ltr559";
+               reg = <0x23>;
+               proximity-near-level = <75>;
+
+               interrupt-parent = <&msmgpio>;
+               interrupts = <115 IRQ_TYPE_EDGE_FALLING>;
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&light_int_default>;
+
+               vdd-supply = <&pm8916_l17>;
+               vio-supply = <&pm8916_l6>;
+       };
+
        gyroscope@68 {
                compatible = "bosch,bmg160";
                reg = <0x68>;
                bias-disable;
        };
 
+       light_int_default: light-int-default {
+               pins = "gpio115";
+               function = "gpio";
+
+               drive-strength = <2>;
+               bias-disable;
+       };
+
        magn_int_default: magn-int-default {
                pins = "gpio113";
                function = "gpio";
index 687bea4..6c408d6 100644 (file)
@@ -41,7 +41,7 @@
                };
 
                home-key {
-                       lable = "Home Key";
+                       label = "Home Key";
                        gpios = <&msmgpio 109 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_HOMEPAGE>;
                };
index 41897eb..0a0be43 100644 (file)
                                        clock-names = "ref", "sleep";
                                        resets = <&gcc GCC_USB2A_PHY_BCR>, <&usb 0>;
                                        reset-names = "phy", "por";
-                                       qcom,init-seq = /bits/ 8 <0x0 0x44
-                                               0x1 0x6b 0x2 0x24 0x3 0x13>;
+                                       qcom,init-seq = /bits/ 8 <0x0 0x44>,
+                                                                <0x1 0x6b>,
+                                                                <0x2 0x24>,
+                                                                <0x3 0x13>;
                                };
                        };
                };
diff --git a/arch/arm64/boot/dts/qcom/msm8953.dtsi b/arch/arm64/boot/dts/qcom/msm8953.dtsi
new file mode 100644 (file)
index 0000000..431228f
--- /dev/null
@@ -0,0 +1,1326 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright (c) 2022, The Linux Foundation. All rights reserved. */
+
+#include <dt-bindings/clock/qcom,gcc-msm8953.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/power/qcom-rpmpd.h>
+#include <dt-bindings/thermal/thermal.h>
+
+/ {
+       interrupt-parent = <&intc>;
+
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       chosen { };
+
+       clocks {
+               sleep_clk: sleep-clk {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <32768>;
+               };
+
+               xo_board: xo-board {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <19200000>;
+                       clock-output-names = "xo";
+               };
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               CPU0: cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       reg = <0x0>;
+                       enable-method = "psci";
+                       capacity-dmips-mhz = <1024>;
+                       next-level-cache = <&L2_0>;
+                       #cooling-cells = <2>;
+
+                       l1-icache {
+                               compatible = "cache";
+                       };
+                       l1-dcache {
+                               compatible = "cache";
+                       };
+               };
+
+               CPU1: cpu@1 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       reg = <0x1>;
+                       enable-method = "psci";
+                       capacity-dmips-mhz = <1024>;
+                       next-level-cache = <&L2_0>;
+                       #cooling-cells = <2>;
+
+                       l1-icache {
+                               compatible = "cache";
+                       };
+                       l1-dcache {
+                               compatible = "cache";
+                       };
+               };
+
+               CPU2: cpu@2 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       reg = <0x2>;
+                       enable-method = "psci";
+                       capacity-dmips-mhz = <1024>;
+                       next-level-cache = <&L2_0>;
+                       #cooling-cells = <2>;
+
+                       l1-icache {
+                               compatible = "cache";
+                       };
+                       l1-dcache {
+                               compatible = "cache";
+                       };
+               };
+
+               CPU3: cpu@3 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       reg = <0x3>;
+                       enable-method = "psci";
+                       capacity-dmips-mhz = <1024>;
+                       next-level-cache = <&L2_0>;
+                       #cooling-cells = <2>;
+
+                       l1-icache {
+                               compatible = "cache";
+                       };
+                       l1-dcache {
+                               compatible = "cache";
+                       };
+               };
+
+               CPU4: cpu@100 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       reg = <0x100>;
+                       enable-method = "psci";
+                       capacity-dmips-mhz = <1024>;
+                       next-level-cache = <&L2_1>;
+                       #cooling-cells = <2>;
+
+                       l1-icache {
+                               compatible = "cache";
+                       };
+                       l1-dcache {
+                               compatible = "cache";
+                       };
+               };
+
+               CPU5: cpu@101 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       reg = <0x101>;
+                       enable-method = "psci";
+                       capacity-dmips-mhz = <1024>;
+                       next-level-cache = <&L2_1>;
+                       #cooling-cells = <2>;
+
+                       l1-icache {
+                               compatible = "cache";
+                       };
+                       l1-dcache {
+                               compatible = "cache";
+                       };
+               };
+
+               CPU6: cpu@102 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       reg = <0x102>;
+                       enable-method = "psci";
+                       capacity-dmips-mhz = <1024>;
+                       next-level-cache = <&L2_1>;
+                       #cooling-cells = <2>;
+
+                       l1-icache {
+                               compatible = "cache";
+                       };
+                       l1-dcache {
+                               compatible = "cache";
+                       };
+               };
+
+               CPU7: cpu@103 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       reg = <0x103>;
+                       enable-method = "psci";
+                       capacity-dmips-mhz = <1024>;
+                       next-level-cache = <&L2_1>;
+                       #cooling-cells = <2>;
+
+                       l1-icache {
+                               compatible = "cache";
+                       };
+                       l1-dcache {
+                               compatible = "cache";
+                       };
+               };
+
+               cpu-map {
+                       cluster0 {
+                               core0 {
+                                       cpu = <&CPU0>;
+                               };
+                               core1 {
+                                       cpu = <&CPU1>;
+                               };
+                               core2 {
+                                       cpu = <&CPU2>;
+                               };
+                               core3 {
+                                       cpu = <&CPU3>;
+                               };
+                       };
+
+                       cluster1 {
+                               core0 {
+                                       cpu = <&CPU4>;
+                               };
+                               core1 {
+                                       cpu = <&CPU5>;
+                               };
+                               core2 {
+                                       cpu = <&CPU6>;
+                               };
+                               core3 {
+                                       cpu = <&CPU7>;
+                               };
+                       };
+               };
+
+               L2_0: l2-cache_0 {
+                       compatible = "cache";
+                       cache-level = <2>;
+               };
+
+               L2_1: l2-cache_1 {
+                       compatible = "cache";
+                       cache-level = <2>;
+               };
+       };
+
+       firmware {
+               scm: scm {
+                       compatible = "qcom,scm-msm8953";
+                       clocks = <&gcc GCC_CRYPTO_CLK>,
+                                <&gcc GCC_CRYPTO_AXI_CLK>,
+                                <&gcc GCC_CRYPTO_AHB_CLK>;
+                       clock-names = "core", "bus", "iface";
+                       #reset-cells = <1>;
+               };
+       };
+
+       memory {
+               device_type = "memory";
+               /* We expect the bootloader to fill in the reg */
+               reg = <0 0 0 0>;
+       };
+
+       pmu {
+               compatible = "arm,cortex-a53-pmu";
+               interrupts = <GIC_PPI 7 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_HIGH)>;
+       };
+
+       psci {
+               compatible = "arm,psci-1.0";
+               method = "smc";
+       };
+
+       reserved-memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               zap_shader_region: memory@81800000 {
+                       compatible = "shared-dma-pool";
+                       reg = <0x0 0x81800000 0x0 0x2000>;
+                       no-map;
+               };
+
+               memory@85b00000 {
+                       reg = <0x0 0x85b00000 0x0 0x800000>;
+                       no-map;
+               };
+
+               smem_mem: memory@86300000 {
+                       compatible = "qcom,smem";
+                       reg = <0x0 0x86300000 0x0 0x100000>;
+                       qcom,rpm-msg-ram = <&rpm_msg_ram>;
+                       hwlocks = <&tcsr_mutex 3>;
+                       no-map;
+               };
+
+               memory@86400000 {
+                       reg = <0x0 0x86400000 0x0 0x400000>;
+                       no-map;
+               };
+
+               mpss_mem: memory@86c00000 {
+                       reg = <0x0 0x86c00000 0x0 0x6a00000>;
+                       no-map;
+               };
+
+               adsp_fw_mem: memory@8d600000 {
+                       reg = <0x0 0x8d600000 0x0 0x1100000>;
+                       no-map;
+               };
+
+               wcnss_fw_mem: memory@8e700000 {
+                       reg = <0x0 0x8e700000 0x0 0x700000>;
+                       no-map;
+               };
+
+               memory@90000000 {
+                       reg = <0 0x90000000 0 0x1000>;
+                       no-map;
+               };
+
+               memory@90001000 {
+                       reg = <0x0 0x90001000 0x0 0x13ff000>;
+                       no-map;
+               };
+
+               venus_mem: memory@91400000 {
+                       reg = <0x0 0x91400000 0x0 0x700000>;
+                       no-map;
+               };
+
+               mba_mem: memory@92000000 {
+                       reg = <0x0 0x92000000 0x0 0x100000>;
+                       no-map;
+               };
+
+               memory@f2d00000 {
+                       compatible = "qcom,rmtfs-mem";
+                       reg = <0x0 0xf2d00000 0x0 0x180000>;
+                       no-map;
+
+                       qcom,client-id = <1>;
+               };
+       };
+
+       smd {
+               compatible = "qcom,smd";
+
+               rpm {
+                       interrupts = <GIC_SPI 168 IRQ_TYPE_EDGE_RISING>;
+                       qcom,ipc = <&apcs 8 0>;
+                       qcom,smd-edge = <15>;
+
+                       rpm_requests: rpm_requests {
+                               compatible = "qcom,rpm-msm8953";
+                               qcom,smd-channels = "rpm_requests";
+
+                               rpmcc: rpmcc {
+                                       compatible = "qcom,rpmcc-msm8953";
+                                       clocks = <&xo_board>;
+                                       clock-names = "xo";
+                                       #clock-cells = <1>;
+                               };
+
+                               rpmpd: power-controller {
+                                       compatible = "qcom,msm8953-rpmpd";
+                                       #power-domain-cells = <1>;
+                                       operating-points-v2 = <&rpmpd_opp_table>;
+
+                                       clocks = <&xo_board>;
+                                       clock-names = "ref";
+
+                                       rpmpd_opp_table: opp-table {
+                                               compatible = "operating-points-v2";
+
+                                               rpmpd_opp_ret: opp1 {
+                                                       opp-level = <RPM_SMD_LEVEL_RETENTION>;
+                                               };
+
+                                               rpmpd_opp_ret_plus: opp2 {
+                                                       opp-level = <RPM_SMD_LEVEL_RETENTION_PLUS>;
+                                               };
+
+                                               rpmpd_opp_min_svs: opp3 {
+                                                       opp-level = <RPM_SMD_LEVEL_MIN_SVS>;
+                                               };
+
+                                               rpmpd_opp_low_svs: opp4 {
+                                                       opp-level = <RPM_SMD_LEVEL_LOW_SVS>;
+                                               };
+
+                                               rpmpd_opp_svs: opp5 {
+                                                       opp-level = <RPM_SMD_LEVEL_SVS>;
+                                               };
+
+                                               rpmpd_opp_svs_plus: opp6 {
+                                                       opp-level = <RPM_SMD_LEVEL_SVS_PLUS>;
+                                               };
+
+                                               rpmpd_opp_nom: opp7 {
+                                                       opp-level = <RPM_SMD_LEVEL_NOM>;
+                                               };
+
+                                               rpmpd_opp_nom_plus: opp8 {
+                                                       opp-level = <RPM_SMD_LEVEL_NOM_PLUS>;
+                                               };
+
+                                               rpmpd_opp_turbo: opp9 {
+                                                       opp-level = <RPM_SMD_LEVEL_TURBO>;
+                                               };
+                                       };
+                               };
+                       };
+               };
+       };
+
+       smsm {
+               compatible = "qcom,smsm";
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               qcom,ipc-1 = <&apcs 8 13>;
+               qcom,ipc-3 = <&apcs 8 19>;
+
+               apps_smsm: apps@0 {
+                       reg = <0>;
+
+                       #qcom,smem-state-cells = <1>;
+               };
+       };
+
+       soc: soc@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0 0 0 0xffffffff>;
+               compatible = "simple-bus";
+
+               rpm_msg_ram: sram@60000 {
+                       compatible = "qcom,rpm-msg-ram";
+                       reg = <0x60000 0x8000>;
+               };
+
+               hsusb_phy: phy@79000 {
+                       compatible = "qcom,msm8953-qusb2-phy";
+                       reg = <0x79000 0x180>;
+                       #phy-cells = <0>;
+
+                       clocks = <&gcc GCC_USB_PHY_CFG_AHB_CLK>,
+                                <&gcc GCC_QUSB_REF_CLK>;
+                       clock-names = "cfg_ahb", "ref";
+
+                       qcom,tcsr-syscon = <&tcsr_phy_clk_scheme_sel>;
+
+                       resets = <&gcc GCC_QUSB2_PHY_BCR>;
+
+                       status = "disabled";
+               };
+
+               rng@e3000 {
+                       compatible = "qcom,prng";
+                       reg = <0x000e3000 0x1000>;
+                       clocks = <&gcc GCC_PRNG_AHB_CLK>;
+                       clock-names = "core";
+               };
+
+               tsens0: thermal-sensor@4a9000 {
+                       compatible = "qcom,msm8953-tsens", "qcom,tsens-v2";
+                       reg = <0x4a9000 0x1000>, /* TM */
+                             <0x4a8000 0x1000>; /* SROT */
+                       #qcom,sensors = <16>;
+                       interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 314 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "uplow", "critical";
+                       #thermal-sensor-cells = <1>;
+               };
+
+               restart@4ab000 {
+                       compatible = "qcom,pshold";
+                       reg = <0x4ab000 0x4>;
+               };
+
+               tlmm: pinctrl@1000000 {
+                       compatible = "qcom,msm8953-pinctrl";
+                       reg = <0x1000000 0x300000>;
+                       interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>;
+                       gpio-controller;
+                       gpio-ranges = <&tlmm 0 0 155>;
+                       #gpio-cells = <2>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+
+                       uart_console_active: uart-console-active-pins {
+                               pins = "gpio4", "gpio5";
+                               function = "blsp_uart2";
+                               drive-strength = <2>;
+                               bias-disable;
+                       };
+
+                       uart_console_sleep: uart-console-sleep-pins {
+                               pins = "gpio4", "gpio5";
+                               function = "blsp_uart2";
+                               drive-strength = <2>;
+                               bias-pull-down;
+                       };
+
+                       sdc1_clk_on: sdc1-clk-on-pins {
+                               pins = "sdc1_clk";
+                               bias-disable;
+                               drive-strength = <16>;
+                       };
+
+                       sdc1_clk_off: sdc1-clk-off-pins {
+                               pins = "sdc1_clk";
+                               bias-disable;
+                               drive-strength = <2>;
+                       };
+
+                       sdc1_cmd_on: sdc1-cmd-on-pins {
+                               pins = "sdc1_cmd";
+                               bias-disable;
+                               drive-strength = <10>;
+                       };
+
+                       sdc1_cmd_off: sdc1-cmd-off-pins {
+                               pins = "sdc1_cmd";
+                               bias-disable;
+                               drive-strength = <2>;
+                       };
+
+                       sdc1_data_on: sdc1-data-on-pins {
+                               pins = "sdc1_data";
+                               bias-pull-up;
+                               drive-strength = <10>;
+                       };
+
+                       sdc1_data_off: sdc1-data-off-pins {
+                               pins = "sdc1_data";
+                               bias-pull-up;
+                               drive-strength = <2>;
+                       };
+
+                       sdc1_rclk_on: sdc1-rclk-on-pins {
+                               pins = "sdc1_rclk";
+                               bias-pull-down;
+                       };
+
+                       sdc1_rclk_off: sdc1-rclk-off-pins {
+                               pins = "sdc1_rclk";
+                               bias-pull-down;
+                       };
+
+                       sdc2_clk_on: sdc2-clk-on-pins {
+                               pins = "sdc2_clk";
+                               drive-strength = <16>;
+                               bias-disable;
+                       };
+
+                       sdc2_clk_off: sdc2-clk-off-pins {
+                               pins = "sdc2_clk";
+                               bias-disable;
+                               drive-strength = <2>;
+                       };
+
+                       sdc2_cmd_on: sdc2-cmd-on-pins {
+                               pins = "sdc2_cmd";
+                               bias-pull-up;
+                               drive-strength = <10>;
+                       };
+
+                       sdc2_cmd_off: sdc2-cmd-off-pins {
+                               pins = "sdc2_cmd";
+                               bias-pull-up;
+                               drive-strength = <2>;
+                       };
+
+                       sdc2_data_on: sdc2-data-on-pins {
+                               pins = "sdc2_data";
+                               bias-pull-up;
+                               drive-strength = <10>;
+                       };
+
+                       sdc2_data_off: sdc2-data-off-pins {
+                               pins = "sdc2_data";
+                               bias-pull-up;
+                               drive-strength = <2>;
+                       };
+
+                       sdc2_cd_on: cd-on-pins {
+                               pins = "gpio133";
+                               function = "gpio";
+                               drive-strength = <2>;
+                               bias-pull-up;
+                       };
+
+                       sdc2_cd_off: cd-off-pins {
+                               pins = "gpio133";
+                               function = "gpio";
+                               drive-strength = <2>;
+                               bias-disable;
+                       };
+
+                       gpio_key_default: gpio-key-default-pins {
+                               pins = "gpio85";
+                               function = "gpio";
+                               drive-strength = <2>;
+                               bias-pull-up;
+                       };
+
+                       i2c_1_default: i2c-1-default-pins {
+                               pins = "gpio2", "gpio3";
+                               function = "blsp_i2c1";
+                               drive-strength = <2>;
+                               bias-disable;
+                       };
+
+                       i2c_1_sleep: i2c-1-sleep-pins {
+                               pins = "gpio2", "gpio3";
+                               function = "gpio";
+                               drive-strength = <2>;
+                               bias-disable;
+                       };
+
+                       i2c_2_default: i2c-2-default-pins {
+                               pins = "gpio6", "gpio7";
+                               function = "blsp_i2c2";
+                               drive-strength = <2>;
+                               bias-disable;
+                       };
+
+                       i2c_2_sleep: i2c-2-sleep-pins {
+                               pins = "gpio6", "gpio7";
+                               function = "gpio";
+                               drive-strength = <2>;
+                               bias-disable;
+                       };
+
+                       i2c_3_default: i2c-3-default-pins {
+                               pins = "gpio10", "gpio11";
+                               function = "blsp_i2c3";
+                               drive-strength = <2>;
+                               bias-disable;
+                       };
+
+                       i2c_3_sleep: i2c-3-sleep-pins {
+                               pins = "gpio10", "gpio11";
+                               function = "gpio";
+                               drive-strength = <2>;
+                               bias-disable;
+                       };
+
+                       i2c_4_default: i2c-4-default-pins {
+                               pins = "gpio14", "gpio15";
+                               function = "blsp_i2c4";
+                               drive-strength = <2>;
+                               bias-disable;
+                       };
+
+                       i2c_4_sleep: i2c-4-sleep-pins {
+                               pins = "gpio14", "gpio15";
+                               function = "gpio";
+                               drive-strength = <2>;
+                               bias-disable;
+                       };
+
+                       i2c_5_default: i2c-5-default-pins {
+                               pins = "gpio18", "gpio19";
+                               function = "blsp_i2c5";
+                               drive-strength = <2>;
+                               bias-disable;
+                       };
+
+                       i2c_5_sleep: i2c-5-sleep-pins {
+                               pins = "gpio18", "gpio19";
+                               function = "gpio";
+                               drive-strength = <2>;
+                               bias-disable;
+                       };
+
+                       i2c_6_default: i2c-6-default-pins {
+                               pins = "gpio22", "gpio23";
+                               function = "blsp_i2c6";
+                               drive-strength = <2>;
+                               bias-disable;
+                       };
+
+                       i2c_6_sleep: i2c-6-sleep-pins {
+                               pins = "gpio22", "gpio23";
+                               function = "gpio";
+                               drive-strength = <2>;
+                               bias-disable;
+                       };
+
+                       i2c_7_default: i2c-7-default-pins {
+                               pins = "gpio135", "gpio136";
+                               function = "blsp_i2c7";
+                               drive-strength = <2>;
+                               bias-disable;
+                       };
+
+                       i2c_7_sleep: i2c-7-sleep-pins {
+                               pins = "gpio135", "gpio136";
+                               function = "gpio";
+                               drive-strength = <2>;
+                               bias-disable;
+                       };
+
+                       i2c_8_default: i2c-8-default-pins {
+                               pins = "gpio98", "gpio99";
+                               function = "blsp_i2c8";
+                               drive-strength = <2>;
+                               bias-disable;
+                       };
+
+                       i2c_8_sleep: i2c-8-sleep-pins {
+                               pins = "gpio98", "gpio99";
+                               function = "gpio";
+                               drive-strength = <2>;
+                               bias-disable;
+                       };
+               };
+
+               gcc: clock-controller@1800000 {
+                       compatible = "qcom,gcc-msm8953";
+                       reg = <0x1800000 0x80000>;
+                       #clock-cells = <1>;
+                       #reset-cells = <1>;
+                       #power-domain-cells = <1>;
+                       clocks = <&xo_board>,
+                                <&sleep_clk>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <0>;
+                       clock-names = "xo",
+                                     "sleep",
+                                     "dsi0pll",
+                                     "dsi0pllbyte",
+                                     "dsi1pll",
+                                     "dsi1pllbyte";
+               };
+
+               tcsr_mutex: hwlock@1905000 {
+                       compatible = "qcom,tcsr-mutex";
+                       reg = <0x1905000 0x20000>;
+                       #hwlock-cells = <1>;
+               };
+
+               tcsr: syscon@1937000 {
+                       compatible = "qcom,tcsr-msm8953", "syscon";
+                       reg = <0x1937000 0x30000>;
+               };
+
+               tcsr_phy_clk_scheme_sel: syscon@193f044 {
+                       compatible = "syscon";
+                       reg = <0x193f044 0x4>;
+               };
+
+               spmi_bus: spmi@200f000 {
+                       compatible = "qcom,spmi-pmic-arb";
+                       reg = <0x200f000 0x1000>,
+                             <0x2400000 0x800000>,
+                             <0x2c00000 0x800000>,
+                             <0x3800000 0x200000>,
+                             <0x200a000 0x2100>;
+                       reg-names = "core", "chnls", "obsrvr", "intr", "cnfg";
+                       interrupt-names = "periph_irq";
+                       interrupts = <GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>;
+                       qcom,ee = <0>;
+                       qcom,channel = <0>;
+                       interrupt-controller;
+
+                       #interrupt-cells = <4>;
+                       #address-cells = <2>;
+                       #size-cells = <0>;
+               };
+
+               usb3: usb@70f8800 {
+                       compatible = "qcom,msm8953-dwc3", "qcom,dwc3";
+                       reg = <0x70f8800 0x400>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+
+                       interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "hs_phy_irq", "ss_phy_irq";
+
+                       clocks = <&gcc GCC_USB_PHY_CFG_AHB_CLK>,
+                                <&gcc GCC_USB30_MASTER_CLK>,
+                                <&gcc GCC_PCNOC_USB3_AXI_CLK>,
+                                <&gcc GCC_USB30_MOCK_UTMI_CLK>,
+                                <&gcc GCC_USB30_SLEEP_CLK>;
+                       clock-names = "cfg_noc", "core", "iface",
+                                     "mock_utmi", "sleep";
+
+                       assigned-clocks = <&gcc GCC_USB30_MOCK_UTMI_CLK>,
+                                         <&gcc GCC_USB30_MASTER_CLK>;
+                       assigned-clock-rates = <19200000>, <133330000>;
+
+                       power-domains = <&gcc USB30_GDSC>;
+
+                       qcom,select-utmi-as-pipe-clk;
+
+                       status = "disabled";
+
+                       usb3_dwc3: usb@7000000 {
+                               compatible = "snps,dwc3";
+                               reg = <0x07000000 0xcc00>;
+                               interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>;
+                               phys = <&hsusb_phy>;
+                               phy-names = "usb2-phy";
+
+                               snps,usb2-gadget-lpm-disable;
+                               snps,dis-u1-entry-quirk;
+                               snps,dis-u2-entry-quirk;
+                               snps,is-utmi-l1-suspend;
+                               snps,hird-threshold = /bits/ 8 <0x00>;
+
+                               maximum-speed = "high-speed";
+                               phy_mode = "utmi";
+                       };
+               };
+
+               sdhc_1: sdhci@7824900 {
+                       compatible = "qcom,msm8953-sdhci", "qcom,sdhci-msm-v4";
+
+                       reg = <0x7824900 0x500>, <0x7824000 0x800>;
+                       reg-names = "hc_mem", "core_mem";
+
+                       interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "hc_irq", "pwr_irq";
+
+                       clocks = <&gcc GCC_SDCC1_AHB_CLK>,
+                                <&gcc GCC_SDCC1_APPS_CLK>,
+                                <&xo_board>;
+                       clock-names = "iface", "core", "xo";
+
+                       power-domains = <&rpmpd MSM8953_VDDCX>;
+                       operating-points-v2 = <&sdhc1_opp_table>;
+
+                       pinctrl-names = "default", "sleep";
+                       pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on &sdc1_rclk_on>;
+                       pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off &sdc1_rclk_off>;
+
+                       mmc-hs400-1_8v;
+                       mmc-hs200-1_8v;
+                       mmc-ddr-1_8v;
+                       bus-width = <8>;
+                       non-removable;
+
+                       status = "disabled";
+
+                       sdhc1_opp_table: opp-table-sdhc1 {
+                               compatible = "operating-points-v2";
+
+                               opp-25000000 {
+                                       opp-hz = /bits/ 64 <25000000>;
+                                       required-opps = <&rpmpd_opp_low_svs>;
+                               };
+
+                               opp-50000000 {
+                                       opp-hz = /bits/ 64 <50000000>;
+                                       required-opps = <&rpmpd_opp_svs>;
+                               };
+
+                               opp-100000000 {
+                                       opp-hz = /bits/ 64 <100000000>;
+                                       required-opps = <&rpmpd_opp_svs>;
+                               };
+
+                               opp-192000000 {
+                                       opp-hz = /bits/ 64 <192000000>;
+                                       required-opps = <&rpmpd_opp_nom>;
+                               };
+
+                               opp-384000000 {
+                                       opp-hz = /bits/ 64 <384000000>;
+                                       required-opps = <&rpmpd_opp_nom>;
+                               };
+                       };
+               };
+
+               sdhc_2: sdhci@7864900 {
+                       compatible = "qcom,msm8953-sdhci", "qcom,sdhci-msm-v4";
+
+                       reg = <0x7864900 0x500>, <0x7864000 0x800>;
+                       reg-names = "hc_mem", "core_mem";
+
+                       interrupts = <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 221 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "hc_irq", "pwr_irq";
+
+                       clocks = <&gcc GCC_SDCC2_AHB_CLK>,
+                                <&gcc GCC_SDCC2_APPS_CLK>,
+                                <&xo_board>;
+                       clock-names = "iface", "core", "xo";
+
+                       power-domains = <&rpmpd MSM8953_VDDCX>;
+                       operating-points-v2 = <&sdhc2_opp_table>;
+
+                       pinctrl-names = "default", "sleep";
+                       pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on>;
+                       pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off>;
+
+                       bus-width = <4>;
+
+                       status = "disabled";
+
+                       sdhc2_opp_table: opp-table-sdhc2 {
+                               compatible = "operating-points-v2";
+
+                               opp-25000000 {
+                                       opp-hz = /bits/ 64 <25000000>;
+                                       required-opps = <&rpmpd_opp_low_svs>;
+                               };
+
+                               opp-50000000 {
+                                       opp-hz = /bits/ 64 <50000000>;
+                                       required-opps = <&rpmpd_opp_svs>;
+                               };
+
+                               opp-100000000 {
+                                       opp-hz = /bits/ 64 <100000000>;
+                                       required-opps = <&rpmpd_opp_svs>;
+                               };
+
+                               opp-177770000 {
+                                       opp-hz = /bits/ 64 <177770000>;
+                                       required-opps = <&rpmpd_opp_nom>;
+                               };
+
+                               opp-200000000 {
+                                       opp-hz = /bits/ 64 <200000000>;
+                                       required-opps = <&rpmpd_opp_nom>;
+                               };
+                       };
+               };
+
+               uart_0: serial@78af000 {
+                       compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
+                       reg = <0x78af000 0x200>;
+                       interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&gcc GCC_BLSP1_UART1_APPS_CLK>,
+                                <&gcc GCC_BLSP1_AHB_CLK>;
+                       clock-names = "core", "iface";
+
+                       status = "disabled";
+               };
+
+               i2c_1: i2c@78b5000 {
+                       compatible = "qcom,i2c-qup-v2.2.1";
+                       reg = <0x78b5000 0x600>;
+                       interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
+                       clock-names = "iface", "core";
+                       clocks = <&gcc GCC_BLSP1_AHB_CLK>,
+                                <&gcc GCC_BLSP1_QUP1_I2C_APPS_CLK>;
+
+                       pinctrl-names = "default", "sleep";
+                       pinctrl-0 = <&i2c_1_default>;
+                       pinctrl-1 = <&i2c_1_sleep>;
+
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       status = "disabled";
+               };
+
+               i2c_2: i2c@78b6000 {
+                       compatible = "qcom,i2c-qup-v2.2.1";
+                       reg = <0x78b6000 0x600>;
+                       interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
+                       clock-names = "iface", "core";
+                       clocks = <&gcc GCC_BLSP1_AHB_CLK>,
+                                <&gcc GCC_BLSP1_QUP2_I2C_APPS_CLK>;
+
+                       pinctrl-names = "default", "sleep";
+                       pinctrl-0 = <&i2c_2_default>;
+                       pinctrl-1 = <&i2c_2_sleep>;
+
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       status = "disabled";
+               };
+
+               i2c_3: i2c@78b7000 {
+                       compatible = "qcom,i2c-qup-v2.2.1";
+                       reg = <0x78b7000 0x600>;
+                       interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>;
+                       clock-names = "iface", "core";
+                       clocks = <&gcc GCC_BLSP1_AHB_CLK>,
+                                <&gcc GCC_BLSP1_QUP3_I2C_APPS_CLK>;
+                       pinctrl-names = "default", "sleep";
+                       pinctrl-0 = <&i2c_3_default>;
+                       pinctrl-1 = <&i2c_3_sleep>;
+
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       status = "disabled";
+               };
+
+               i2c_4: i2c@78b8000 {
+                       compatible = "qcom,i2c-qup-v2.2.1";
+                       reg = <0x78b8000 0x600>;
+                       interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>;
+                       clock-names = "iface", "core";
+                       clocks = <&gcc GCC_BLSP1_AHB_CLK>,
+                                <&gcc GCC_BLSP1_QUP4_I2C_APPS_CLK>;
+                       pinctrl-names = "default", "sleep";
+                       pinctrl-0 = <&i2c_4_default>;
+                       pinctrl-1 = <&i2c_4_sleep>;
+
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       status = "disabled";
+               };
+
+               i2c_5: i2c@7af5000 {
+                       compatible = "qcom,i2c-qup-v2.2.1";
+                       reg = <0x7af5000 0x600>;
+                       interrupts = <GIC_SPI 299 IRQ_TYPE_LEVEL_HIGH>;
+                       clock-names = "iface", "core";
+                       clocks = <&gcc GCC_BLSP2_AHB_CLK>,
+                                <&gcc GCC_BLSP2_QUP1_I2C_APPS_CLK>;
+                       pinctrl-names = "default", "sleep";
+                       pinctrl-0 = <&i2c_5_default>;
+                       pinctrl-1 = <&i2c_5_sleep>;
+
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       status = "disabled";
+               };
+
+               i2c_6: i2c@7af6000 {
+                       compatible = "qcom,i2c-qup-v2.2.1";
+                       reg = <0x7af6000 0x600>;
+                       interrupts = <GIC_SPI 300 IRQ_TYPE_LEVEL_HIGH>;
+                       clock-names = "iface", "core";
+                       clocks = <&gcc GCC_BLSP2_AHB_CLK>,
+                                <&gcc GCC_BLSP2_QUP2_I2C_APPS_CLK>;
+                       pinctrl-names = "default", "sleep";
+                       pinctrl-0 = <&i2c_6_default>;
+                       pinctrl-1 = <&i2c_6_sleep>;
+
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       status = "disabled";
+               };
+
+               i2c_7: i2c@7af7000 {
+                       compatible = "qcom,i2c-qup-v2.2.1";
+                       reg = <0x7af7000 0x600>;
+                       interrupts = <GIC_SPI 301 IRQ_TYPE_LEVEL_HIGH>;
+                       clock-names = "iface", "core";
+                       clocks = <&gcc GCC_BLSP2_AHB_CLK>,
+                                <&gcc GCC_BLSP2_QUP3_I2C_APPS_CLK>;
+                       pinctrl-names = "default", "sleep";
+                       pinctrl-0 = <&i2c_7_default>;
+                       pinctrl-1 = <&i2c_7_sleep>;
+
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       status = "disabled";
+               };
+
+               i2c_8: i2c@7af8000 {
+                       compatible = "qcom,i2c-qup-v2.2.1";
+                       reg = <0x7af8000 0x600>;
+                       interrupts = <GIC_SPI 302 IRQ_TYPE_LEVEL_HIGH>;
+                       clock-names = "iface", "core";
+                       clocks = <&gcc GCC_BLSP2_AHB_CLK>,
+                                <&gcc GCC_BLSP2_QUP4_I2C_APPS_CLK>;
+                       pinctrl-names = "default", "sleep";
+                       pinctrl-0 = <&i2c_8_default>;
+                       pinctrl-1 = <&i2c_8_sleep>;
+
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       status = "disabled";
+               };
+
+               intc: interrupt-controller@b000000 {
+                       compatible = "qcom,msm-qgic2";
+                       interrupt-controller;
+                       #interrupt-cells = <3>;
+                       reg = <0x0b000000 0x1000>, <0x0b002000 0x1000>;
+               };
+
+               apcs: mailbox@b011000 {
+                       compatible = "qcom,msm8953-apcs-kpss-global", "syscon";
+                       reg = <0xb011000 0x1000>;
+                       #mbox-cells = <1>;
+               };
+
+               timer@b120000 {
+                       compatible = "arm,armv7-timer-mem";
+                       reg = <0xb120000 0x1000>;
+                       #address-cells = <0x01>;
+                       #size-cells = <0x01>;
+                       ranges;
+
+                       frame@b121000 {
+                               frame-number = <0>;
+                               interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
+                                            <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
+                               reg = <0xb121000 0x1000>,
+                                     <0xb122000 0x1000>;
+                       };
+
+                       frame@b123000 {
+                               frame-number = <1>;
+                               interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
+                               reg = <0xb123000 0x1000>;
+                               status = "disabled";
+                       };
+
+                       frame@b124000 {
+                               frame-number = <2>;
+                               interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
+                               reg = <0xb124000 0x1000>;
+                               status = "disabled";
+                       };
+
+                       frame@b125000 {
+                               frame-number = <3>;
+                               interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
+                               reg = <0xb125000 0x1000>;
+                               status = "disabled";
+                       };
+
+                       frame@b126000 {
+                               frame-number = <4>;
+                               interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
+                               reg = <0xb126000 0x1000>;
+                               status = "disabled";
+                       };
+
+                       frame@b127000 {
+                               frame-number = <5>;
+                               interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
+                               reg = <0xb127000 0x1000>;
+                               status = "disabled";
+                       };
+
+                       frame@b128000 {
+                               frame-number = <6>;
+                               interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
+                               reg = <0xb128000 0x1000>;
+                               status = "disabled";
+                       };
+               };
+       };
+
+       thermal-zones {
+               cpu0-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+                       thermal-sensors = <&tsens0 9>;
+                       trips {
+                               cpu0_alert: trip-point0 {
+                                       temperature = <80000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+                               cpu0_crit: crit {
+                                       temperature = <100000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
+                       cooling-maps {
+                               map0 {
+                                       trip = <&cpu0_alert>;
+                                       cooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
+               };
+               cpu1-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+                       thermal-sensors = <&tsens0 10>;
+                       trips {
+                               cpu1_alert: trip-point0 {
+                                       temperature = <80000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+                               cpu1_crit: crit {
+                                       temperature = <100000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
+                       cooling-maps {
+                               map0 {
+                                       trip = <&cpu1_alert>;
+                                       cooling-device = <&CPU1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
+               };
+               cpu2-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+                       thermal-sensors = <&tsens0 11>;
+                       trips {
+                               cpu2_alert: trip-point0 {
+                                       temperature = <80000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+                               cpu2_crit: crit {
+                                       temperature = <100000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
+                       cooling-maps {
+                               map0 {
+                                       trip = <&cpu2_alert>;
+                                       cooling-device = <&CPU2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
+               };
+               cpu3-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+                       thermal-sensors = <&tsens0 12>;
+                       trips {
+                               cpu3_alert: trip-point0 {
+                                       temperature = <80000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+                               cpu3_crit: crit {
+                                       temperature = <100000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
+                       cooling-maps {
+                               map0 {
+                                       trip = <&cpu3_alert>;
+                                       cooling-device = <&CPU3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
+               };
+               cpu4-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+                       thermal-sensors = <&tsens0 4>;
+                       trips {
+                               cpu4_alert: trip-point0 {
+                                       temperature = <80000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+                               cpu4_crit: crit {
+                                       temperature = <100000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
+                       cooling-maps {
+                               map0 {
+                                       trip = <&cpu4_alert>;
+                                       cooling-device = <&CPU4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
+               };
+               cpu5-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+                       thermal-sensors = <&tsens0 5>;
+                       trips {
+                               cpu5_alert: trip-point0 {
+                                       temperature = <80000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+                               cpu5_crit: crit {
+                                       temperature = <100000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
+                       cooling-maps {
+                               map0 {
+                                       trip = <&cpu5_alert>;
+                                       cooling-device = <&CPU5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
+               };
+               cpu6-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+                       thermal-sensors = <&tsens0 6>;
+                       trips {
+                               cpu6_alert: trip-point0 {
+                                       temperature = <80000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+                               cpu6_crit: crit {
+                                       temperature = <100000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
+                       cooling-maps {
+                               map0 {
+                                       trip = <&cpu6_alert>;
+                                       cooling-device = <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
+               };
+               cpu7-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+                       thermal-sensors = <&tsens0 7>;
+                       trips {
+                               cpu7_alert: trip-point0 {
+                                       temperature = <80000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+                               cpu7_crit: crit {
+                                       temperature = <100000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
+                       cooling-maps {
+                               map0 {
+                                       trip = <&cpu7_alert>;
+                                       cooling-device = <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
+               };
+       };
+
+       timer {
+               compatible = "arm,armv8-timer";
+               interrupts = <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 3 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 4 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 1 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>;
+       };
+};
diff --git a/arch/arm64/boot/dts/qcom/msm8992-lg-bullhead-rev-10.dts b/arch/arm64/boot/dts/qcom/msm8992-lg-bullhead-rev-10.dts
new file mode 100644 (file)
index 0000000..7e6bce4
--- /dev/null
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/* Copyright (c) Jean Thomas <virgule@jeanthomas.me>
+ */
+
+/dts-v1/;
+
+#include "msm8992-lg-bullhead.dtsi"
+
+/ {
+       model = "LG Nexus 5X rev 1.0";
+
+       /* required for bootloader to select correct board */
+       qcom,board-id = <0xa64 0>;
+};
diff --git a/arch/arm64/boot/dts/qcom/msm8992-lg-bullhead-rev-101.dts b/arch/arm64/boot/dts/qcom/msm8992-lg-bullhead-rev-101.dts
new file mode 100644 (file)
index 0000000..e6a5ebd
--- /dev/null
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/* Copyright (c) Jean Thomas <virgule@jeanthomas.me>
+ */
+
+/dts-v1/;
+
+#include "msm8992-lg-bullhead.dtsi"
+
+/ {
+       model = "LG Nexus 5X rev 1.01";
+
+       /* required for bootloader to select correct board */
+       qcom,board-id = <0xb64 0>;
+};
@@ -18,9 +18,7 @@
        compatible = "lg,bullhead", "qcom,msm8992";
        chassis-type = "handset";
 
-       /* required for bootloader to select correct board */
        qcom,msm-id = <251 0>, <252 0>;
-       qcom,board-id = <0xb64 0>;
        qcom,pmic-id = <0x10009 0x1000A 0x0 0x0>;
 
        /* Bullhead firmware doesn't support PSCI */
index 5a9a5ed..8c1dc51 100644 (file)
                };
 
                sdhc1: sdhci@f9824900 {
-                       compatible = "qcom,sdhci-msm-v4";
+                       compatible = "qcom,msm8994-sdhci", "qcom,sdhci-msm-v4";
                        reg = <0xf9824900 0x1a0>, <0xf9824000 0x800>;
                        reg-names = "hc_mem", "core_mem";
 
                };
 
                sdhc2: sdhci@f98a4900 {
-                       compatible = "qcom,sdhci-msm-v4";
+                       compatible = "qcom,msm8994-sdhci", "qcom,sdhci-msm-v4";
                        reg = <0xf98a4900 0x11c>, <0xf98a4000 0x800>;
                        reg-names = "hc_mem", "core_mem";
 
                        #reset-cells = <1>;
                        #power-domain-cells = <1>;
                        reg = <0xfc400000 0x2000>;
+
+                       clock-names = "xo", "sleep_clk";
+                       clocks = <&xo_board>, <&sleep_clk>;
                };
 
                rpm_msg_ram: sram@fc428000 {
index 7d9fc35..6a1699a 100644 (file)
@@ -9,7 +9,7 @@
 
 / {
        model = "Qualcomm Technologies, Inc. MSM 8996 MTP";
-       compatible = "qcom,msm8996-mtp";
+       compatible = "qcom,msm8996-mtp", "qcom,msm8996";
 
        aliases {
                serial0 = &blsp2_uart2;
index 91bc974..f0f81c2 100644 (file)
                };
        };
 
-       cluster0_opp: opp_table0 {
+       cluster0_opp: opp-table-cluster0 {
                compatible = "operating-points-v2-kryo-cpu";
                nvmem-cells = <&speedbin_efuse>;
                opp-shared;
                };
        };
 
-       cluster1_opp: opp_table1 {
+       cluster1_opp: opp-table-cluster1 {
                compatible = "operating-points-v2-kryo-cpu";
                nvmem-cells = <&speedbin_efuse>;
                opp-shared;
                        #power-domain-cells = <1>;
                        reg = <0x00300000 0x90000>;
 
-                       clocks = <&rpmcc RPM_SMD_LN_BB_CLK>;
-                       clock-names = "cxo2";
+                       clocks = <&rpmcc RPM_SMD_BB_CLK1>,
+                                <&rpmcc RPM_SMD_LN_BB_CLK>,
+                                <&sleep_clk>;
+                       clock-names = "cxo", "cxo2", "sleep_clk";
                };
 
                tsens0: thermal-sensor@4a9000 {
                        clock-names = "bam_clk";
                        #dma-cells = <1>;
                        qcom,ee = <0>;
-                       qcom,controlled-remotely = <1>;
+                       qcom,controlled-remotely;
                };
 
                crypto: crypto@67a000 {
                                #clock-cells = <1>;
                                #phy-cells = <0>;
 
-                               clocks = <&mmcc MDSS_AHB_CLK>, <&xo_board>;
+                               clocks = <&mmcc MDSS_AHB_CLK>, <&rpmcc RPM_SMD_BB_CLK1>;
                                clock-names = "iface", "ref";
                                status = "disabled";
                        };
                        reg = <0x00290000 0x10000>;
                };
 
-               spmi_bus: qcom,spmi@400f000 {
+               spmi_bus: spmi@400f000 {
                        compatible = "qcom,spmi-pmic-arb";
                        reg = <0x0400f000 0x1000>,
                              <0x04400000 0x800000>,
                        reg = <0x06400000 0x90000>;
 
                        clock-names = "xo";
-                       clocks = <&xo_board>;
+                       clocks = <&rpmcc RPM_SMD_BB_CLK1>;
 
                        #clock-cells = <1>;
                };
                };
 
                sdhc1: sdhci@7464900 {
-                       compatible = "qcom,sdhci-msm-v4";
+                       compatible = "qcom,msm8996-sdhci", "qcom,sdhci-msm-v4";
                        reg = <0x07464900 0x11c>, <0x07464000 0x800>;
                        reg-names = "hc_mem", "core_mem";
 
                        clock-names = "iface", "core", "xo";
                        clocks = <&gcc GCC_SDCC1_AHB_CLK>,
                                <&gcc GCC_SDCC1_APPS_CLK>,
-                               <&xo_board>;
+                               <&rpmcc RPM_SMD_BB_CLK1>;
 
                        pinctrl-names = "default", "sleep";
                        pinctrl-0 = <&sdc1_state_on>;
                };
 
                sdhc2: sdhci@74a4900 {
-                       compatible = "qcom,sdhci-msm-v4";
+                       compatible = "qcom,msm8996-sdhci", "qcom,sdhci-msm-v4";
                        reg = <0x074a4900 0x314>, <0x074a4000 0x800>;
                        reg-names = "hc_mem", "core_mem";
 
                        clock-names = "iface", "core", "xo";
                        clocks = <&gcc GCC_SDCC2_AHB_CLK>,
                                <&gcc GCC_SDCC2_APPS_CLK>,
-                               <&xo_board>;
+                               <&rpmcc RPM_SMD_BB_CLK1>;
 
                        pinctrl-names = "default", "sleep";
                        pinctrl-0 = <&sdc2_state_on>;
                        interrupt-names = "wdog", "fatal", "ready",
                                          "handover", "stop-ack";
 
-                       clocks = <&xo_board>;
+                       clocks = <&rpmcc RPM_SMD_BB_CLK1>;
                        clock-names = "xo";
 
                        memory-region = <&adsp_region>;
                                        power-domains = <&gcc HLOS1_VOTE_LPASS_ADSP_GDSC>;
                                        compatible = "qcom,apr-v2";
                                        qcom,smd-channels = "apr_audio_svc";
-                                       qcom,apr-domain = <APR_DOMAIN_ADSP>;
+                                       qcom,domain = <APR_DOMAIN_ADSP>;
                                        #address-cells = <1>;
                                        #size-cells = <0>;
 
                        };
                };
 
-               gpu-thermal-top {
+               gpu-top-thermal {
                        polling-delay-passive = <250>;
                        polling-delay = <1000>;
 
                        };
                };
 
-               gpu-thermal-bottom {
+               gpu-bottom-thermal {
                        polling-delay-passive = <250>;
                        polling-delay = <1000>;
 
index f273bc1..2fda21e 100644 (file)
                        cpu-idle-states = <&LITTLE_CPU_SLEEP_0 &LITTLE_CPU_SLEEP_1>;
                        next-level-cache = <&L2_0>;
                        L2_0: l2-cache {
-                               compatible = "arm,arch-cache";
+                               compatible = "cache";
                                cache-level = <2>;
                        };
-                       L1_I_0: l1-icache {
-                               compatible = "arm,arch-cache";
-                       };
-                       L1_D_0: l1-dcache {
-                               compatible = "arm,arch-cache";
-                       };
                };
 
                CPU1: cpu@1 {
                        capacity-dmips-mhz = <1024>;
                        cpu-idle-states = <&LITTLE_CPU_SLEEP_0 &LITTLE_CPU_SLEEP_1>;
                        next-level-cache = <&L2_0>;
-                       L1_I_1: l1-icache {
-                               compatible = "arm,arch-cache";
-                       };
-                       L1_D_1: l1-dcache {
-                               compatible = "arm,arch-cache";
-                       };
                };
 
                CPU2: cpu@2 {
                        capacity-dmips-mhz = <1024>;
                        cpu-idle-states = <&LITTLE_CPU_SLEEP_0 &LITTLE_CPU_SLEEP_1>;
                        next-level-cache = <&L2_0>;
-                       L1_I_2: l1-icache {
-                               compatible = "arm,arch-cache";
-                       };
-                       L1_D_2: l1-dcache {
-                               compatible = "arm,arch-cache";
-                       };
                };
 
                CPU3: cpu@3 {
                        capacity-dmips-mhz = <1024>;
                        cpu-idle-states = <&LITTLE_CPU_SLEEP_0 &LITTLE_CPU_SLEEP_1>;
                        next-level-cache = <&L2_0>;
-                       L1_I_3: l1-icache {
-                               compatible = "arm,arch-cache";
-                       };
-                       L1_D_3: l1-dcache {
-                               compatible = "arm,arch-cache";
-                       };
                };
 
                CPU4: cpu@100 {
                        cpu-idle-states = <&BIG_CPU_SLEEP_0 &BIG_CPU_SLEEP_1>;
                        next-level-cache = <&L2_1>;
                        L2_1: l2-cache {
-                               compatible = "arm,arch-cache";
+                               compatible = "cache";
                                cache-level = <2>;
                        };
-                       L1_I_100: l1-icache {
-                               compatible = "arm,arch-cache";
-                       };
-                       L1_D_100: l1-dcache {
-                               compatible = "arm,arch-cache";
-                       };
                };
 
                CPU5: cpu@101 {
                        capacity-dmips-mhz = <1536>;
                        cpu-idle-states = <&BIG_CPU_SLEEP_0 &BIG_CPU_SLEEP_1>;
                        next-level-cache = <&L2_1>;
-                       L1_I_101: l1-icache {
-                               compatible = "arm,arch-cache";
-                       };
-                       L1_D_101: l1-dcache {
-                               compatible = "arm,arch-cache";
-                       };
                };
 
                CPU6: cpu@102 {
                        capacity-dmips-mhz = <1536>;
                        cpu-idle-states = <&BIG_CPU_SLEEP_0 &BIG_CPU_SLEEP_1>;
                        next-level-cache = <&L2_1>;
-                       L1_I_102: l1-icache {
-                               compatible = "arm,arch-cache";
-                       };
-                       L1_D_102: l1-dcache {
-                               compatible = "arm,arch-cache";
-                       };
                };
 
                CPU7: cpu@103 {
                        capacity-dmips-mhz = <1536>;
                        cpu-idle-states = <&BIG_CPU_SLEEP_0 &BIG_CPU_SLEEP_1>;
                        next-level-cache = <&L2_1>;
-                       L1_I_103: l1-icache {
-                               compatible = "arm,arch-cache";
-                       };
-                       L1_D_103: l1-dcache {
-                               compatible = "arm,arch-cache";
-                       };
                };
 
                cpu-map {
                        };
                };
 
-               gpu-thermal-bottom {
+               gpu-bottom-thermal {
                        polling-delay-passive = <250>;
                        polling-delay = <1000>;
 
                        };
                };
 
-               gpu-thermal-top {
+               gpu-top-thermal {
                        polling-delay-passive = <250>;
                        polling-delay = <1000>;
 
index 3ca2860..7aa2ef9 100644 (file)
                reg = <0x5 SPMI_USID>;
                #address-cells = <1>;
                #size-cells = <0>;
+
+               pm6150l_wled: leds@d800 {
+                       compatible = "qcom,pm6150l-wled";
+                       reg = <0xd800>, <0xd900>;
+                       interrupts = <0x5 0xd8 0x1 IRQ_TYPE_EDGE_RISING>;
+                       interrupt-names = "ovp";
+                       label = "backlight";
+
+                       status = "disabled";
+               };
        };
 };
diff --git a/arch/arm64/boot/dts/qcom/pm8953.dtsi b/arch/arm64/boot/dts/qcom/pm8953.dtsi
new file mode 100644 (file)
index 0000000..741c538
--- /dev/null
@@ -0,0 +1,90 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright (c) 2022, The Linux Foundation. All rights reserved. */
+
+#include <dt-bindings/iio/qcom,spmi-vadc.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/input/linux-event-codes.h>
+#include <dt-bindings/spmi/spmi.h>
+
+&spmi_bus {
+       pmic@0 {
+               compatible = "qcom,pm8953", "qcom,spmi-pmic";
+               reg = <0 SPMI_USID>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               pm8953_pon: pon@800 {
+                       compatible = "qcom,pm8916-pon";
+                       reg = <0x800>;
+                       mode-bootloader = <0x2>;
+                       mode-recovery = <0x1>;
+
+                       pwrkey {
+                               compatible = "qcom,pm8941-pwrkey";
+                               interrupts = <0x00 0x08 0 IRQ_TYPE_EDGE_BOTH>;
+                               debounce = <15625>;
+                               bias-pull-up;
+                               linux,code = <KEY_POWER>;
+                       };
+
+                       pm8953_resin: resin {
+                               compatible = "qcom,pm8941-resin";
+                               interrupts = <0x00 0x08 1 IRQ_TYPE_EDGE_BOTH>;
+                               debounce = <15625>;
+                               bias-pull-up;
+                               status = "disabled";
+                       };
+               };
+
+               temp-alarm@2400 {
+                       compatible = "qcom,spmi-temp-alarm";
+                       reg = <0x2400>;
+                       interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_RISING>;
+                       io-channels = <&pm8953_vadc VADC_DIE_TEMP>;
+                       io-channel-names = "thermal";
+                       #thermal-sensor-cells = <0>;
+               };
+
+               pm8953_vadc: vadc@3100 {
+                       compatible = "qcom,spmi-vadc";
+                       reg = <0x3100>;
+                       interrupts = <0x00 0x31 0x00 0x01>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       #io-channel-cells = <1>;
+
+                       adc-chan@8 {
+                               reg = <VADC_DIE_TEMP>;
+                       };
+                       adc-chan@9 {
+                               reg = <VADC_REF_625MV>;
+                       };
+                       adc-chan@a {
+                               reg = <VADC_REF_1250MV>;
+                       };
+                       adc-chan@c {
+                               reg = <VADC_SPARE1>;
+                       };
+                       adc-chan@e {
+                               reg = <VADC_GND_REF>;
+                       };
+                       adc-chan@f {
+                               reg = <VADC_VDD_VADC>;
+                       };
+               };
+
+               rtc@6000 {
+                       compatible = "qcom,pm8941-rtc";
+                       reg = <0x6000>, <0x6100>;
+                       reg-names = "rtc", "alarm";
+                       interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
+               };
+       };
+
+       pmic@1 {
+               compatible = "qcom,pm8953", "qcom,spmi-pmic";
+               reg = <1 SPMI_USID>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+       };
+};
index 172be17..98d173a 100644 (file)
@@ -32,7 +32,7 @@
 
 &spmi_bus {
        pms405_0: pms405@0 {
-               compatible = "qcom,spmi-pmic";
+               compatible = "qcom,pms405", "qcom,spmi-pmic";
                reg = <0x0 SPMI_USID>;
                #address-cells = <1>;
                #size-cells = <0>;
        };
 
        pms405_1: pms405@1 {
-               compatible = "qcom,spmi-pmic";
+               compatible = "qcom,pms405", "qcom,spmi-pmic";
                reg = <0x1 SPMI_USID>;
 
                pms405_spmi_regulators: regulators {
index 6db753b..3f06f7c 100644 (file)
                };
        };
 
-       cpu_opp_table: cpu-opp-table {
+       cpu_opp_table: opp-table-cpu {
                compatible = "operating-points-v2-kryo-cpu";
                opp-shared;
 
                };
        };
 
-       cpr_opp_table: cpr-opp-table {
+       cpr_opp_table: opp-table-cpr {
                compatible = "operating-points-v2-qcom-level";
 
                cpr_opp1: opp1 {
index 14ed09f..c81805e 100644 (file)
@@ -142,6 +142,22 @@ ap_ts_pen_1v8: &i2c4 {
        };
 };
 
+&pp1800_uf_cam {
+       status = "okay";
+};
+
+&pp1800_wf_cam {
+       status = "okay";
+};
+
+&pp2800_uf_cam {
+       status = "okay";
+};
+
+&pp2800_wf_cam {
+       status = "okay";
+};
+
 &pp3300_dx_edp {
        gpio = <&tlmm 67 GPIO_ACTIVE_HIGH>;
 };
index f32369a..bff2b55 100644 (file)
@@ -146,6 +146,22 @@ ap_ts_pen_1v8: &i2c4 {
        };
 };
 
+&pp1800_uf_cam {
+       status = "okay";
+};
+
+&pp1800_wf_cam {
+       status = "okay";
+};
+
+&pp2800_uf_cam {
+       status = "okay";
+};
+
+&pp2800_wf_cam {
+       status = "okay";
+};
+
 &pp3300_dx_edp {
        gpio = <&tlmm 67 GPIO_ACTIVE_HIGH>;
 };
index bd5909f..732e118 100644 (file)
                vin-supply = <&ppvar_sys>;
        };
 
+       pp1800_ec:
+       pp1800_sensors:
+       pp1800_ldo: pp1800-ldo-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "pp1800_ldo";
+
+               /* EC turns on with hibernate_l; always on for AP */
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+
+               /*
+                * Actually should be pp1800_h1 but we don't have any need to
+                * model that so we use the parent of pp1800_h1.
+                */
+               vin-supply = <&pp3300_a>;
+       };
+
+       pp1800_uf_cam: pp1800-uf-cam-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "pp1800_uf_cam";
+               status = "disabled";
+
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+
+               gpio = <&tlmm 6 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               pinctrl-names = "default";
+               pinctrl-0 = <&uf_cam_en>;
+
+               vin-supply = <&pp1800_ldo>;
+               regulator-enable-ramp-delay = <1000>;
+       };
+
+       pp1800_wf_cam: pp1800-wf-cam-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "pp1800_wf_cam";
+               status = "disabled";
+
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+
+               gpio = <&tlmm 7 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               pinctrl-names = "default";
+               pinctrl-0 = <&wf_cam_en>;
+
+               vin-supply = <&pp1800_ldo>;
+               regulator-enable-ramp-delay = <1000>;
+       };
+
+       pp2800_uf_cam: pp2800-uf-cam-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "pp2800_uf_cam";
+               status = "disabled";
+
+               regulator-min-microvolt = <2850000>;
+               regulator-max-microvolt = <2850000>;
+
+               gpio = <&tlmm 6 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               /*
+                * The pinconf can only be referenced once so we put it on the
+                * first regulator and comment it out here.
+                * pinctrl-names = "default";
+                * pinctrl-0 = <&uf_cam_en>;
+                */
+
+               vin-supply = <&pp3300_a>;
+       };
+
+       pp2800_vcm_wf_cam:
+       pp2800_wf_cam: pp2800-wf-cam-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "pp2800_wf_cam";
+               status = "disabled";
+
+               regulator-min-microvolt = <2850000>;
+               regulator-max-microvolt = <2850000>;
+
+               gpio = <&tlmm 7 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               /*
+                * The pinconf can only be referenced once so we put it on the
+                * first regulator and comment it out here.
+                * pinctrl-names = "default";
+                * pinctrl-0 = <&wf_cam_en>;
+                */
+
+               vin-supply = <&pp3300_a>;
+       };
+
        pp3300_audio:
        pp3300_codec: pp3300-codec-regulator {
                compatible = "regulator-fixed";
                vin-supply = <&pp3300_a>;
        };
 
-       pp3300_hub: pp3300-hub {
+       pp3300_hub: pp3300-hub-regulator {
                compatible = "regulator-fixed";
                regulator-name = "pp3300_hub";
 
                pinctrl-0 = <&ap_ec_int_l>;
                spi-max-frequency = <3000000>;
 
-               cros_ec_pwm: ec-pwm {
+               cros_ec_pwm: pwm {
                        compatible = "google,cros-ec-pwm";
                        #pwm-cells = <1>;
                };
@@ -1521,4 +1615,32 @@ ap_spi_fp: &spi10 {
                        drive-strength = <2>;
                };
        };
+
+       uf_cam_en: uf-cam-en {
+               pinmux {
+                       pins = "gpio6";
+                       function = "gpio";
+               };
+
+               pinconf {
+                       pins = "gpio6";
+                       drive-strength = <2>;
+                       /* External pull down */
+                       bias-disable;
+               };
+       };
+
+       wf_cam_en: wf-cam-en {
+               pinmux {
+                       pins = "gpio7";
+                       function = "gpio";
+               };
+
+               pinconf {
+                       pins = "gpio7";
+                       drive-strength = <2>;
+                       /* External pull down */
+                       bias-disable;
+               };
+       };
 };
index 2151cd8..e1c46b8 100644 (file)
                                             "imem",
                                             "config";
 
+                       qcom,qmp = <&aoss_qmp>;
+
                        qcom,smem-states = <&ipa_smp2p_out 0>,
                                           <&ipa_smp2p_out 1>;
                        qcom,smem-state-names = "ipa-clock-enabled-valid",
diff --git a/arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi b/arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi
new file mode 100644 (file)
index 0000000..9f4a9c2
--- /dev/null
@@ -0,0 +1,97 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * sc7280 fragment for devices with Chrome bootloader
+ *
+ * This file mainly tries to abstract out the memory protections put into
+ * place by the Chrome bootloader which are different than what's put into
+ * place by Qualcomm's typical bootloader. It also has a smattering of other
+ * things that will hold true for any conceivable Chrome design
+ *
+ * Copyright 2022 Google LLC.
+ */
+
+/*
+ * Reserved memory changes
+ *
+ * Delete all unused memory nodes and define the peripheral memory regions
+ * required by the setup for Chrome boards.
+ */
+
+/delete-node/ &hyp_mem;
+/delete-node/ &xbl_mem;
+/delete-node/ &reserved_xbl_uefi_log;
+/delete-node/ &sec_apps_mem;
+
+/ {
+       reserved-memory {
+               adsp_mem: memory@86700000 {
+                       reg = <0x0 0x86700000 0x0 0x2800000>;
+                       no-map;
+               };
+
+               camera_mem: memory@8ad00000 {
+                       reg = <0x0 0x8ad00000 0x0 0x500000>;
+                       no-map;
+               };
+
+               venus_mem: memory@8b200000 {
+                       reg = <0x0 0x8b200000 0x0 0x500000>;
+                       no-map;
+               };
+
+               mpss_mem: memory@8b800000 {
+                       reg = <0x0 0x8b800000 0x0 0xf600000>;
+                       no-map;
+               };
+
+               wpss_mem: memory@9ae00000 {
+                       reg = <0x0 0x9ae00000 0x0 0x1900000>;
+                       no-map;
+               };
+
+               mba_mem: memory@9c700000 {
+                       reg = <0x0 0x9c700000 0x0 0x200000>;
+                       no-map;
+               };
+       };
+};
+
+/* The PMIC PON code isn't compatible w/ how Chrome EC/BIOS handle things. */
+&pmk8350_pon {
+       status = "disabled";
+};
+
+/*
+ * Chrome designs always boot from SPI flash hooked up to the qspi.
+ *
+ * It's expected that all boards will support "dual SPI" at 37.5 MHz.
+ * If some boards need a different speed or have a package that allows
+ * Quad SPI together with WP then those boards can easily override.
+ */
+&qspi {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&qspi_clk>, <&qspi_cs0>, <&qspi_data01>;
+
+       spi_flash: flash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+
+               spi-max-frequency = <37500000>;
+               spi-tx-bus-width = <2>;
+               spi-rx-bus-width = <2>;
+       };
+};
+
+/* Modem setup is different on Chrome setups than typical Qualcomm setup */
+&remoteproc_mpss {
+       status = "okay";
+       compatible = "qcom,sc7280-mss-pil";
+       iommus = <&apps_smmu 0x124 0x0>, <&apps_smmu 0x488 0x7>;
+       memory-region = <&mba_mem>, <&mpss_mem>;
+};
+
+/* Increase the size from 2.5MB to 8MB */
+&rmtfs_mem {
+       reg = <0x0 0x9c900000 0x0 0x800000>;
+};
index cd2755c..e2efbdd 100644 (file)
        };
 };
 
+&apps_rsc {
+       pmg1110-regulators {
+               compatible = "qcom,pmg1110-rpmh-regulators";
+               qcom,pmic-id = "k";
+
+               vreg_s1k_1p0: smps1 {
+                       regulator-min-microvolt = <1010000>;
+                       regulator-max-microvolt = <1170000>;
+               };
+       };
+};
+
 ap_tp_i2c: &i2c0 {
        status = "okay";
        clock-frequency = <400000>;
diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine-herobrine-r0.dts b/arch/arm64/boot/dts/qcom/sc7280-herobrine-herobrine-r0.dts
new file mode 100644 (file)
index 0000000..1779d96
--- /dev/null
@@ -0,0 +1,1352 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Herobrine board device tree source
+ *
+ * Copyright 2021 Google LLC.
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/iio/qcom,spmi-adc7-pmk8350.h>
+#include <dt-bindings/iio/qcom,spmi-adc7-pmr735a.h>
+#include <dt-bindings/input/gpio-keys.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
+#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
+
+#include "sc7280.dtsi"
+
+/* PMICs depend on spmi_bus label and so must come after SoC */
+#include "pm7325.dtsi"
+#include "pm8350c.dtsi"
+#include "pmk8350.dtsi"
+
+#include "sc7280-chrome-common.dtsi"
+
+/ {
+       model = "Google Herobrine (rev0)";
+       compatible = "google,herobrine-rev0", "qcom,sc7280";
+};
+
+/ {
+       aliases {
+               serial0 = &uart5;
+               serial1 = &uart7;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       /* FIXED REGULATORS - parents above children */
+
+       /* This is the top level supply and variable voltage */
+       ppvar_sys: ppvar-sys-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "ppvar_sys";
+               regulator-always-on;
+               regulator-boot-on;
+       };
+
+       /* This divides ppvar_sys by 2, so voltage is variable */
+       src_vph_pwr: src-vph-pwr-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "src_vph_pwr";
+
+               /* EC turns on with switchcap_on; always on for AP */
+               regulator-always-on;
+               regulator-boot-on;
+
+               vin-supply = <&ppvar_sys>;
+       };
+
+       pp5000_s3: pp5000-s3-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "pp5000_s3";
+
+               /* EC turns on with en_pp5000_s3; always on for AP */
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+
+               vin-supply = <&ppvar_sys>;
+       };
+
+       pp3300_z1: pp3300-z1-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "pp3300_z1";
+
+               /* EC turns on with en_pp3300_z1; always on for AP */
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+
+               vin-supply = <&ppvar_sys>;
+       };
+
+       pp3300_audio:
+       pp3300_codec: pp3300-codec-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "pp3300_codec";
+
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+
+               gpio = <&tlmm 67 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               pinctrl-names = "default";
+               pinctrl-0 = <&en_pp3300_codec>;
+
+               vin-supply = <&pp3300_z1>;
+       };
+
+       pp3300_cam:
+       pp3300_edp:
+       pp3300_ts: pp3300-edp-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "pp3300_edp";
+
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+
+               gpio = <&tlmm 80 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               pinctrl-names = "default";
+               pinctrl-0 = <&en_pp3300_dx_edp>;
+
+               vin-supply = <&pp3300_z1>;
+       };
+
+       pp3300_fp:
+       pp3300_fp_ls:
+       pp3300_mcu: pp3300-fp-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "pp3300_fp";
+
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+
+               regulator-boot-on;
+               regulator-always-on;
+
+               /*
+                * WARNING: it is intentional that GPIO 42 isn't listed here.
+                * The userspace script for updating the fingerprint firmware
+                * needs to control the FP regulators during a FW update,
+                * hence the signal can't be owned by the kernel regulator.
+                */
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&en_fp_rails>;
+
+               vin-supply = <&pp3300_z1>;
+       };
+
+       pp3300_hub: pp3300-hub-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "pp3300_hub";
+
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+
+               regulator-boot-on;
+               regulator-always-on;
+
+               gpio = <&tlmm 24 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               pinctrl-names = "default";
+               pinctrl-0 = <&en_pp3300_hub>;
+
+               vin-supply = <&pp3300_z1>;
+       };
+
+       pp3300_tp: pp3300-tp-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "pp3300_tp";
+
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+
+               /* AP turns on with PP1800_L18B_S0; always on for AP */
+               regulator-always-on;
+               regulator-boot-on;
+
+               vin-supply = <&pp3300_z1>;
+       };
+
+       pp2850_uf_cam: pp2850-uf-cam-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "pp2850_uf_cam";
+
+               regulator-min-microvolt = <2850000>;
+               regulator-max-microvolt = <2850000>;
+
+               gpio = <&tlmm 6 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               pinctrl-names = "default";
+               pinctrl-0 = <&uf_cam_en>;
+
+               vin-supply = <&pp3300_cam>;
+       };
+
+       pp2850_vcm_wf_cam: pp2850-vcm-wf-cam-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "pp2850_vcm_wf_cam";
+
+               regulator-min-microvolt = <2850000>;
+               regulator-max-microvolt = <2850000>;
+
+               gpio = <&tlmm 7 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               pinctrl-names = "default";
+               pinctrl-0 = <&wf_cam_en>;
+
+               vin-supply = <&pp3300_cam>;
+       };
+
+       pp2850_wf_cam: pp2850-wf-cam-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "pp2850_wf_cam";
+
+               regulator-min-microvolt = <2850000>;
+               regulator-max-microvolt = <2850000>;
+
+               gpio = <&tlmm 7 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               /*
+                * The pinconf can only be referenced once so we put it on the
+                * first regulator and comment it out here.
+                *
+                * pinctrl-names = "default";
+                * pinctrl-0 = <&wf_cam_en>;
+                */
+
+               vin-supply = <&pp3300_cam>;
+       };
+
+       pp1800_fp: pp1800-fp-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "pp1800_fp";
+
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+
+               regulator-boot-on;
+               regulator-always-on;
+
+               /*
+                * WARNING: it is intentional that GPIO 42 isn't listed here.
+                * The userspace script for updating the fingerprint firmware
+                * needs to control the FP regulators during a FW update,
+                * hence the signal can't be owned by the kernel regulator.
+                */
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&en_fp_rails>;
+
+               vin-supply = <&pp1800_l18b_s0>;
+               status = "disabled";
+       };
+
+       pp1800_uf_cam: pp1800-uf-cam-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "pp1800_uf_cam";
+
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+
+               gpio = <&tlmm 6 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               /*
+                * The pinconf can only be referenced once so we put it on the
+                * first regulator and comment it out here.
+                *
+                * pinctrl-names = "default";
+                * pinctrl-0 = <&uf_cam_en>;
+                */
+
+               vin-supply = <&pp1800_l19b>;
+       };
+
+       pp1800_wf_cam: pp1800-wf-cam-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "pp1800_wf_cam";
+
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+
+               gpio = <&tlmm 7 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               /*
+                * The pinconf can only be referenced once so we put it on the
+                * first regulator and comment it out here.
+                *
+                * pinctrl-names = "default";
+                * pinctrl-0 = <&wf_cam_en>;
+                */
+
+               vin-supply = <&pp1800_l19b>;
+       };
+
+       pp1200_wf_cam: pp1200-wf-cam-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "pp1200_wf_cam";
+
+               regulator-min-microvolt = <1200000>;
+               regulator-max-microvolt = <1200000>;
+
+               gpio = <&tlmm 7 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               /*
+                * The pinconf can only be referenced once so we put it on the
+                * first regulator and comment it out here.
+                *
+                * pinctrl-names = "default";
+                * pinctrl-0 = <&wf_cam_en>;
+                */
+
+               vin-supply = <&pp1200_l6b>;
+       };
+
+       /* BOARD-SPECIFIC TOP LEVEL NODES */
+
+       gpio_keys: gpio-keys {
+               compatible = "gpio-keys";
+               status = "disabled";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pen_pdct_l>;
+
+               pen_insert: pen-insert {
+                       label = "Pen Insert";
+
+                       /* Insert = low, eject = high */
+                       gpios = <&tlmm 39 GPIO_ACTIVE_LOW>;
+                       linux,code = <SW_PEN_INSERTED>;
+                       linux,input-type = <EV_SW>;
+                       wakeup-event-action = <EV_ACT_DEASSERTED>;
+                       wakeup-source;
+               };
+       };
+
+       pwmleds {
+               compatible = "pwm-leds";
+               status = "disabled";
+               keyboard_backlight: keyboard-backlight {
+                       status = "disabled";
+                       label = "cros_ec::kbd_backlight";
+                       pwms = <&cros_ec_pwm 0>;
+                       max-brightness = <1023>;
+               };
+       };
+};
+
+&apps_rsc {
+       pm7325-regulators {
+               compatible = "qcom,pm7325-rpmh-regulators";
+               qcom,pmic-id = "b";
+
+               vdd19_pmu_pcie_i:
+               vdd19_pmu_rfa_i:
+               vreg_s1b_wlan:
+               vreg_s1b: smps1 {
+                       regulator-min-microvolt = <1856000>;
+                       regulator-max-microvolt = <2040000>;
+               };
+
+               vdd_pmu_aon_i:
+               vreg_s7b_wlan:
+               vreg_s7b: smps7 {
+                       regulator-min-microvolt = <535000>;
+                       regulator-max-microvolt = <1120000>;
+               };
+
+               vdd13_pmu_pcie_i:
+               vdd13_pmu_rfa_i:
+               vreg_s8b_wlan:
+               vreg_s8b: smps8 {
+                       regulator-min-microvolt = <1256000>;
+                       regulator-max-microvolt = <1500000>;
+               };
+
+               vdda_usb_ss_dp_core:
+               vreg_l1b: ldo1 {
+                       regulator-min-microvolt = <825000>;
+                       regulator-max-microvolt = <925000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vdda_usb_hs0_3p1:
+               vreg_l2b: ldo2 {
+                       regulator-min-microvolt = <2700000>;
+                       regulator-max-microvolt = <3544000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               pp1200_l6b:
+               vdd_ufs_1p2:
+               vdd_vref:
+               vdda_csi01_1p2:
+               vdda_csi23_1p2:
+               vdda_csi4_1p2:
+               vdda_dsi0_1p2:
+               vdda_pcie0_1p2:
+               vdda_pcie1_1p2:
+               vdda_usb_ss_dp_1p2:
+               vdda_qlink0_1p2_ck:
+               vdda_qlink1_1p2_ck:
+               vreg_l6b_1p2:
+               vreg_l6b: ldo6 {
+                       regulator-min-microvolt = <1120000>;
+                       regulator-max-microvolt = <1408000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               pp2950_l7b:
+               vreg_l7b: ldo7 {
+                       regulator-min-microvolt = <2960000>;
+                       regulator-max-microvolt = <2960000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               codec_vcc:
+               pp1800_l18b_s0:
+               pp1800_ts:
+               vdd1:
+               vddpx_0:
+               vddpx_3:
+               vddpx_7:
+               vreg_l18b: ldo18 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <2000000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               pp1800_l19b:
+               vddpx_ts:
+               vddpx_wl4otp:
+               vreg_l19b: ldo19 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+       };
+
+       pm8350c-regulators {
+               compatible = "qcom,pm8350c-rpmh-regulators";
+               qcom,pmic-id = "c";
+
+               vreg_s1c: smps1 {
+                       regulator-min-microvolt = <2190000>;
+                       regulator-max-microvolt = <2210000>;
+               };
+
+               vddpx_1:
+               vreg_s9c: smps9 {
+                       regulator-min-microvolt = <1010000>;
+                       regulator-max-microvolt = <1170000>;
+               };
+
+               pp1800_l1c:
+               pp1800_pen:
+               vdd_a_gfx_cs_1p1:
+               vdd_a_cxo_1p8:
+               vdd_qfprom:
+               vdda_apc_cs_1p8:
+               vdda_qrefs_1p8:
+               vdda_turing_q6_cs_1p8:
+               vdda_usb_hs0_1p8:
+               vreg_l1c: ldo1 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1980000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               dmic_vdd:
+               pp1800_alc5682:
+               pp1800_l2c:
+               pp1800_vreg_alc5682:
+               vreg_l2c: ldo2 {
+                       regulator-min-microvolt = <1620000>;
+                       regulator-max-microvolt = <1980000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               pp3300_sar:
+               pp3300_sensor:
+               vreg_l3c: ldo3 {
+                       regulator-min-microvolt = <2800000>;
+                       regulator-max-microvolt = <3540000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               ppvar_uim1:
+               vddpx_5:
+               vreg_l4c: ldo4 {
+                       regulator-min-microvolt = <1620000>;
+                       regulator-max-microvolt = <3300000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               pp2950_l5c:
+               uim_vcc:
+               vddpx_6:
+               vreg_l5c: ldo5 {
+                       regulator-min-microvolt = <1620000>;
+                       regulator-max-microvolt = <3300000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               ppvar_l6c:
+               vddpx_2:
+               vreg_l6c: ldo6 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <2950000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l7c: ldo7 {
+                       regulator-min-microvolt = <3000000>;
+                       regulator-max-microvolt = <3544000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               pp1800_prox:
+               pp1800_sar:
+               vreg_l8c: ldo8 {
+                       regulator-min-microvolt = <1620000>;
+                       regulator-max-microvolt = <2000000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               pp2950_l9c:
+               vreg_l9c: ldo9 {
+                       regulator-min-microvolt = <2960000>;
+                       regulator-max-microvolt = <2960000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vdd_a_gnss_0p9:
+               vdd_ufs_core:
+               vdd_usb_hs0_core:
+               vdd_vref_0p9:
+               vdda_csi01_0p9:
+               vdda_csi23_0p9:
+               vdda_csi4_0p9:
+               vdda_dsi0_pll_0p9:
+               vdda_dsi0_0p9:
+               vdda_pcie0_core:
+               vdda_pcie1_core:
+               vdda_qlink0_0p9:
+               vdda_qlink1_0p9:
+               vdda_qlink0_0p9_ck:
+               vdda_qlink1_0p9_ck:
+               vdda_qrefs_0p875:
+               vreg_l10c_0p8:
+               vreg_l10c: ldo10 {
+                       regulator-min-microvolt = <720000>;
+                       regulator-max-microvolt = <1050000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               pp2800_l11c:
+               vreg_l11c: ldo11 {
+                       regulator-min-microvolt = <2800000>;
+                       regulator-max-microvolt = <3544000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               pp1800_l12c:
+               vreg_l12c: ldo12 {
+                       regulator-min-microvolt = <1650000>;
+                       regulator-max-microvolt = <2000000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               pp3300_l13c:
+               vreg_l13c: ldo13 {
+                       regulator-min-microvolt = <2700000>;
+                       regulator-max-microvolt = <3544000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_bob: bob {
+                       regulator-min-microvolt = <3008000>;
+                       regulator-max-microvolt = <3960000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
+               };
+       };
+};
+
+ap_tp_i2c: &i2c1 {
+       status = "okay";
+       clock-frequency = <400000>;
+
+       trackpad: trackpad@15 {
+               compatible = "elan,ekth3000";
+               reg = <0x15>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&tp_int_odl>;
+
+               interrupt-parent = <&tlmm>;
+               interrupts = <102 IRQ_TYPE_EDGE_FALLING>;
+
+               vcc-supply = <&pp3300_z1>;
+
+               wakeup-source;
+       };
+};
+
+ap_h1_i2c: &i2c12 {
+       status = "okay";
+       clock-frequency = <400000>;
+
+       tpm@50 {
+               compatible = "google,cr50";
+               reg = <0x50>;
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&h1_ap_int_odl>;
+
+               interrupt-parent = <&tlmm>;
+               interrupts = <54 IRQ_TYPE_EDGE_RISING>;
+       };
+};
+
+ap_ts_pen: &i2c13 {
+       status = "okay";
+       clock-frequency = <400000>;
+
+       ap_ts: touchscreen@10 {
+               compatible = "hid-over-i2c";
+               reg = <0x10>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&ts_int_l>, <&ts_reset_l>;
+
+               interrupt-parent = <&tlmm>;
+               interrupts = <81 IRQ_TYPE_LEVEL_LOW>;
+
+               post-power-on-delay-ms = <20>;
+               hid-descr-addr = <0x0001>;
+
+               vdd-supply = <&pp3300_ts>;
+       };
+};
+
+&pm7325_gpios {
+       status = "disabled"; /* No GPIOs are connected */
+};
+
+&pmk8350_gpios {
+       status = "disabled"; /* No GPIOs are connected */
+};
+
+&pmk8350_rtc {
+       status = "disabled";
+};
+
+&pmk8350_vadc {
+       pmk8350_die_temp {
+               reg = <PMK8350_ADC7_DIE_TEMP>;
+               label = "pmk8350_die_temp";
+               qcom,pre-scaling = <1 1>;
+       };
+
+       pmr735a_die_temp {
+               reg = <PMR735A_ADC7_DIE_TEMP>;
+               label = "pmr735a_die_temp";
+               qcom,pre-scaling = <1 1>;
+       };
+};
+
+&qfprom {
+       vcc-supply = <&vdd_qfprom>;
+};
+
+&qupv3_id_0 {
+       status = "okay";
+};
+
+&qupv3_id_1 {
+       status = "okay";
+};
+
+&sdhc_1 {
+       status = "okay";
+
+       vmmc-supply = <&pp2950_l7b>;
+       vqmmc-supply = <&pp1800_l19b>;
+};
+
+&sdhc_2 {
+       status = "okay";
+
+       pinctrl-0 = <&sdc2_clk>, <&sdc2_cmd>, <&sdc2_data>, <&sd_cd>;
+       pinctrl-1 = <&sdc2_clk_sleep>, <&sdc2_cmd_sleep>, <&sdc2_data_sleep>, <&sd_cd>;
+       vmmc-supply = <&pp2950_l9c>;
+       vqmmc-supply = <&ppvar_l6c>;
+
+       cd-gpios = <&tlmm 91 GPIO_ACTIVE_LOW>;
+};
+
+ap_ec_spi: &spi8 {
+       status = "okay";
+
+       pinctrl-0 = <&qup_spi8_data_clk>, <&qup_spi8_cs_gpio_init_high>, <&qup_spi8_cs_gpio>;
+       cs-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
+
+       cros_ec: ec@0 {
+               compatible = "google,cros-ec-spi";
+               reg = <0>;
+               interrupt-parent = <&tlmm>;
+               interrupts = <142 IRQ_TYPE_LEVEL_LOW>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&ap_ec_int_l>;
+               spi-max-frequency = <3000000>;
+
+               cros_ec_pwm: pwm {
+                       compatible = "google,cros-ec-pwm";
+                       #pwm-cells = <1>;
+               };
+
+               i2c_tunnel: i2c-tunnel {
+                       compatible = "google,cros-ec-i2c-tunnel";
+                       google,remote-bus = <0>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               typec {
+                       compatible = "google,cros-ec-typec";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       usb_c0: connector@0 {
+                               compatible = "usb-c-connector";
+                               reg = <0>;
+                               label = "left";
+                               power-role = "dual";
+                               data-role = "host";
+                               try-power-role = "source";
+                       };
+
+                       usb_c1: connector@1 {
+                               compatible = "usb-c-connector";
+                               reg = <1>;
+                               label = "right";
+                               power-role = "dual";
+                               data-role = "host";
+                               try-power-role = "source";
+                       };
+               };
+       };
+};
+
+#include <arm/cros-ec-keyboard.dtsi>
+#include <arm/cros-ec-sbs.dtsi>
+
+&keyboard_controller {
+       function-row-physmap = <
+               MATRIX_KEY(0x00, 0x02, 0)       /* T1 */
+               MATRIX_KEY(0x03, 0x02, 0)       /* T2 */
+               MATRIX_KEY(0x02, 0x02, 0)       /* T3 */
+               MATRIX_KEY(0x01, 0x02, 0)       /* T4 */
+               MATRIX_KEY(0x03, 0x04, 0)       /* T5 */
+               MATRIX_KEY(0x02, 0x04, 0)       /* T6 */
+               MATRIX_KEY(0x01, 0x04, 0)       /* T7 */
+               MATRIX_KEY(0x02, 0x09, 0)       /* T8 */
+               MATRIX_KEY(0x01, 0x09, 0)       /* T9 */
+               MATRIX_KEY(0x00, 0x04, 0)       /* T10 */
+       >;
+       linux,keymap = <
+               MATRIX_KEY(0x00, 0x02, KEY_BACK)
+               MATRIX_KEY(0x03, 0x02, KEY_REFRESH)
+               MATRIX_KEY(0x02, 0x02, KEY_ZOOM)
+               MATRIX_KEY(0x01, 0x02, KEY_SCALE)
+               MATRIX_KEY(0x03, 0x04, KEY_SYSRQ)
+               MATRIX_KEY(0x02, 0x04, KEY_BRIGHTNESSDOWN)
+               MATRIX_KEY(0x01, 0x04, KEY_BRIGHTNESSUP)
+               MATRIX_KEY(0x02, 0x09, KEY_MUTE)
+               MATRIX_KEY(0x01, 0x09, KEY_VOLUMEDOWN)
+               MATRIX_KEY(0x00, 0x04, KEY_VOLUMEUP)
+
+               CROS_STD_MAIN_KEYMAP
+       >;
+};
+
+&uart5 {
+       compatible = "qcom,geni-debug-uart";
+       status = "okay";
+};
+
+&uart7 {
+       status = "okay";
+};
+
+&usb_1 {
+       status = "okay";
+};
+
+&usb_1_dwc3 {
+       dr_mode = "host";
+};
+
+&usb_1_hsphy {
+       status = "okay";
+
+       vdda-pll-supply = <&vdd_usb_hs0_core>;
+       vdda33-supply = <&vdda_usb_hs0_3p1>;
+       vdda18-supply = <&vdda_usb_hs0_1p8>;
+};
+
+&usb_1_qmpphy {
+       status = "okay";
+
+       vdda-phy-supply = <&vdda_usb_ss_dp_1p2>;
+       vdda-pll-supply = <&vdda_usb_ss_dp_core>;
+};
+
+&usb_2 {
+       status = "okay";
+};
+
+&usb_2_dwc3 {
+       dr_mode = "host";
+};
+
+&usb_2_hsphy {
+       status = "okay";
+
+       vdda-pll-supply = <&vdd_usb_hs0_core>;
+       vdda33-supply = <&vdda_usb_hs0_3p1>;
+       vdda18-supply = <&vdda_usb_hs0_1p8>;
+};
+
+/* PINCTRL - additions to nodes defined in sc7280.dtsi */
+
+&dp_hot_plug_det {
+       bias-disable;
+};
+
+&pcie1_clkreq_n {
+       bias-pull-up;
+       drive-strength = <2>;
+};
+
+&qspi_cs0 {
+       bias-disable;
+};
+
+&qspi_clk {
+       bias-disable;
+};
+
+&qspi_data01 {
+       /* High-Z when no transfers; nice to park the lines */
+       bias-pull-up;
+};
+
+&qup_uart5_rx {
+       drive-strength = <2>;
+       bias-pull-up;
+};
+
+&qup_uart5_tx {
+       drive-strength = <2>;
+       bias-disable;
+};
+
+&qup_uart7_cts {
+       /*
+        * Configure a pull-down on CTS to match the pull of
+        * the Bluetooth module.
+        */
+       bias-pull-down;
+};
+
+&qup_uart7_rts {
+       /* We'll drive RTS, so no pull */
+       drive-strength = <2>;
+       bias-disable;
+};
+
+&qup_uart7_tx {
+       /* We'll drive TX, so no pull */
+       drive-strength = <2>;
+       bias-disable;
+};
+
+&qup_uart7_rx {
+       /*
+        * Configure a pull-up on RX. This is needed to avoid
+        * garbage data when the TX pin of the Bluetooth module is
+        * in tri-state (module powered off or not driving the
+        * signal yet).
+        */
+       bias-pull-up;
+};
+
+&sdc1_clk {
+       bias-disable;
+       drive-strength = <16>;
+};
+
+&sdc1_cmd {
+       bias-pull-up;
+       drive-strength = <10>;
+};
+
+&sdc1_data {
+       bias-pull-up;
+       drive-strength = <10>;
+};
+
+&sdc1_rclk {
+       bias-pull-down;
+};
+
+&sdc2_clk {
+       bias-disable;
+       drive-strength = <16>;
+};
+
+&sdc2_cmd {
+       bias-pull-up;
+       drive-strength = <10>;
+};
+
+&sdc2_data {
+       bias-pull-up;
+       drive-strength = <10>;
+};
+
+/* PINCTRL - board-specific pinctrl */
+
+&pm8350c_gpios {
+       gpio-line-names = "AP_SUSPEND",
+                         "",
+                         "",
+                         "AP_BL_EN",
+                         "",
+                         "SD_CD_ODL",
+                         "",
+                         "",
+                         "AP_BL_PWM";
+
+       ap_bl_en: ap-bl-en {
+               pins = "gpio4";
+               function = "normal";
+               qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
+               bias-disable;
+
+               /* Force backlight to be disabled to match state at boot. */
+               output-low;
+       };
+};
+
+&tlmm {
+       gpio-line-names = "HP_I2C_SDA",                 /* 0 */
+                         "HP_I2C_SCL",
+                         "SSD_RST_L",
+                         "PE_WAKE_ODL",
+                         "AP_TP_I2C_SDA",
+                         "AP_TP_I2C_SCL",
+                         "UF_CAM_EN",
+                         "WF_CAM_EN",
+                         "AP_SAR_SENSOR_SDA",
+                         "AP_SAR_SENSOR_SCL",
+
+                         "",                           /* 10 */
+                         "",
+                         "AP_SPI_MOSI",
+                         "AP_SPI_MISO",
+                         "AP_SPI_CLK",
+                         "AP_SPI_CS0_L",
+                         "",
+                         "",
+                         "EDP_HPD",
+                         "",
+
+                         "UF_CAM_RST_L",               /* 20 */
+                         "WF_CAM_RST_L",
+                         "UART_AP_TX_DBG_RX",
+                         "UART_DBG_TX_AP_RX",
+                         "EN_PP3300_HUB",
+                         "",
+                         "HOST2WLAN_SOL",
+                         "WLAN2HOST_SOL",
+                         "BT_UART_CTS",
+                         "BT_UART_RTS",
+
+                         "BT_UART_TXD",                /* 30 */
+                         "BT_UART_RXD",
+                         "AP_EC_SPI_MISO",
+                         "AP_EC_SPI_MOSI",
+                         "AP_EC_SPI_CLK",
+                         "AP_EC_SPI_CS_L",
+                         "",
+                         "",
+                         "",
+                         "PEN_PDCT_L",
+
+                         "IO_BRD_ID0",                 /* 40 */
+                         "IO_BRD_ID1",
+                         "EN_FP_RAILS",
+                         "PEN_IRQ_L",
+                         "AP_SPI_FP_MISO",
+                         "AP_SPI_FP_MOSI",
+                         "AP_SPI_FP_CLK",
+                         "AP_SPI_FP_CS_L",
+                         "AP_H1_SPI_MISO",
+                         "AP_H1_SPI_MOSI",
+
+                         "AP_H1_SPI_CLK",              /* 50 */
+                         "AP_H1_SPI_CS_L",
+                         "AP_TS_PEN_I2C_SDA",
+                         "AP_TS_PEN_I2C_SCL",
+                         "H1_AP_INT_ODL",
+                         "",
+                         "LCM_RST_1V8_L",
+                         "AMP_EN",
+                         "",
+                         "DP_HOT_PLUG_DET",
+
+                         "HUB_RST_L",                  /* 60 */
+                         "FP_TO_AP_IRQ_L",
+                         "",
+                         "",
+                         "UF_CAM_MCLK",
+                         "WF_CAM_MCLK",
+                         "IO_BRD_ID2",
+                         "EN_PP3300_CODEC",
+                         "EC_IN_RW_ODL",
+                         "UF_CAM_SDA",
+
+                         "UF_CAM_SCL",                 /* 70 */
+                         "WF_CAM_SDA",
+                         "WF_CAM_SCL",
+                         "AP_BRD_ID0",
+                         "AP_BRD_ID1",
+                         "AP_BRD_ID2",
+                         "",
+                         "FPMCU_BOOT0",
+                         "FP_RST_L",
+                         "PE_CLKREQ_ODL",
+
+                         "EN_EDP_PP3300",              /* 80 */
+                         "TS_INT_L",
+                         "FORCE_USB_BOOT",
+                         "WCD_RST_L",
+                         "WLAN_EN",
+                         "BT_EN",
+                         "WLAN_SW_CTRL",
+                         "PCIE0_RESET_L",
+                         "PCIE0_CLK_REQ_L",
+                         "PCIE0_WAKE_L",
+
+                         "AS_EN",                      /* 90 */
+                         "SD_CD_ODL",
+                         "",
+                         /*
+                          * AP_FLASH_WP_L is crossystem ABI. Schematics
+                          * call it BIOS_FLASH_WP_L.
+                          */
+                         "AP_FLASH_WP_L",
+                         "BT_WLAN_SB_CLK",
+                         "BT_WLAN_SB_DATA",
+                         "HP_MCLK",
+                         "HP_BCLK",
+                         "HP_DOUT",
+                         "HP_DIN",
+
+                         "HP_LRCLK",                   /* 100 */
+                         "HP_IRQ",
+                         "TP_INT_ODL",
+                         "",
+                         "IO_SKU_ID2",
+                         "TS_RESET_L",
+                         "AMP_BCLK",
+                         "AMP_DIN",
+                         "AMP_LRCLK",
+                         "UIM2_DATA",
+
+                         "UIM2_CLK",                   /* 110 */
+                         "UIM2_RST",
+                         "UIM2_PRESENT",
+                         "UIM1_DATA",
+                         "UIM1_CLK",
+                         "UIM1_RST",
+                         "",
+                         "RFFE0_CLK",
+                         "RFFE0_DATA/BOOT_CONFIG_0",
+                         "RFFE1_CLK",
+
+                         "RFFE1_DATA/BOOT_CONFIG_1",   /* 120 */
+                         "RFFE2_CLK",
+                         "RFFE2_DATA/BOOT_CONFIG_2",
+                         "RFFE3_CLK",
+                         "RFFE3_DATA/BOOT_CONFIG_3",
+                         "RFFE4_CLK",
+                         "RFFE4_DATA",
+                         "WCI2_LTE_COEX_RXD",
+                         "WCI2_LTE_COEX_TXD",
+                         "IO_SKU_ID0",
+
+                         "IO_SKU_ID1",                 /* 130 */
+                         "",
+                         "",
+                         "QLINK0_REQ",
+                         "QLINK0_EN",
+                         "QLINK0_WMSS_RESET_L",
+                         "QLINK1_REQ",
+                         "QLINK1_EN",
+                         "QLINK1_WMSS_RESET_L",
+                         "FORCED_USB_BOOT_POL",
+
+                         "",                           /* 140 */
+                         "P_SENSOR_INT_L",
+                         "AP_EC_INT_L",
+                         "",
+                         "WCD_SWR_TX_CLK",
+                         "WCD_SWR_TX_DATA_0",
+                         "WCD_SWR_TX_DATA_1",
+                         "WCD_SWR_RX_CLK",
+                         "WCD_SWR_RX_DATA_0",
+                         "WCD_SWR_RX_DATA_1",
+
+                         "",                           /* 150 */
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "WCD_SWR_TX_DATA_2",
+                         "",
+
+                         "",                           /* 160 */
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+
+                         "",                           /* 170 */
+                         "SENS_UART_TXD",
+                         "SENS_UART_RXD",
+                         "",
+                         "",
+                         "";
+
+       /*
+        * pinctrl settings for pins that have no real owners.
+        */
+       pinctrl-names = "default";
+       pinctrl-0 = <&bios_flash_wp_l>;
+
+       amp_en: amp-en {
+               pins = "gpio57";
+               function = "gpio";
+               bias-pull-down;
+       };
+
+       ap_ec_int_l: ap-ec-int-l {
+               pins = "gpio142";
+               input-enable;
+               bias-pull-up;
+       };
+
+       bios_flash_wp_l: bios-flash-wp-l {
+               pins = "gpio93";
+               function = "gpio";
+               input-enable;
+               bias-disable;
+       };
+
+       bt_en: bt-en {
+               pins = "gpio85";
+               function = "gpio";
+               drive-strength = <2>;
+               output-low;
+               bias-pull-down;
+       };
+
+       en_fp_rails: en-fp-rails {
+               pins = "gpio42";
+               drive-strength = <2>;
+               output-high;
+               bias-disable;
+       };
+
+       en_pp3300_codec: en-pp3300-codec {
+               pins = "gpio67";
+               drive-strength = <2>;
+               bias-disable;
+       };
+
+       en_pp3300_dx_edp: en-pp3300-dx-edp {
+               pins = "gpio80";
+               function = "gpio";
+               drive-strength = <2>;
+               /* Has external pulldown */
+               bias-disable;
+       };
+
+       en_pp3300_hub: en-pp3300-hub {
+               pins = "gpio24";
+               function = "gpio";
+               drive-strength = <2>;
+               /* Has external pulldown */
+               bias-disable;
+       };
+
+       fp_to_ap_irq_l: fp-to-ap-irq-l {
+               pins = "gpio61";
+               function = "gpio";
+               input-enable;
+               /* Has external pullup */
+               bias-disable;
+       };
+
+       h1_ap_int_odl: h1-ap-int-odl {
+               pins = "gpio54";
+               function = "gpio";
+               input-enable;
+               bias-pull-up;
+       };
+
+       hp_irq: hp-irq {
+               pins = "gpio101";
+               function = "gpio";
+               bias-pull-up;
+       };
+
+       p_sensor_int_l: p-sensor-int-l {
+               pins = "gpio141";
+               function = "gpio";
+               input-enable;
+               bias-pull-up;
+       };
+
+       pen_irq_l: pen-irq-l {
+               pins = "gpio43";
+               function = "gpio";
+               /* Has external pullup */
+               bias-disable;
+       };
+
+       pen_pdct_l: pen-pdct-l {
+               pins = "gpio39";
+               function = "gpio";
+               /* Has external pullup */
+               bias-disable;
+       };
+
+       qup_spi8_cs_gpio_init_high: qup-spi8-cs-gpio-init-high {
+               pins = "gpio35";
+               output-high;
+       };
+
+       qup_spi11_cs_gpio_init_high: qup-spi11-cs-gpio-init-high {
+               pins = "gpio47";
+               output-high;
+       };
+
+       qup_spi12_cs_gpio_init_high: qup-spi12-cs-gpio-init-high {
+               pins = "gpio51";
+               output-high;
+       };
+
+       qup_uart7_sleep_cts: qup-uart7-sleep-cts {
+               pins = "gpio28";
+               function = "gpio";
+               /*
+                * Configure a pull-down on CTS to match the pull of
+                * the Bluetooth module.
+                */
+               bias-pull-down;
+       };
+
+       qup_uart7_sleep_rts: qup-uart7-sleep-rts {
+               pins = "gpio29";
+               function = "gpio";
+               /*
+                * Configure pull-down on RTS. As RTS is active low
+                * signal, pull it low to indicate the BT SoC that it
+                * can wakeup the system anytime from suspend state by
+                * pulling RX low (by sending wakeup bytes).
+                */
+               bias-pull-down;
+       };
+
+       qup_uart7_sleep_rx: qup-uart7-sleep-rx {
+               pins = "gpio31";
+               function = "gpio";
+               /*
+                * Configure a pull-up on RX. This is needed to avoid
+                * garbage data when the TX pin of the Bluetooth module
+                * is floating which may cause spurious wakeups.
+                */
+               bias-pull-up;
+       };
+
+       qup_uart7_sleep_tx: qup-uart7-sleep-tx {
+               pins = "gpio30";
+               function = "gpio";
+               /*
+                * Configure pull-up on TX when it isn't actively driven
+                * to prevent BT SoC from receiving garbage during sleep.
+                */
+               bias-pull-up;
+       };
+
+       sd_cd: sd-cd {
+               pins = "gpio91";
+               function = "gpio";
+               bias-pull-up;
+       };
+
+       tp_int_odl: tp-int-odl {
+               pins = "gpio102";
+               function = "gpio";
+               /* Has external pullup */
+               bias-disable;
+       };
+
+       ts_int_l: ts-int-l {
+               pins = "gpio81";
+               function = "gpio";
+               /* Has external pullup */
+               bias-pull-up;
+       };
+
+       ts_reset_l: ts-reset-l {
+               pins = "gpio105";
+               function = "gpio";
+               /* Has external pullup */
+               bias-disable;
+               drive-strength = <2>;
+       };
+
+       uf_cam_en: uf-cam-en {
+               pins = "gpio6";
+               function = "gpio";
+               drive-strength = <2>;
+               /* Has external pulldown */
+               bias-disable;
+       };
+
+       wf_cam_en: wf-cam-en {
+               pins = "gpio7";
+               function = "gpio";
+               drive-strength = <2>;
+               /* Has external pulldown */
+               bias-disable;
+       };
+};
diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine-herobrine-r1.dts b/arch/arm64/boot/dts/qcom/sc7280-herobrine-herobrine-r1.dts
new file mode 100644 (file)
index 0000000..f952730
--- /dev/null
@@ -0,0 +1,313 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Herobrine board device tree source
+ *
+ * Copyright 2022 Google LLC.
+ */
+
+/dts-v1/;
+
+#include "sc7280-herobrine.dtsi"
+
+/ {
+       model = "Google Herobrine (rev1+)";
+       compatible = "google,herobrine", "qcom,sc7280";
+};
+
+/* ADDITIONS TO NODES DEFINED IN PARENT DEVICE TREE FILES */
+
+&ap_spi_fp {
+       status = "okay";
+};
+
+/*
+ * Although the trackpad is really part of the herobrine baseboard, we'll
+ * put the actual definition in the board device tree since different boards
+ * might hook up different trackpads (or no i2c trackpad at all in the case
+ * of tablets / detachables).
+ */
+ap_tp_i2c: &i2c0 {
+       status = "okay";
+       clock-frequency = <400000>;
+
+       trackpad: trackpad@15 {
+               compatible = "elan,ekth3000";
+               reg = <0x15>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&tp_int_odl>;
+
+               interrupt-parent = <&tlmm>;
+               interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
+
+               vcc-supply = <&pp3300_z1>;
+
+               wakeup-source;
+       };
+};
+
+/*
+ * The touchscreen connector might come off the Qcard, at least in the case of
+ * eDP. Like the trackpad, we'll put it in the board device tree file since
+ * different boards have different touchscreens.
+ */
+ts_i2c: &i2c13 {
+       status = "okay";
+       clock-frequency = <400000>;
+
+       ap_ts: touchscreen@5c {
+               compatible = "hid-over-i2c";
+               reg = <0x5c>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&ts_int_conn>, <&ts_rst_conn>;
+
+               interrupt-parent = <&tlmm>;
+               interrupts = <55 IRQ_TYPE_LEVEL_LOW>;
+
+               post-power-on-delay-ms = <500>;
+               hid-descr-addr = <0x0000>;
+
+               vdd-supply = <&ts_avdd>;
+       };
+};
+
+/* For nvme */
+&pcie1 {
+       status = "okay";
+};
+
+/* For nvme */
+&pcie1_phy {
+       status = "okay";
+};
+
+/* For eMMC */
+&sdhc_1 {
+       status = "okay";
+};
+
+/* For SD Card */
+&sdhc_2 {
+       status = "okay";
+};
+
+/* PINCTRL - BOARD-SPECIFIC */
+
+/*
+ * Methodology for gpio-line-names:
+ * - If a pin goes to herobrine board and is named it gets that name.
+ * - If a pin goes to herobrine board and is not named, it gets no name.
+ * - If a pin is totally internal to Qcard then it gets Qcard name.
+ * - If a pin is not hooked up on Qcard, it gets no name.
+ */
+
+&pm8350c_gpios {
+       gpio-line-names = "FLASH_STROBE_1",             /* 1 */
+                         "AP_SUSPEND",
+                         "PM8008_1_RST_N",
+                         "",
+                         "",
+                         "",
+                         "PMIC_EDP_BL_EN",
+                         "PMIC_EDP_BL_PWM",
+                         "";
+};
+
+&tlmm {
+       gpio-line-names = "AP_TP_I2C_SDA",              /* 0 */
+                         "AP_TP_I2C_SCL",
+                         "SSD_RST_L",
+                         "PE_WAKE_ODL",
+                         "AP_SAR_SDA",
+                         "AP_SAR_SCL",
+                         "PRB_SC_GPIO_6",
+                         "TP_INT_ODL",
+                         "HP_I2C_SDA",
+                         "HP_I2C_SCL",
+
+                         "GNSS_L1_EN",                 /* 10 */
+                         "GNSS_L5_EN",
+                         "SPI_AP_MOSI",
+                         "SPI_AP_MISO",
+                         "SPI_AP_CLK",
+                         "SPI_AP_CS0_L",
+                         /*
+                          * AP_FLASH_WP is crossystem ABI. Schematics
+                          * call it BIOS_FLASH_WP_OD.
+                          */
+                         "AP_FLASH_WP",
+                         "",
+                         "AP_EC_INT_L",
+                         "",
+
+                         "UF_CAM_RST_L",               /* 20 */
+                         "WF_CAM_RST_L",
+                         "UART_AP_TX_DBG_RX",
+                         "UART_DBG_TX_AP_RX",
+                         "",
+                         "PM8008_IRQ_1",
+                         "HOST2WLAN_SOL",
+                         "WLAN2HOST_SOL",
+                         "MOS_BT_UART_CTS",
+                         "MOS_BT_UART_RFR",
+
+                         "MOS_BT_UART_TX",             /* 30 */
+                         "MOS_BT_UART_RX",
+                         "PRB_SC_GPIO_32",
+                         "HUB_RST_L",
+                         "",
+                         "",
+                         "AP_SPI_FP_MISO",
+                         "AP_SPI_FP_MOSI",
+                         "AP_SPI_FP_CLK",
+                         "AP_SPI_FP_CS_L",
+
+                         "AP_EC_SPI_MISO",             /* 40 */
+                         "AP_EC_SPI_MOSI",
+                         "AP_EC_SPI_CLK",
+                         "AP_EC_SPI_CS_L",
+                         "LCM_RST_L",
+                         "EARLY_EUD_N",
+                         "",
+                         "DP_HOT_PLUG_DET",
+                         "IO_BRD_MLB_ID0",
+                         "IO_BRD_MLB_ID1",
+
+                         "IO_BRD_MLB_ID2",             /* 50 */
+                         "SSD_EN",
+                         "TS_I2C_SDA_CONN",
+                         "TS_I2C_CLK_CONN",
+                         "TS_RST_CONN",
+                         "TS_INT_CONN",
+                         "AP_I2C_TPM_SDA",
+                         "AP_I2C_TPM_SCL",
+                         "PRB_SC_GPIO_58",
+                         "PRB_SC_GPIO_59",
+
+                         "EDP_HOT_PLUG_DET_N",         /* 60 */
+                         "FP_TO_AP_IRQ_L",
+                         "",
+                         "AMP_EN",
+                         "CAM0_MCLK_GPIO_64",
+                         "CAM1_MCLK_GPIO_65",
+                         "WF_CAM_MCLK",
+                         "PRB_SC_GPIO_67",
+                         "FPMCU_BOOT0",
+                         "UF_CAM_SDA",
+
+                         "UF_CAM_SCL",                 /* 70 */
+                         "",
+                         "",
+                         "WF_CAM_SDA",
+                         "WF_CAM_SCL",
+                         "",
+                         "",
+                         "EN_FP_RAILS",
+                         "FP_RST_L",
+                         "PCIE1_CLKREQ_ODL",
+
+                         "EN_PP3300_DX_EDP",           /* 80 */
+                         "SC_GPIO_81",
+                         "FORCED_USB_BOOT",
+                         "WCD_RESET_N",
+                         "MOS_WLAN_EN",
+                         "MOS_BT_EN",
+                         "MOS_SW_CTRL",
+                         "MOS_PCIE0_RST",
+                         "MOS_PCIE0_CLKREQ_N",
+                         "MOS_PCIE0_WAKE_N",
+
+                         "MOS_LAA_AS_EN",              /* 90 */
+                         "SD_CD_ODL",
+                         "",
+                         "",
+                         "MOS_BT_WLAN_SLIMBUS_CLK",
+                         "MOS_BT_WLAN_SLIMBUS_DAT0",
+                         "HP_MCLK",
+                         "HP_BCLK",
+                         "HP_DOUT",
+                         "HP_DIN",
+
+                         "HP_LRCLK",                   /* 100 */
+                         "HP_IRQ",
+                         "",
+                         "",
+                         "GSC_AP_INT_ODL",
+                         "EN_PP3300_CODEC",
+                         "AMP_BCLK",
+                         "AMP_DIN",
+                         "AMP_LRCLK",
+                         "UIM1_DATA_GPIO_109",
+
+                         "UIM1_CLK_GPIO_110",          /* 110 */
+                         "UIM1_RESET_GPIO_111",
+                         "PRB_SC_GPIO_112",
+                         "UIM0_DATA",
+                         "UIM0_CLK",
+                         "UIM0_RST",
+                         "UIM0_PRESENT_ODL",
+                         "SDM_RFFE0_CLK",
+                         "SDM_RFFE0_DATA",
+                         "WF_CAM_EN",
+
+                         "FASTBOOT_SEL_0",             /* 120 */
+                         "SC_GPIO_121",
+                         "FASTBOOT_SEL_1",
+                         "SC_GPIO_123",
+                         "FASTBOOT_SEL_2",
+                         "SM_RFFE4_CLK_GRFC_8",
+                         "SM_RFFE4_DATA_GRFC_9",
+                         "WLAN_COEX_UART1_RX",
+                         "WLAN_COEX_UART1_TX",
+                         "PRB_SC_GPIO_129",
+
+                         "LCM_ID0",                    /* 130 */
+                         "LCM_ID1",
+                         "",
+                         "SDR_QLINK_REQ",
+                         "SDR_QLINK_EN",
+                         "QLINK0_WMSS_RESET_N",
+                         "SMR526_QLINK1_REQ",
+                         "SMR526_QLINK1_EN",
+                         "SMR526_QLINK1_WMSS_RESET_N",
+                         "PRB_SC_GPIO_139",
+
+                         "SAR1_IRQ_ODL",               /* 140 */
+                         "SAR0_IRQ_ODL",
+                         "PRB_SC_GPIO_142",
+                         "",
+                         "WCD_SWR_TX_CLK",
+                         "WCD_SWR_TX_DATA0",
+                         "WCD_SWR_TX_DATA1",
+                         "WCD_SWR_RX_CLK",
+                         "WCD_SWR_RX_DATA0",
+                         "WCD_SWR_RX_DATA1",
+
+                         "DMIC01_CLK",                 /* 150 */
+                         "DMIC01_DATA",
+                         "DMIC23_CLK",
+                         "DMIC23_DATA",
+                         "",
+                         "",
+                         "EC_IN_RW_ODL",
+                         "HUB_EN",
+                         "WCD_SWR_TX_DATA2",
+                         "",
+
+                         "",                           /* 160 */
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+
+                         "",                           /* 170 */
+                         "MOS_BLE_UART_TX",
+                         "MOS_BLE_UART_RX",
+                         "",
+                         "",
+                         "";
+};
diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine.dts b/arch/arm64/boot/dts/qcom/sc7280-herobrine.dts
deleted file mode 100644 (file)
index 7a92679..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
-/*
- * Google Herobrine board device tree source
- *
- * Copyright 2021 Google LLC.
- */
-
-#include "sc7280-herobrine.dtsi"
-
-/ {
-       model = "Google Herobrine";
-       compatible = "google,herobrine",
-                    "qcom,sc7280";
-};
index 4619fa9..dc17f20 100644 (file)
@@ -1,87 +1,37 @@
 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
- * Google Herobrine board device tree source
+ * Google Herobrine baseboard device tree source
  *
- * Copyright 2021 Google LLC.
+ * The set of things in this file is a bit loosely defined. It's roughly
+ * defined as the set of things that the child boards happen to have in
+ * common. Since all of the child boards started from the same original
+ * design this is hopefully a large set of things but as more derivatives
+ * appear things may "bubble down" out of this file. For things that are
+ * part of the reference design but might not exist on child nodes we will
+ * follow the lead of the SoC dtsi files and leave their status as "disabled".
+ *
+ * Copyright 2022 Google LLC.
  */
 
-/dts-v1/;
-
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/iio/qcom,spmi-adc7-pmk8350.h>
-#include <dt-bindings/iio/qcom,spmi-adc7-pmr735a.h>
 #include <dt-bindings/input/gpio-keys.h>
 #include <dt-bindings/input/input.h>
-#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
-#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
-
-#include "sc7280.dtsi"
-
-/* PMICs depend on spmi_bus label and so must come after SoC */
-#include "pm7325.dtsi"
-#include "pm8350c.dtsi"
-#include "pmk8350.dtsi"
-
-/*
- * Reserved memory changes
- *
- * Delete all unused memory nodes and define the peripheral memory regions
- * required by the board dts.
- *
- */
-
-/delete-node/ &hyp_mem;
-/delete-node/ &xbl_mem;
-/delete-node/ &sec_apps_mem;
 
-/* Increase the size from 2MB to 8MB */
-&rmtfs_mem {
-       reg = <0x0 0x83600000 0x0 0x800000>;
-};
+#include "sc7280-qcard.dtsi"
+#include "sc7280-chrome-common.dtsi"
 
 / {
-       reserved-memory {
-               adsp_mem: memory@86700000 {
-                       reg = <0x0 0x86700000 0x0 0x2800000>;
-                       no-map;
-               };
-
-               camera_mem: memory@8ad00000 {
-                       reg = <0x0 0x8ad00000 0x0 0x500000>;
-                       no-map;
-               };
-
-               venus_mem: memory@8b200000 {
-                       reg = <0x0 0x8b200000 0x0 0x500000>;
-                       no-map;
-               };
-
-               mpss_mem: memory@8b800000 {
-                       reg = <0x0 0x8b800000 0x0 0xf600000>;
-                       no-map;
-               };
-
-               wpss_mem: memory@9ae00000 {
-                       reg = <0x0 0x9ae00000 0x0 0x1900000>;
-                       no-map;
-               };
-
-               mba_mem: memory@9c700000 {
-                       reg = <0x0 0x9c700000 0x0 0x200000>;
-                       no-map;
-               };
-       };
-
-       aliases {
-               serial0 = &uart5;
-               serial1 = &uart7;
-       };
-
        chosen {
                stdout-path = "serial0:115200n8";
        };
 
-       /* FIXED REGULATORS - parents above children */
+       /*
+        * FIXED REGULATORS
+        *
+        * Sort order:
+        * 1. parents above children.
+        * 2. higher voltage above lower voltage.
+        * 3. alphabetically by node name.
+        */
 
        /* This is the top level supply and variable voltage */
        ppvar_sys: ppvar-sys-regulator {
                vin-supply = <&ppvar_sys>;
        };
 
-       pp5000_s3: pp5000-s3-regulator {
+       pp5000_s5: pp5000-s5-regulator {
                compatible = "regulator-fixed";
-               regulator-name = "pp5000_s3";
+               regulator-name = "pp5000_s5";
 
-               /* EC turns on with en_pp5000_s3; always on for AP */
+               /* EC turns on with en_pp5000_s5; always on for AP */
                regulator-always-on;
                regulator-boot-on;
                regulator-min-microvolt = <5000000>;
                vin-supply = <&ppvar_sys>;
        };
 
-       pp3300_audio:
        pp3300_codec: pp3300-codec-regulator {
                compatible = "regulator-fixed";
                regulator-name = "pp3300_codec";
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
 
-               gpio = <&tlmm 67 GPIO_ACTIVE_HIGH>;
+               gpio = <&tlmm 105 GPIO_ACTIVE_HIGH>;
                enable-active-high;
                pinctrl-names = "default";
                pinctrl-0 = <&en_pp3300_codec>;
                vin-supply = <&pp3300_z1>;
        };
 
-       pp3300_cam:
-       pp3300_edp:
-       pp3300_ts: pp3300-edp-regulator {
+       pp3300_left_in_mlb: pp3300-left-in-mlb-regulator {
                compatible = "regulator-fixed";
-               regulator-name = "pp3300_edp";
+               regulator-name = "pp3300_left_in_mlb";
 
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
                vin-supply = <&pp3300_z1>;
        };
 
-       pp3300_fp:
+       pp3300_mcu_fp:
        pp3300_fp_ls:
-       pp3300_mcu: pp3300-fp-regulator {
+       pp3300_fp_mcu: pp3300-fp-regulator {
                compatible = "regulator-fixed";
                regulator-name = "pp3300_fp";
 
                regulator-always-on;
 
                /*
-                * WARNING: it is intentional that GPIO 42 isn't listed here.
+                * WARNING: it is intentional that GPIO 77 isn't listed here.
                 * The userspace script for updating the fingerprint firmware
                 * needs to control the FP regulators during a FW update,
                 * hence the signal can't be owned by the kernel regulator.
                regulator-boot-on;
                regulator-always-on;
 
-               gpio = <&tlmm 24 GPIO_ACTIVE_HIGH>;
+               gpio = <&tlmm 157 GPIO_ACTIVE_HIGH>;
                enable-active-high;
                pinctrl-names = "default";
-               pinctrl-0 = <&en_pp3300_hub>;
+               pinctrl-0 = <&hub_en>;
 
                vin-supply = <&pp3300_z1>;
        };
                vin-supply = <&pp3300_z1>;
        };
 
-       pp2850_uf_cam: pp2850-uf-cam {
+       pp3300_ssd: pp3300-ssd-regulator {
                compatible = "regulator-fixed";
-               regulator-name = "pp2850_uf_cam";
+               regulator-name = "pp3300_ssd";
 
-               regulator-min-microvolt = <2850000>;
-               regulator-max-microvolt = <2850000>;
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
 
-               gpio = <&tlmm 6 GPIO_ACTIVE_HIGH>;
+               gpio = <&tlmm 51 GPIO_ACTIVE_HIGH>;
                enable-active-high;
                pinctrl-names = "default";
-               pinctrl-0 = <&uf_cam_en>;
+               pinctrl-0 = <&ssd_en>;
 
-               vin-supply = <&pp3300_cam>;
+               vin-supply = <&pp3300_z1>;
        };
 
-       pp2850_vcm_wf_cam: pp2850-vcm-wf-cam {
+       pp2850_vcm_wf_cam: pp2850-vcm-wf-cam-regulator {
                compatible = "regulator-fixed";
                regulator-name = "pp2850_vcm_wf_cam";
 
                regulator-min-microvolt = <2850000>;
                regulator-max-microvolt = <2850000>;
 
-               gpio = <&tlmm 7 GPIO_ACTIVE_HIGH>;
+               gpio = <&tlmm 119 GPIO_ACTIVE_HIGH>;
                enable-active-high;
                pinctrl-names = "default";
                pinctrl-0 = <&wf_cam_en>;
 
-               vin-supply = <&pp3300_cam>;
+               vin-supply = <&pp3300_z1>;
        };
 
-       pp2850_wf_cam: pp2850-wf-cam {
+       pp2850_wf_cam: pp2850-wf-cam-regulator {
                compatible = "regulator-fixed";
                regulator-name = "pp2850_wf_cam";
 
                regulator-min-microvolt = <2850000>;
                regulator-max-microvolt = <2850000>;
 
-               gpio = <&tlmm 7 GPIO_ACTIVE_HIGH>;
+               gpio = <&tlmm 119 GPIO_ACTIVE_HIGH>;
                enable-active-high;
                /*
                 * The pinconf can only be referenced once so we put it on the
                 * pinctrl-0 = <&wf_cam_en>;
                 */
 
-               vin-supply = <&pp3300_cam>;
+               vin-supply = <&pp3300_z1>;
        };
 
        pp1800_fp: pp1800-fp-regulator {
                regulator-always-on;
 
                /*
-                * WARNING: it is intentional that GPIO 42 isn't listed here.
+                * WARNING: it is intentional that GPIO 77 isn't listed here.
                 * The userspace script for updating the fingerprint firmware
                 * needs to control the FP regulators during a FW update,
                 * hence the signal can't be owned by the kernel regulator.
                status = "disabled";
        };
 
-       pp1800_uf_cam: pp1800-uf-cam {
-               compatible = "regulator-fixed";
-               regulator-name = "pp1800_uf_cam";
-
-               regulator-min-microvolt = <1800000>;
-               regulator-max-microvolt = <1800000>;
-
-               gpio = <&tlmm 6 GPIO_ACTIVE_HIGH>;
-               enable-active-high;
-               /*
-                * The pinconf can only be referenced once so we put it on the
-                * first regulator and comment it out here.
-                *
-                * pinctrl-names = "default";
-                * pinctrl-0 = <&uf_cam_en>;
-                */
-
-               vin-supply = <&pp1800_l19b>;
-       };
-
-       pp1800_wf_cam: pp1800-wf-cam {
+       pp1800_wf_cam: pp1800-wf-cam-regulator {
                compatible = "regulator-fixed";
                regulator-name = "pp1800_wf_cam";
 
                regulator-min-microvolt = <1800000>;
                regulator-max-microvolt = <1800000>;
 
-               gpio = <&tlmm 7 GPIO_ACTIVE_HIGH>;
+               gpio = <&tlmm 119 GPIO_ACTIVE_HIGH>;
                enable-active-high;
                /*
                 * The pinconf can only be referenced once so we put it on the
                 * pinctrl-0 = <&wf_cam_en>;
                 */
 
-               vin-supply = <&pp1800_l19b>;
+               vin-supply = <&vreg_l19b_s0>;
        };
 
-       pp1200_wf_cam: pp1200-wf-cam {
+       pp1200_wf_cam: pp1200-wf-cam-regulator {
                compatible = "regulator-fixed";
                regulator-name = "pp1200_wf_cam";
 
                regulator-min-microvolt = <1200000>;
                regulator-max-microvolt = <1200000>;
 
-               gpio = <&tlmm 7 GPIO_ACTIVE_HIGH>;
+               gpio = <&tlmm 119 GPIO_ACTIVE_HIGH>;
                enable-active-high;
                /*
                 * The pinconf can only be referenced once so we put it on the
                 * pinctrl-0 = <&wf_cam_en>;
                 */
 
-               vin-supply = <&pp1200_l6b>;
+               vin-supply = <&pp3300_z1>;
        };
 
        /* BOARD-SPECIFIC TOP LEVEL NODES */
 
-       gpio_keys: gpio-keys {
-               compatible = "gpio-keys";
-               status = "disabled";
-               pinctrl-names = "default";
-               pinctrl-0 = <&pen_pdct_l>;
-
-               pen_insert: pen-insert {
-                       label = "Pen Insert";
-
-                       /* Insert = low, eject = high */
-                       gpios = <&tlmm 39 GPIO_ACTIVE_LOW>;
-                       linux,code = <SW_PEN_INSERTED>;
-                       linux,input-type = <EV_SW>;
-                       wakeup-event-action = <EV_ACT_DEASSERTED>;
-                       wakeup-source;
-               };
-       };
-
        pwmleds {
                compatible = "pwm-leds";
                status = "disabled";
        };
 };
 
-&apps_rsc {
-       pm7325-regulators {
-               compatible = "qcom,pm7325-rpmh-regulators";
-               qcom,pmic-id = "b";
-
-               vdd19_pmu_pcie_i:
-               vdd19_pmu_rfa_i:
-               vreg_s1b_wlan:
-               vreg_s1b: smps1 {
-                       regulator-min-microvolt = <1856000>;
-                       regulator-max-microvolt = <2040000>;
-               };
-
-               vdd_pmu_aon_i:
-               vreg_s7b_wlan:
-               vreg_s7b: smps7 {
-                       regulator-min-microvolt = <535000>;
-                       regulator-max-microvolt = <1120000>;
-               };
-
-               vdd13_pmu_pcie_i:
-               vdd13_pmu_rfa_i:
-               vreg_s8b_wlan:
-               vreg_s8b: smps8 {
-                       regulator-min-microvolt = <1256000>;
-                       regulator-max-microvolt = <1500000>;
-               };
-
-               vdda_usb_ss_dp_core:
-               vreg_l1b: ldo1 {
-                       regulator-min-microvolt = <825000>;
-                       regulator-max-microvolt = <925000>;
-                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-               };
-
-               vdda_usb_hs0_3p1:
-               vreg_l2b: ldo2 {
-                       regulator-min-microvolt = <2700000>;
-                       regulator-max-microvolt = <3544000>;
-                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-               };
-
-               pp1200_l6b:
-               vdd_ufs_1p2:
-               vdd_vref:
-               vdda_csi01_1p2:
-               vdda_csi23_1p2:
-               vdda_csi4_1p2:
-               vdda_dsi0_1p2:
-               vdda_pcie0_1p2:
-               vdda_pcie1_1p2:
-               vdda_usb_ss_dp_1p2:
-               vdda_qlink0_1p2_ck:
-               vdda_qlink1_1p2_ck:
-               vreg_l6b_1p2:
-               vreg_l6b: ldo6 {
-                       regulator-min-microvolt = <1120000>;
-                       regulator-max-microvolt = <1408000>;
-                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-               };
-
-               pp2950_l7b:
-               vreg_l7b: ldo7 {
-                       regulator-min-microvolt = <2960000>;
-                       regulator-max-microvolt = <2960000>;
-                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-               };
-
-               codec_vcc:
-               pp1800_l18b_s0:
-               pp1800_ts:
-               vdd1:
-               vddpx_0:
-               vddpx_3:
-               vddpx_7:
-               vreg_l18b: ldo18 {
-                       regulator-min-microvolt = <1800000>;
-                       regulator-max-microvolt = <2000000>;
-                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-               };
-
-               pp1800_l19b:
-               vddpx_ts:
-               vddpx_wl4otp:
-               vreg_l19b: ldo19 {
-                       regulator-min-microvolt = <1800000>;
-                       regulator-max-microvolt = <1800000>;
-                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-               };
-       };
-
-       pm8350c-regulators {
-               compatible = "qcom,pm8350c-rpmh-regulators";
-               qcom,pmic-id = "c";
-
-               vreg_s1c: smps1 {
-                       regulator-min-microvolt = <2190000>;
-                       regulator-max-microvolt = <2210000>;
-               };
+/*
+ * BOARD-LOCAL NAMES FOR REGULATORS THAT CONNECT TO QCARD
+ *
+ * Names are only listed here if regulators go somewhere other than a
+ * testpoint.
+ */
 
-               vddpx_1:
-               vreg_s9c: smps9 {
-                       regulator-min-microvolt = <1010000>;
-                       regulator-max-microvolt = <1170000>;
-               };
+/* From Qcard to our board; ordered by PMIC-ID / rail number */
 
-               pp1800_l1c:
-               pp1800_pen:
-               vdd_a_gfx_cs_1p1:
-               vdd_a_cxo_1p8:
-               vdd_qfprom:
-               vdda_apc_cs_1p8:
-               vdda_qrefs_1p8:
-               vdda_turing_q6_cs_1p8:
-               vdda_usb_hs0_1p8:
-               vreg_l1c: ldo1 {
-                       regulator-min-microvolt = <1800000>;
-                       regulator-max-microvolt = <1980000>;
-                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-               };
+pp1256_s8b: &vreg_s8b_1p256 {};
 
-               dmic_vdd:
-               pp1800_alc5682:
-               pp1800_l2c:
-               pp1800_vreg_alc5682:
-               vreg_l2c: ldo2 {
-                       regulator-min-microvolt = <1620000>;
-                       regulator-max-microvolt = <1980000>;
-                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-               };
+pp1800_l18b_s0: &vreg_l18b_1p8 {};
+pp1800_l18b:    &vreg_l18b_1p8 {};
 
-               pp3300_sar:
-               pp3300_sensor:
-               vreg_l3c: ldo3 {
-                       regulator-min-microvolt = <2800000>;
-                       regulator-max-microvolt = <3540000>;
-                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-               };
+vreg_l19b_s0: &vreg_l19b_1p8 {};
 
-               ppvar_uim1:
-               vddpx_5:
-               vreg_l4c: ldo4 {
-                       regulator-min-microvolt = <1620000>;
-                       regulator-max-microvolt = <3300000>;
-                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-               };
+pp1800_alc5682: &vreg_l2c_1p8 {};
+pp1800_l2c:     &vreg_l2c_1p8 {};
 
-               pp2950_l5c:
-               uim_vcc:
-               vddpx_6:
-               vreg_l5c: ldo5 {
-                       regulator-min-microvolt = <1620000>;
-                       regulator-max-microvolt = <3300000>;
-                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-               };
+vreg_l4c: &vreg_l4c_1p8_3p0 {};
 
-               ppvar_l6c:
-               vddpx_2:
-               vreg_l6c: ldo6 {
-                       regulator-min-microvolt = <1800000>;
-                       regulator-max-microvolt = <2950000>;
-                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-               };
+ppvar_l6c: &vreg_l6c_2p96 {};
 
-               vreg_l7c: ldo7 {
-                       regulator-min-microvolt = <3000000>;
-                       regulator-max-microvolt = <3544000>;
-                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-               };
+pp3000_l7c: &vreg_l7c_3p0 {};
 
-               pp1800_prox:
-               pp1800_sar:
-               vreg_l8c: ldo8 {
-                       regulator-min-microvolt = <1620000>;
-                       regulator-max-microvolt = <2000000>;
-                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-               };
+pp1800_prox: &vreg_l8c_1p8 {};
+pp1800_l8c:  &vreg_l8c_1p8 {};
 
-               pp2950_l9c:
-               vreg_l9c: ldo9 {
-                       regulator-min-microvolt = <2960000>;
-                       regulator-max-microvolt = <2960000>;
-                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-               };
+pp2950_l9c: &vreg_l9c_2p96 {};
 
-               vdd_a_gnss_0p9:
-               vdd_ufs_core:
-               vdd_usb_hs0_core:
-               vdd_vref_0p9:
-               vdda_csi01_0p9:
-               vdda_csi23_0p9:
-               vdda_csi4_0p9:
-               vdda_dsi0_pll_0p9:
-               vdda_dsi0_0p9:
-               vdda_pcie0_core:
-               vdda_pcie1_core:
-               vdda_qlink0_0p9:
-               vdda_qlink1_0p9:
-               vdda_qlink0_0p9_ck:
-               vdda_qlink1_0p9_ck:
-               vdda_qrefs_0p875:
-               vreg_l10c_0p8:
-               vreg_l10c: ldo10 {
-                       regulator-min-microvolt = <720000>;
-                       regulator-max-microvolt = <1050000>;
-                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-               };
+pp1800_lcm:  &vreg_l12c_1p8 {};
+pp1800_mipi: &vreg_l12c_1p8 {};
+pp1800_l12c: &vreg_l12c_1p8 {};
 
-               pp2800_l11c:
-               vreg_l11c: ldo11 {
-                       regulator-min-microvolt = <2800000>;
-                       regulator-max-microvolt = <3544000>;
-                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-               };
+pp3300_lcm:  &vreg_l13c_3p0 {};
+pp3300_mipi: &vreg_l13c_3p0 {};
+pp3300_l13c: &vreg_l13c_3p0 {};
 
-               pp1800_l12c:
-               vreg_l12c: ldo12 {
-                       regulator-min-microvolt = <1650000>;
-                       regulator-max-microvolt = <2000000>;
-                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-               };
+/* From our board to Qcard; ordered same as node definition above */
 
-               pp3300_l13c:
-               vreg_l13c: ldo13 {
-                       regulator-min-microvolt = <2700000>;
-                       regulator-max-microvolt = <3544000>;
-                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-               };
+vreg_edp_bl: &ppvar_sys {};
 
-               vreg_bob: bob {
-                       regulator-min-microvolt = <3008000>;
-                       regulator-max-microvolt = <3960000>;
-                       regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
-               };
-       };
-};
-
-ap_tp_i2c: &i2c1 {
-       status = "okay";
-       clock-frequency = <400000>;
-
-       trackpad: trackpad@15 {
-               compatible = "elan,ekth3000";
-               reg = <0x15>;
-               pinctrl-names = "default";
-               pinctrl-0 = <&tp_int_odl>;
-
-               interrupt-parent = <&tlmm>;
-               interrupts = <102 IRQ_TYPE_EDGE_FALLING>;
+ts_avdd:      &pp3300_left_in_mlb {};
+vreg_edp_3p3: &pp3300_left_in_mlb {};
 
-               vcc-supply = <&pp3300_z1>;
+/* ADDITIONS TO NODES DEFINED IN PARENT DEVICE TREE FILES */
 
-               wakeup-source;
-       };
-};
-
-ap_h1_i2c: &i2c12 {
+ap_i2c_tpm: &i2c14 {
        status = "okay";
        clock-frequency = <400000>;
 
@@ -650,82 +350,26 @@ ap_h1_i2c: &i2c12 {
                reg = <0x50>;
 
                pinctrl-names = "default";
-               pinctrl-0 = <&h1_ap_int_odl>;
-
-               interrupt-parent = <&tlmm>;
-               interrupts = <54 IRQ_TYPE_EDGE_RISING>;
-       };
-};
-
-ap_ts_pen: &i2c13 {
-       status = "okay";
-       clock-frequency = <400000>;
-
-       ap_ts: touchscreen@10 {
-               compatible = "hid-over-i2c";
-               reg = <0x10>;
-               pinctrl-names = "default";
-               pinctrl-0 = <&ts_int_l>, <&ts_reset_l>;
+               pinctrl-0 = <&gsc_ap_int_odl>;
 
                interrupt-parent = <&tlmm>;
-               interrupts = <81 IRQ_TYPE_LEVEL_LOW>;
-
-               post-power-on-delay-ms = <20>;
-               hid-descr-addr = <0x0001>;
-
-               vdd-supply = <&pp3300_ts>;
+               interrupts = <104 IRQ_TYPE_EDGE_RISING>;
        };
 };
 
-&pm7325_gpios {
-       status = "disabled"; /* No GPIOs are connected */
-};
-
-&pmk8350_gpios {
-       status = "disabled"; /* No GPIOs are connected */
-};
+/* NVMe drive, enabled on a per-board basis */
+&pcie1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pcie1_clkreq_n>, <&ssd_rst_l>, <&pe_wake_odl>;
 
-&pmk8350_pon {
-       status = "disabled";
+       perst-gpio = <&tlmm 2 GPIO_ACTIVE_LOW>;
+       vddpe-3v3-supply = <&pp3300_ssd>;
 };
 
 &pmk8350_rtc {
        status = "disabled";
 };
 
-&pmk8350_vadc {
-       pmk8350_die_temp {
-               reg = <PMK8350_ADC7_DIE_TEMP>;
-               label = "pmk8350_die_temp";
-               qcom,pre-scaling = <1 1>;
-       };
-
-       pmr735a_die_temp {
-               reg = <PMR735A_ADC7_DIE_TEMP>;
-               label = "pmr735a_die_temp";
-               qcom,pre-scaling = <1 1>;
-       };
-};
-
-&qfprom {
-       vcc-supply = <&vdd_qfprom>;
-};
-
-&qspi {
-       status = "okay";
-       pinctrl-names = "default";
-       pinctrl-0 = <&qspi_clk>, <&qspi_cs0>, <&qspi_data01>;
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-
-               spi-max-frequency = <37500000>;
-               spi-tx-bus-width = <2>;
-               spi-rx-bus-width = <2>;
-       };
-};
-
 &qupv3_id_0 {
        status = "okay";
 };
@@ -734,44 +378,50 @@ ap_ts_pen: &i2c13 {
        status = "okay";
 };
 
-&sdhc_1 {
-       status = "okay";
-
-       pinctrl-names = "default", "sleep";
-       pinctrl-0 = <&sdc1_on>;
-       pinctrl-1 = <&sdc1_off>;
-       vmmc-supply = <&pp2950_l7b>;
-       vqmmc-supply = <&pp1800_l19b>;
-};
-
+/* SD Card, enabled on a per-board basis */
 &sdhc_2 {
-       status = "okay";
+       pinctrl-0 = <&sdc2_clk>, <&sdc2_cmd>, <&sdc2_data>, <&sd_cd_odl>;
+       pinctrl-1 = <&sdc2_clk_sleep>, <&sdc2_cmd_sleep>, <&sdc2_data_sleep>, <&sd_cd_odl>;
 
-       pinctrl-names = "default", "sleep";
-       pinctrl-0 = <&sdc2_on>;
-       pinctrl-1 = <&sdc2_off>;
        vmmc-supply = <&pp2950_l9c>;
        vqmmc-supply = <&ppvar_l6c>;
 
        cd-gpios = <&tlmm 91 GPIO_ACTIVE_LOW>;
 };
 
-ap_ec_spi: &spi8 {
+/* Fingerprint, enabled on a per-board basis */
+ap_spi_fp: &spi9 {
+       pinctrl-0 = <&qup_spi9_data_clk>, <&qup_spi9_cs_gpio_init_high>, <&qup_spi9_cs_gpio>;
+
+       cs-gpios = <&tlmm 39 GPIO_ACTIVE_LOW>;
+
+       cros_ec_fp: ec@0 {
+               compatible = "google,cros-ec-spi";
+               reg = <0>;
+               interrupt-parent = <&tlmm>;
+               interrupts = <61 IRQ_TYPE_LEVEL_LOW>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&fp_to_ap_irq_l>, <&fp_rst_l>, <&fpmcu_boot0>;
+               spi-max-frequency = <3000000>;
+       };
+};
+
+ap_ec_spi: &spi10 {
        status = "okay";
+       pinctrl-0 = <&qup_spi10_data_clk>, <&qup_spi10_cs_gpio_init_high>, <&qup_spi10_cs_gpio>;
 
-       pinctrl-0 = <&qup_spi8_data_clk>, <&qup_spi8_cs_gpio_init_high>, <&qup_spi8_cs_gpio>;
-       cs-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
+       cs-gpios = <&tlmm 43 GPIO_ACTIVE_LOW>;
 
        cros_ec: ec@0 {
                compatible = "google,cros-ec-spi";
                reg = <0>;
                interrupt-parent = <&tlmm>;
-               interrupts = <142 IRQ_TYPE_LEVEL_LOW>;
+               interrupts = <18 IRQ_TYPE_LEVEL_LOW>;
                pinctrl-names = "default";
                pinctrl-0 = <&ap_ec_int_l>;
                spi-max-frequency = <3000000>;
 
-               cros_ec_pwm: ec-pwm {
+               cros_ec_pwm: pwm {
                        compatible = "google,cros-ec-pwm";
                        #pwm-cells = <1>;
                };
@@ -841,15 +491,6 @@ ap_ec_spi: &spi8 {
        >;
 };
 
-&uart5 {
-       compatible = "qcom,geni-debug-uart";
-       status = "okay";
-};
-
-&uart7 {
-       status = "okay";
-};
-
 &usb_1 {
        status = "okay";
 };
@@ -860,17 +501,10 @@ ap_ec_spi: &spi8 {
 
 &usb_1_hsphy {
        status = "okay";
-
-       vdda-pll-supply = <&vdd_usb_hs0_core>;
-       vdda33-supply = <&vdda_usb_hs0_3p1>;
-       vdda18-supply = <&vdda_usb_hs0_1p8>;
 };
 
 &usb_1_qmpphy {
        status = "okay";
-
-       vdda-phy-supply = <&vdda_usb_ss_dp_1p2>;
-       vdda-pll-supply = <&vdda_usb_ss_dp_core>;
 };
 
 &usb_2 {
@@ -883,530 +517,269 @@ ap_ec_spi: &spi8 {
 
 &usb_2_hsphy {
        status = "okay";
+};
+
+/* PINCTRL - ADDITIONS TO NODES IN PARENT DEVICE TREE FILES */
 
-       vdda-pll-supply = <&vdd_usb_hs0_core>;
-       vdda33-supply = <&vdda_usb_hs0_3p1>;
-       vdda18-supply = <&vdda_usb_hs0_1p8>;
+&dp_hot_plug_det {
+       bias-disable;
 };
 
-/* PINCTRL - additions to nodes defined in sc7280.dtsi */
+&pcie1_clkreq_n {
+       bias-pull-up;
+       drive-strength = <2>;
+};
 
 &qspi_cs0 {
        bias-disable;
+       drive-strength = <8>;
 };
 
 &qspi_clk {
        bias-disable;
+       drive-strength = <8>;
 };
 
 &qspi_data01 {
        /* High-Z when no transfers; nice to park the lines */
        bias-pull-up;
+       drive-strength = <8>;
 };
 
-&qup_uart5_rx {
+/* For ap_tp_i2c */
+&qup_i2c0_data_clk {
+       /* Has external pull */
+       bias-disable;
        drive-strength = <2>;
-       bias-pull-up;
 };
 
-&qup_uart5_tx {
-       drive-strength = <2>;
+/* For ap_i2c_tpm */
+&qup_i2c14_data_clk {
+       /* Has external pull */
        bias-disable;
+       drive-strength = <2>;
 };
 
-&qup_uart7_cts {
-       /*
-        * Configure a pull-down on CTS to match the pull of
-        * the Bluetooth module.
-        */
-       bias-pull-down;
+/* For ap_spi_fp */
+&qup_spi9_data_clk {
+       bias-disable;
+       drive-strength = <2>;
 };
 
-&qup_uart7_rts {
-       /* We'll drive RTS, so no pull */
-       drive-strength = <2>;
+/* For ap_spi_fp */
+&qup_spi9_cs_gpio {
        bias-disable;
+       drive-strength = <2>;
 };
 
-&qup_uart7_tx {
-       /* We'll drive TX, so no pull */
+/* For ap_ec_spi */
+&qup_spi10_data_clk {
+       bias-disable;
        drive-strength = <2>;
+};
+
+/* For ap_ec_spi */
+&qup_spi10_cs_gpio {
        bias-disable;
+       drive-strength = <2>;
 };
 
-&qup_uart7_rx {
-       /*
-        * Configure a pull-up on RX. This is needed to avoid
-        * garbage data when the TX pin of the Bluetooth module is
-        * in tri-state (module powered off or not driving the
-        * signal yet).
-        */
+/* For uart_dbg */
+&qup_uart5_rx {
        bias-pull-up;
 };
 
-&sdc1_on {
-       clk {
-               bias-disable;
-               drive-strength = <16>;
-       };
-
-       cmd {
-               bias-pull-up;
-               drive-strength = <10>;
-       };
-
-       data {
-               bias-pull-up;
-               drive-strength = <10>;
-       };
-
-       rclk {
-               bias-pull-down;
-       };
+/* For uart_dbg */
+&qup_uart5_tx {
+       bias-disable;
+       drive-strength = <2>;
 };
 
-&sdc2_on {
-       clk {
-               bias-disable;
-               drive-strength = <16>;
-       };
-
-       cmd {
-               bias-pull-up;
-               drive-strength = <10>;
-       };
+&sdc2_clk {
+       bias-disable;
+       drive-strength = <16>;
+};
 
-       data {
-               bias-pull-up;
-               drive-strength = <10>;
-       };
+&sdc2_cmd {
+       bias-pull-up;
+       drive-strength = <10>;
+};
 
-       sd-cd {
-               pins = "gpio91";
-               bias-pull-up;
-       };
+&sdc2_data {
+       bias-pull-up;
+       drive-strength = <10>;
 };
 
 /* PINCTRL - board-specific pinctrl */
 
-&pm8350c_gpios {
-       gpio-line-names = "AP_SUSPEND",
-                         "",
-                         "",
-                         "AP_BL_EN",
-                         "",
-                         "SD_CD_ODL",
-                         "",
-                         "",
-                         "AP_BL_PWM";
-
-       ap_bl_en: ap-bl-en {
-               pins = "gpio4";
-               function = "normal";
-               qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
-               bias-disable;
+&pm7325_gpios {
+       /*
+        * On a quick glance it might look like KYPD_VOL_UP_N is used, but
+        * that only passes through to a debug connector and not to the actual
+        * volume up key.
+        */
+       status = "disabled"; /* No GPIOs are connected */
+};
 
-               /* Force backlight to be disabled to match state at boot. */
-               output-low;
-       };
+&pmk8350_gpios {
+       status = "disabled"; /* No GPIOs are connected */
 };
 
 &tlmm {
-       gpio-line-names = "HP_I2C_SDA",                 /* 0 */
-                         "HP_I2C_SCL",
-                         "SSD_RST_L",
-                         "PE_WAKE_ODL",
-                         "AP_TP_I2C_SDA",
-                         "AP_TP_I2C_SCL",
-                         "UF_CAM_EN",
-                         "WF_CAM_EN",
-                         "AP_SAR_SENSOR_SDA",
-                         "AP_SAR_SENSOR_SCL",
-
-                         "",                           /* 10 */
-                         "",
-                         "AP_SPI_MOSI",
-                         "AP_SPI_MISO",
-                         "AP_SPI_CLK",
-                         "AP_SPI_CS0_L",
-                         "",
-                         "",
-                         "EDP_HPD",
-                         "",
-
-                         "UF_CAM_RST_L",               /* 20 */
-                         "WF_CAM_RST_L",
-                         "UART_AP_TX_DBG_RX",
-                         "UART_DBG_TX_AP_RX",
-                         "EN_PP3300_HUB",
-                         "",
-                         "HOST2WLAN_SOL",
-                         "WLAN2HOST_SOL",
-                         "BT_UART_CTS",
-                         "BT_UART_RTS",
-
-                         "BT_UART_TXD",                /* 30 */
-                         "BT_UART_RXD",
-                         "AP_EC_SPI_MISO",
-                         "AP_EC_SPI_MOSI",
-                         "AP_EC_SPI_CLK",
-                         "AP_EC_SPI_CS_L",
-                         "",
-                         "",
-                         "",
-                         "PEN_PDCT_L",
-
-                         "IO_BRD_ID0",                 /* 40 */
-                         "IO_BRD_ID1",
-                         "EN_FP_RAILS",
-                         "PEN_IRQ_L",
-                         "AP_SPI_FP_MISO",
-                         "AP_SPI_FP_MOSI",
-                         "AP_SPI_FP_CLK",
-                         "AP_SPI_FP_CS_L",
-                         "AP_H1_SPI_MISO",
-                         "AP_H1_SPI_MOSI",
-
-                         "AP_H1_SPI_CLK",              /* 50 */
-                         "AP_H1_SPI_CS_L",
-                         "AP_TS_PEN_I2C_SDA",
-                         "AP_TS_PEN_I2C_SCL",
-                         "H1_AP_INT_ODL",
-                         "",
-                         "LCM_RST_1V8_L",
-                         "AMP_EN",
-                         "",
-                         "DP_HOT_PLUG_DET",
-
-                         "HUB_RST_L",                  /* 60 */
-                         "FP_TO_AP_IRQ_L",
-                         "",
-                         "",
-                         "UF_CAM_MCLK",
-                         "WF_CAM_MCLK",
-                         "IO_BRD_ID2",
-                         "EN_PP3300_CODEC",
-                         "EC_IN_RW_ODL",
-                         "UF_CAM_SDA",
-
-                         "UF_CAM_SCL",                 /* 70 */
-                         "WF_CAM_SDA",
-                         "WF_CAM_SCL",
-                         "AP_BRD_ID0",
-                         "AP_BRD_ID1",
-                         "AP_BRD_ID2",
-                         "",
-                         "FPMCU_BOOT0",
-                         "FP_RST_L",
-                         "PE_CLKREQ_ODL",
-
-                         "EN_EDP_PP3300",              /* 80 */
-                         "TS_INT_L",
-                         "FORCE_USB_BOOT",
-                         "WCD_RST_L",
-                         "WLAN_EN",
-                         "BT_EN",
-                         "WLAN_SW_CTRL",
-                         "PCIE0_RESET_L",
-                         "PCIE0_CLK_REQ_L",
-                         "PCIE0_WAKE_L",
-
-                         "AS_EN",                      /* 90 */
-                         "SD_CD_ODL",
-                         "",
-                         /*
-                          * AP_FLASH_WP_L is crossystem ABI. Schematics
-                          * call it BIOS_FLASH_WP_L.
-                          */
-                         "AP_FLASH_WP_L",
-                         "BT_WLAN_SB_CLK",
-                         "BT_WLAN_SB_DATA",
-                         "HP_MCLK",
-                         "HP_BCLK",
-                         "HP_DOUT",
-                         "HP_DIN",
-
-                         "HP_LRCLK",                   /* 100 */
-                         "HP_IRQ",
-                         "TP_INT_ODL",
-                         "",
-                         "IO_SKU_ID2",
-                         "TS_RESET_L",
-                         "AMP_BCLK",
-                         "AMP_DIN",
-                         "AMP_LRCLK",
-                         "UIM2_DATA",
-
-                         "UIM2_CLK",                   /* 110 */
-                         "UIM2_RST",
-                         "UIM2_PRESENT",
-                         "UIM1_DATA",
-                         "UIM1_CLK",
-                         "UIM1_RST",
-                         "",
-                         "RFFE0_CLK",
-                         "RFFE0_DATA/BOOT_CONFIG_0",
-                         "RFFE1_CLK",
-
-                         "RFFE1_DATA/BOOT_CONFIG_1",   /* 120 */
-                         "RFFE2_CLK",
-                         "RFFE2_DATA/BOOT_CONFIG_2",
-                         "RFFE3_CLK",
-                         "RFFE3_DATA/BOOT_CONFIG_3",
-                         "RFFE4_CLK",
-                         "RFFE4_DATA",
-                         "WCI2_LTE_COEX_RXD",
-                         "WCI2_LTE_COEX_TXD",
-                         "IO_SKU_ID0",
-
-                         "IO_SKU_ID1",                 /* 130 */
-                         "",
-                         "",
-                         "QLINK0_REQ",
-                         "QLINK0_EN",
-                         "QLINK0_WMSS_RESET_L",
-                         "QLINK1_REQ",
-                         "QLINK1_EN",
-                         "QLINK1_WMSS_RESET_L",
-                         "FORCED_USB_BOOT_POL",
-
-                         "",                           /* 140 */
-                         "P_SENSOR_INT_L",
-                         "AP_EC_INT_L",
-                         "",
-                         "WCD_SWR_TX_CLK",
-                         "WCD_SWR_TX_DATA_0",
-                         "WCD_SWR_TX_DATA_1",
-                         "WCD_SWR_RX_CLK",
-                         "WCD_SWR_RX_DATA_0",
-                         "WCD_SWR_RX_DATA_1",
-
-                         "",                           /* 150 */
-                         "",
-                         "",
-                         "",
-                         "",
-                         "",
-                         "",
-                         "",
-                         "WCD_SWR_TX_DATA_2",
-                         "",
-
-                         "",                           /* 160 */
-                         "",
-                         "",
-                         "",
-                         "",
-                         "",
-                         "",
-                         "",
-                         "",
-                         "",
-
-                         "",                           /* 170 */
-                         "SENS_UART_TXD",
-                         "SENS_UART_RXD",
-                         "",
-                         "",
-                         "";
-
-       /*
-        * pinctrl settings for pins that have no real owners.
-        */
+       /* pinctrl settings for pins that have no real owners. */
        pinctrl-names = "default";
-       pinctrl-0 = <&bios_flash_wp_l>;
+       pinctrl-0 = <&bios_flash_wp_od>;
 
        amp_en: amp-en {
-               pins = "gpio57";
+               pins = "gpio63";
                function = "gpio";
-               bias-pull-down;
+               bias-disable;
+               drive-strength = <2>;
        };
 
        ap_ec_int_l: ap-ec-int-l {
-               pins = "gpio142";
-               input-enable;
+               pins = "gpio18";
+               function = "gpio";
                bias-pull-up;
        };
 
-       bios_flash_wp_l: bios-flash-wp-l {
-               pins = "gpio93";
+       bios_flash_wp_od: bios-flash-wp-od {
+               pins = "gpio16";
                function = "gpio";
-               input-enable;
+               /* Has external pull */
                bias-disable;
        };
 
-       bt_en: bt-en {
-               pins = "gpio85";
-               function = "gpio";
-               drive-strength = <2>;
-               output-low;
-               bias-pull-down;
-       };
-
        en_fp_rails: en-fp-rails {
-               pins = "gpio42";
+               pins = "gpio77";
+               function = "gpio";
+               bias-disable;
                drive-strength = <2>;
                output-high;
-               bias-disable;
        };
 
        en_pp3300_codec: en-pp3300-codec {
-               pins = "gpio67";
-               drive-strength = <2>;
+               pins = "gpio105";
+               function = "gpio";
                bias-disable;
+               drive-strength = <2>;
        };
 
        en_pp3300_dx_edp: en-pp3300-dx-edp {
                pins = "gpio80";
                function = "gpio";
-               drive-strength = <2>;
-               /* Has external pulldown */
                bias-disable;
+               drive-strength = <2>;
        };
 
-       en_pp3300_hub: en-pp3300-hub {
-               pins = "gpio24";
+       fp_rst_l: fp-rst-l {
+               pins = "gpio78";
                function = "gpio";
-               drive-strength = <2>;
-               /* Has external pulldown */
                bias-disable;
+               drive-strength = <2>;
+               output-high;
        };
 
        fp_to_ap_irq_l: fp-to-ap-irq-l {
                pins = "gpio61";
                function = "gpio";
-               input-enable;
                /* Has external pullup */
                bias-disable;
        };
 
-       h1_ap_int_odl: h1-ap-int-odl {
-               pins = "gpio54";
+       fpmcu_boot0: fpmcu-boot0 {
+               pins = "gpio68";
                function = "gpio";
-               input-enable;
-               bias-pull-up;
+               bias-disable;
+               output-low;
        };
 
-       hp_irq: hp-irq {
-               pins = "gpio101";
+       gsc_ap_int_odl: gsc-ap-int-odl {
+               pins = "gpio104";
                function = "gpio";
                bias-pull-up;
        };
 
-       p_sensor_int_l: p-sensor-int-l {
-               pins = "gpio141";
+       hp_irq: hp-irq {
+               pins = "gpio101";
                function = "gpio";
-               input-enable;
                bias-pull-up;
        };
 
-       pen_irq_l: pen-irq-l {
-               pins = "gpio43";
+       hub_en: hub-en {
+               pins = "gpio157";
                function = "gpio";
-               /* Has external pullup */
                bias-disable;
+               drive-strength = <2>;
        };
 
-       pen_pdct_l: pen-pdct-l {
-               pins = "gpio39";
+       pe_wake_odl: pe-wake-odl {
+               pins = "gpio3";
                function = "gpio";
-               /* Has external pullup */
+               /* Has external pull */
                bias-disable;
+               drive-strength = <2>;
        };
 
-       qup_spi8_cs_gpio_init_high: qup-spi8-cs-gpio-init-high {
-               pins = "gpio35";
-               output-high;
-       };
-
-       qup_spi11_cs_gpio_init_high: qup-spi11-cs-gpio-init-high {
-               pins = "gpio47";
-               output-high;
-       };
-
-       qup_spi12_cs_gpio_init_high: qup-spi12-cs-gpio-init-high {
-               pins = "gpio51";
+       /* For ap_spi_fp */
+       qup_spi9_cs_gpio_init_high: qup-spi9-cs-gpio-init-high {
+               pins = "gpio39";
+               function = "gpio";
                output-high;
        };
 
-       qup_uart7_sleep_cts: qup-uart7-sleep-cts {
-               pins = "gpio28";
+       /* For ap_ec_spi */
+       qup_spi10_cs_gpio_init_high: qup-spi10-cs-gpio-init-high {
+               pins = "gpio43";
                function = "gpio";
-               /*
-                * Configure a pull-down on CTS to match the pull of
-                * the Bluetooth module.
-                */
-               bias-pull-down;
+               output-high;
        };
 
-       qup_uart7_sleep_rts: qup-uart7-sleep-rts {
-               pins = "gpio29";
+       sar0_irq_odl: sar0-irq-odl {
+               pins = "gpio141";
                function = "gpio";
-               /*
-                * Configure pull-down on RTS. As RTS is active low
-                * signal, pull it low to indicate the BT SoC that it
-                * can wakeup the system anytime from suspend state by
-                * pulling RX low (by sending wakeup bytes).
-                */
-               bias-pull-down;
+               bias-pull-up;
        };
 
-       qup_uart7_sleep_rx: qup-uart7-sleep-rx {
-               pins = "gpio31";
+       sar1_irq_odl: sar0-irq-odl {
+               pins = "gpio140";
                function = "gpio";
-               /*
-                * Configure a pull-up on RX. This is needed to avoid
-                * garbage data when the TX pin of the Bluetooth module
-                * is floating which may cause spurious wakeups.
-                */
                bias-pull-up;
        };
 
-       qup_uart7_sleep_tx: qup-uart7-sleep-tx {
-               pins = "gpio30";
+       sd_cd_odl: sd-cd-odl {
+               pins = "gpio91";
                function = "gpio";
-               /*
-                * Configure pull-up on TX when it isn't actively driven
-                * to prevent BT SoC from receiving garbage during sleep.
-                */
                bias-pull-up;
        };
 
-       tp_int_odl: tp-int-odl {
-               pins = "gpio102";
+       ssd_en: ssd-en {
+               pins = "gpio51";
                function = "gpio";
-               /* Has external pullup */
                bias-disable;
+               drive-strength = <2>;
        };
 
-       ts_int_l: ts-int-l {
-               pins = "gpio81";
-               function = "gpio";
-               /* Has external pullup */
-               bias-pull-up;
-       };
-
-       ts_reset_l: ts-reset-l {
-               pins = "gpio105";
+       ssd_rst_l: ssd-rst-l {
+               pins = "gpio2";
                function = "gpio";
-               /* Has external pullup */
                bias-disable;
                drive-strength = <2>;
+               output-low;
        };
 
-       uf_cam_en: uf-cam-en {
-               pins = "gpio6";
+       tp_int_odl: tp-int-odl {
+               pins = "gpio7";
                function = "gpio";
-               drive-strength = <2>;
-               /* Has external pulldown */
+               /* Has external pullup */
                bias-disable;
        };
 
        wf_cam_en: wf-cam-en {
-               pins = "gpio7";
+               pins = "gpio119";
                function = "gpio";
-               drive-strength = <2>;
                /* Has external pulldown */
                bias-disable;
+               drive-strength = <2>;
        };
 };
index 0896a61..a7c346a 100644 (file)
@@ -20,7 +20,7 @@ ap_ec_spi: &spi10 {
                pinctrl-0 = <&ap_ec_int_l>;
                spi-max-frequency = <3000000>;
 
-               cros_ec_pwm: ec-pwm {
+               cros_ec_pwm: pwm {
                        compatible = "google,cros-ec-pwm";
                        #pwm-cells = <1>;
                };
index 9b991ba..a7be133 100644 (file)
        };
 };
 
+&bluetooth {
+       vddio-supply = <&vreg_l19b_1p8>;
+};
+
 &ipa {
        status = "okay";
        modem-init;
                qcom,pre-scaling = <1 1>;
        };
 };
+
+&usb_2 {
+       status = "okay";
+};
+
+&usb_2_dwc3 {
+       dr_mode = "host";
+};
+
+&usb_2_hsphy {
+       status = "okay";
+
+       vdda-pll-supply = <&vreg_l10c_0p8>;
+       vdda33-supply = <&vreg_l2b_3p0>;
+       vdda18-supply = <&vreg_l1c_1p8>;
+};
index d623d71..ecbf2b8 100644 (file)
@@ -5,7 +5,6 @@
  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
  */
 
-#include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/iio/qcom,spmi-adc7-pmk8350.h>
 #include <dt-bindings/input/linux-event-codes.h>
 #include "sc7280.dtsi"
 #include "pm8350c.dtsi"
 #include "pmk8350.dtsi"
 
+#include "sc7280-chrome-common.dtsi"
+
 / {
+       aliases {
+               bluetooth0 = &bluetooth;
+               serial1 = &uart7;
+       };
+
        gpio-keys {
                compatible = "gpio-keys";
                label = "gpio-keys";
        };
 };
 
-/*
- * Reserved memory changes
- *
- * Delete all unused memory nodes and define the peripheral memory regions
- * required by the board dts.
- *
- */
-
-/delete-node/ &hyp_mem;
-/delete-node/ &xbl_mem;
-/delete-node/ &reserved_xbl_uefi_log;
-/delete-node/ &sec_apps_mem;
-
-/* Increase the size from 2.5MB to 8MB */
-&rmtfs_mem {
-       reg = <0x0 0x9c900000 0x0 0x800000>;
-};
-
-/ {
-       reserved-memory {
-               adsp_mem: memory@86700000 {
-                       reg = <0x0 0x86700000 0x0 0x2800000>;
-                       no-map;
-               };
-
-               camera_mem: memory@8ad00000 {
-                       reg = <0x0 0x8ad00000 0x0 0x500000>;
-                       no-map;
-               };
-
-               venus_mem: memory@8b200000 {
-                       reg = <0x0 0x8b200000 0x0 0x500000>;
-                       no-map;
-               };
-
-               mpss_mem: memory@8b800000 {
-                       reg = <0x0 0x8b800000 0x0 0xf600000>;
-                       no-map;
-               };
-
-               wpss_mem: memory@9ae00000 {
-                       reg = <0x0 0x9ae00000 0x0 0x1900000>;
-                       no-map;
-               };
-
-               mba_mem: memory@9c700000 {
-                       reg = <0x0 0x9c700000 0x0 0x200000>;
-                       no-map;
-               };
-       };
-};
-
 &apps_rsc {
        pm7325-regulators {
                compatible = "qcom,pm7325-rpmh-regulators";
        vcc-supply = <&vreg_l1c_1p8>;
 };
 
-&qspi {
-       status = "okay";
-       pinctrl-names = "default";
-       pinctrl-0 = <&qspi_clk>, <&qspi_cs0>, <&qspi_data01>;
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <37500000>;
-               spi-tx-bus-width = <2>;
-               spi-rx-bus-width = <2>;
-       };
-};
-
 &qupv3_id_0 {
        status = "okay";
 };
        status = "okay";
 };
 
-&remoteproc_mpss {
-       status = "okay";
-       compatible = "qcom,sc7280-mss-pil";
-       iommus = <&apps_smmu 0x124 0x0>, <&apps_smmu 0x488 0x7>;
-       memory-region = <&mba_mem &mpss_mem>;
-};
-
 &sdhc_1 {
        status = "okay";
 
-       pinctrl-names = "default", "sleep";
-       pinctrl-0 = <&sdc1_on>;
-       pinctrl-1 = <&sdc1_off>;
-
        non-removable;
        no-sd;
        no-sdio;
 &sdhc_2 {
        status = "okay";
 
-       pinctrl-names = "default", "sleep";
-       pinctrl-0 = <&sdc2_on>;
-       pinctrl-1 = <&sdc2_off>;
+       pinctrl-0 = <&sdc2_clk>, <&sdc2_cmd>, <&sdc2_data>, <&sd_cd>;
+       pinctrl-1 = <&sdc2_clk_sleep>, <&sdc2_cmd_sleep>, <&sdc2_data_sleep>, <&sd_cd>;
 
        vmmc-supply = <&vreg_l9c_2p9>;
        vqmmc-supply = <&vreg_l6c_2p9>;
        vdda-pll-supply = <&vreg_l1b_0p8>;
 };
 
-&usb_2 {
-       status = "okay";
-};
-
-&usb_2_dwc3 {
-       dr_mode = "peripheral";
-};
-
-&usb_2_hsphy {
-       status = "okay";
-
-       vdda-pll-supply = <&vreg_l10c_0p8>;
-       vdda33-supply = <&vreg_l2b_3p0>;
-       vdda18-supply = <&vreg_l1c_1p8>;
-};
-
 &uart7 {
        status = "okay";
 
                                <&tlmm 31 IRQ_TYPE_EDGE_FALLING>;
        pinctrl-names = "default", "sleep";
        pinctrl-1 = <&qup_uart7_sleep_cts>, <&qup_uart7_sleep_rts>, <&qup_uart7_sleep_tx>, <&qup_uart7_sleep_rx>;
+
+       bluetooth: bluetooth {
+               compatible = "qcom,wcn6750-bt";
+               pinctrl-names = "default";
+               pinctrl-0 = <&bt_en>, <&sw_ctrl>;
+               enable-gpios = <&tlmm 85 GPIO_ACTIVE_HIGH>;
+               swctrl-gpios = <&tlmm 86 GPIO_ACTIVE_HIGH>;
+               vddaon-supply = <&vreg_s7b_0p9>;
+               vddbtcxmx-supply = <&vreg_s7b_0p9>;
+               vddrfacmn-supply = <&vreg_s7b_0p9>;
+               vddrfa0p8-supply = <&vreg_s7b_0p9>;
+               vddrfa1p7-supply = <&vreg_s1b_1p8>;
+               vddrfa1p2-supply = <&vreg_s8b_1p2>;
+               vddrfa2p2-supply = <&vreg_s1c_2p2>;
+               vddasd-supply = <&vreg_l11c_2p8>;
+               max-speed = <3200000>;
+       };
 };
 
 /* PINCTRL - additions to nodes defined in sc7280.dtsi */
 
+&dp_hot_plug_det {
+       bias-disable;
+};
+
 &pm7325_gpios {
        key_vol_up_default: key-vol-up-default {
                pins = "gpio6";
        };
 };
 
+&pcie1_clkreq_n {
+       bias-pull-up;
+       drive-strength = <2>;
+};
+
 &qspi_cs0 {
        bias-disable;
 };
        bias-pull-up;
 };
 
+&sdc1_clk {
+       bias-disable;
+       drive-strength = <16>;
+};
+
+&sdc1_cmd {
+       bias-pull-up;
+       drive-strength = <10>;
+};
+
+&sdc1_data {
+       bias-pull-up;
+       drive-strength = <10>;
+};
+
+&sdc1_rclk {
+       bias-pull-down;
+};
+
+&sdc2_clk {
+       bias-disable;
+       drive-strength = <16>;
+};
+
+&sdc2_cmd {
+       bias-pull-up;
+       drive-strength = <10>;
+};
+
+&sdc2_data {
+       bias-pull-up;
+       drive-strength = <10>;
+};
+
 &tlmm {
+       bt_en: bt-en {
+               pins = "gpio85";
+               function = "gpio";
+               output-low;
+               bias-disable;
+       };
+
        nvme_pwren: nvme-pwren {
                function = "gpio";
        };
                 */
                bias-pull-up;
        };
-};
-
-&sdc1_on {
-       clk {
-               bias-disable;
-               drive-strength = <16>;
-       };
-
-       cmd {
-               bias-pull-up;
-               drive-strength = <10>;
-       };
 
-       data {
+       sd_cd: sd-cd {
+               pins = "gpio91";
+               function = "gpio";
                bias-pull-up;
-               drive-strength = <10>;
        };
 
-       rclk {
+       sw_ctrl: sw-ctrl {
+               pins = "gpio86";
+               function = "gpio";
                bias-pull-down;
        };
 };
 
-&sdc2_on {
-       clk {
-               bias-disable;
-               drive-strength = <16>;
-       };
-
-       cmd {
-               bias-pull-up;
-               drive-strength = <10>;
-       };
-
-       data {
-               bias-pull-up;
-               drive-strength = <10>;
-       };
-
-       sd-cd {
-               pins = "gpio91";
-               bias-pull-up;
-       };
-};
index 0382c77..73b9911 100644 (file)
        };
 };
 
+&bluetooth {
+       vddio-supply = <&vreg_l18b_1p8>;
+};
+
 &nvme_pwren {
        pins = "gpio51";
 };
diff --git a/arch/arm64/boot/dts/qcom/sc7280-qcard.dtsi b/arch/arm64/boot/dts/qcom/sc7280-qcard.dtsi
new file mode 100644 (file)
index 0000000..b833ba1
--- /dev/null
@@ -0,0 +1,547 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * sc7280 Qcard device tree source
+ *
+ * Qcard PCB has the processor, RAM, eMMC (if stuffed), and eDP connector (if
+ * stuffed) on it. This device tree tries to encapsulate all the things that
+ * all boards using Qcard will have in common. Given that there are stuffing
+ * options, some things may be left with status "disabled" and enabled in
+ * the actual board device tree files.
+ *
+ * Copyright 2022 Google LLC.
+ */
+
+#include <dt-bindings/iio/qcom,spmi-adc7-pmk8350.h>
+#include <dt-bindings/iio/qcom,spmi-adc7-pmr735a.h>
+#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
+#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
+
+#include "sc7280.dtsi"
+
+/* PMICs depend on spmi_bus label and so must come after SoC */
+#include "pm7325.dtsi"
+#include "pm8350c.dtsi"
+#include "pmk8350.dtsi"
+
+/ {
+       aliases {
+               bluetooth0 = &bluetooth;
+               serial0 = &uart5;
+               serial1 = &uart7;
+       };
+};
+
+&apps_rsc {
+       /*
+        * Regulators are given labels corresponding to the various names
+        * they are referred to on schematics. They are also given labels
+        * corresponding to named voltage inputs on the SoC or components
+        * bundled with the SoC (like radio companion chips). We totally
+        * ignore it when one regulator is the input to another regulator.
+        * That's handled automatically by the initial config given to
+        * RPMH by the firmware.
+        *
+        * Regulators that the HLOS (High Level OS) doesn't touch at all
+        * are left out of here since they are managed elsewhere.
+        */
+
+       pm7325-regulators {
+               compatible = "qcom,pm7325-rpmh-regulators";
+               qcom,pmic-id = "b";
+
+               vdd19_pmu_pcie_i:
+               vdd19_pmu_rfa_i:
+               vreg_s1b_1p856: smps1 {
+                       regulator-min-microvolt = <1856000>;
+                       regulator-max-microvolt = <2040000>;
+               };
+
+               vdd_pmu_aon_i:
+               vdd09_pmu_rfa_i:
+               vdd095_mx_pmu:
+               vdd095_pmu:
+               vreg_s7b_0p952: smps7 {
+                       regulator-min-microvolt = <535000>;
+                       regulator-max-microvolt = <1120000>;
+               };
+
+               vdd13_pmu_rfa_i:
+               vdd13_pmu_pcie_i:
+               vreg_s8b_1p256: smps8 {
+                       regulator-min-microvolt = <1256000>;
+                       regulator-max-microvolt = <1500000>;
+               };
+
+               vdd_a_usbssdp_0_core:
+               vreg_l1b_0p912: ldo1 {
+                       regulator-min-microvolt = <825000>;
+                       regulator-max-microvolt = <925000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vdd_a_usbhs_3p1:
+               vreg_l2b_3p072: ldo2 {
+                       regulator-min-microvolt = <2700000>;
+                       regulator-max-microvolt = <3544000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vdd_a_csi_0_1_1p2:
+               vdd_a_csi_2_3_1p2:
+               vdd_a_csi_4_1p2:
+               vdd_a_dsi_0_1p2:
+               vdd_a_edp_0_1p2:
+               vdd_a_qlink_0_1p2:
+               vdd_a_qlink_1_1p2:
+               vdd_a_pcie_0_1p2:
+               vdd_a_pcie_1_1p2:
+               vdd_a_ufs_0_1p2:
+               vdd_a_usbssdp_0_1p2:
+               vreg_l6b_1p2: ldo6 {
+                       regulator-min-microvolt = <1140000>;
+                       regulator-max-microvolt = <1260000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               /*
+                * Despite the fact that this is named to be 2.5V on the
+                * schematic, it powers eMMC which doesn't accept 2.5V
+                */
+               vreg_l7b_2p5: ldo7 {
+                       regulator-min-microvolt = <2960000>;
+                       regulator-max-microvolt = <2960000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vdd_px_wcd9385:
+               vdd_txrx:
+               vddpx_0:
+               vddpx_3:
+               vddpx_7:
+               vreg_l18b_1p8: ldo18 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <2000000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vdd_1p8:
+               vdd_px_sdr735:
+               vdd_pxm:
+               vdd18_io:
+               vddio_px_1:
+               vddio_px_2:
+               vddio_px_3:
+               vddpx_ts:
+               vddpx_wl4otp:
+               vreg_l19b_1p8: ldo19 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+       };
+
+       pm8350c-regulators {
+               compatible = "qcom,pm8350c-rpmh-regulators";
+               qcom,pmic-id = "c";
+
+               vdd22_wlbtpa_ch0:
+               vdd22_wlbtpa_ch1:
+               vdd22_wlbtppa_ch0:
+               vdd22_wlbtppa_ch1:
+               vdd22_wlpa5g_ch0:
+               vdd22_wlpa5g_ch1:
+               vdd22_wlppa5g_ch0:
+               vdd22_wlppa5g_ch1:
+               vreg_s1c_2p2: smps1 {
+                       regulator-min-microvolt = <2190000>;
+                       regulator-max-microvolt = <2210000>;
+               };
+
+               lp4_vdd2_1p052:
+               vreg_s9c_0p676: smps9 {
+                       regulator-min-microvolt = <1010000>;
+                       regulator-max-microvolt = <1170000>;
+               };
+
+               vdda_apc_cs_1p8:
+               vdda_gfx_cs_1p8:
+               vdda_turing_q6_cs_1p8:
+               vdd_a_cxo_1p8:
+               vdd_a_qrefs_1p8:
+               vdd_a_usbhs_1p8:
+               vdd_qfprom:
+               vreg_l1c_1p8: ldo1 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1980000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l2c_1p8: ldo2 {
+                       regulator-min-microvolt = <1620000>;
+                       regulator-max-microvolt = <1980000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l3c_3p0: ldo3 {
+                       regulator-min-microvolt = <2800000>;
+                       regulator-max-microvolt = <3540000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vddpx_5:
+               vreg_l4c_1p8_3p0: ldo4 {
+                       regulator-min-microvolt = <1620000>;
+                       regulator-max-microvolt = <3300000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vddpx_6:
+               vreg_l5c_1p8_3p0: ldo5 {
+                       regulator-min-microvolt = <1620000>;
+                       regulator-max-microvolt = <3300000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vddpx_2:
+               vreg_l6c_2p96: ldo6 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <2950000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l7c_3p0: ldo7 {
+                       regulator-min-microvolt = <3000000>;
+                       regulator-max-microvolt = <3544000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l8c_1p8: ldo8 {
+                       regulator-min-microvolt = <1620000>;
+                       regulator-max-microvolt = <2000000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l9c_2p96: ldo9 {
+                       regulator-min-microvolt = <2960000>;
+                       regulator-max-microvolt = <2960000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vdd_a_csi_0_1_0p9:
+               vdd_a_csi_2_3_0p9:
+               vdd_a_csi_4_0p9:
+               vdd_a_dsi_0_0p9:
+               vdd_a_dsi_0_pll_0p9:
+               vdd_a_edp_0_0p9:
+               vdd_a_gnss_0p9:
+               vdd_a_pcie_0_core:
+               vdd_a_pcie_1_core:
+               vdd_a_qlink_0_0p9:
+               vdd_a_qlink_0_0p9_ck:
+               vdd_a_qlink_1_0p9:
+               vdd_a_qlink_1_0p9_ck:
+               vdd_a_qrefs_0p875_0:
+               vdd_a_qrefs_0p875_1:
+               vdd_a_qrefs_0p875_2:
+               vdd_a_qrefs_0p875_3:
+               vdd_a_qrefs_0p875_4_5:
+               vdd_a_qrefs_0p875_6:
+               vdd_a_qrefs_0p875_7:
+               vdd_a_qrefs_0p875_8:
+               vdd_a_qrefs_0p875_9:
+               vdd_a_ufs_0_core:
+               vdd_a_usbhs_core:
+               vreg_l10c_0p88: ldo10 {
+                       regulator-min-microvolt = <720000>;
+                       regulator-max-microvolt = <1050000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l11c_2p8: ldo11 {
+                       regulator-min-microvolt = <2800000>;
+                       regulator-max-microvolt = <3544000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l12c_1p8: ldo12 {
+                       regulator-min-microvolt = <1650000>;
+                       regulator-max-microvolt = <2000000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l13c_3p0: ldo13 {
+                       regulator-min-microvolt = <2700000>;
+                       regulator-max-microvolt = <3544000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vdd_flash:
+               vdd_iris_rgb:
+               vdd_mic_bias:
+               vreg_bob: bob {
+                       regulator-min-microvolt = <3008000>;
+                       regulator-max-microvolt = <3960000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
+               };
+       };
+};
+
+/* ADDITIONS TO NODES DEFINED IN PARENT DEVICE TREE FILES */
+
+&ipa {
+       status = "okay";
+       modem-init;
+};
+
+&pcie1_phy {
+       vdda-phy-supply = <&vreg_l10c_0p88>;
+       vdda-pll-supply = <&vreg_l6b_1p2>;
+};
+
+&pmk8350_vadc {
+       pmk8350-die-temp@3 {
+               reg = <PMK8350_ADC7_DIE_TEMP>;
+               label = "pmk8350_die_temp";
+               qcom,pre-scaling = <1 1>;
+       };
+
+       pmr735a-die-temp@403 {
+               reg = <PMR735A_ADC7_DIE_TEMP>;
+               label = "pmr735a_die_temp";
+               qcom,pre-scaling = <1 1>;
+       };
+};
+
+&qfprom {
+       vcc-supply = <&vdd_qfprom>;
+};
+
+/* For eMMC. NOTE: not all Qcards have eMMC stuffed */
+&sdhc_1 {
+       vmmc-supply = <&vreg_l7b_2p5>;
+       vqmmc-supply = <&vreg_l19b_1p8>;
+
+       non-removable;
+       no-sd;
+       no-sdio;
+};
+
+uart_dbg: &uart5 {
+       compatible = "qcom,geni-debug-uart";
+       status = "okay";
+};
+
+mos_bt_uart: &uart7 {
+       status = "okay";
+
+       /delete-property/ interrupts;
+       interrupts-extended = <&intc GIC_SPI 608 IRQ_TYPE_LEVEL_HIGH>,
+                               <&tlmm 31 IRQ_TYPE_EDGE_FALLING>;
+       pinctrl-names = "default", "sleep";
+       pinctrl-1 = <&qup_uart7_sleep_cts>, <&qup_uart7_sleep_rts>, <&qup_uart7_sleep_tx>, <&qup_uart7_sleep_rx>;
+
+       bluetooth: bluetooth {
+               compatible = "qcom,wcn6750-bt";
+               pinctrl-names = "default";
+               pinctrl-0 = <&mos_bt_en>;
+               enable-gpios = <&tlmm 85 GPIO_ACTIVE_HIGH>;
+               swctrl-gpios = <&tlmm 86 GPIO_ACTIVE_HIGH>;
+               vddaon-supply = <&vreg_s7b_0p952>;
+               vddbtcxmx-supply = <&vreg_s7b_0p952>;
+               vddrfacmn-supply = <&vreg_s7b_0p952>;
+               vddrfa0p8-supply = <&vreg_s7b_0p952>;
+               vddrfa1p7-supply = <&vdd19_pmu_rfa_i>;
+               vddrfa1p2-supply = <&vdd13_pmu_rfa_i>;
+               vddrfa2p2-supply = <&vreg_s1c_2p2>;
+               vddasd-supply = <&vreg_l11c_2p8>;
+               vddio-supply = <&vreg_l18b_1p8>;
+               max-speed = <3200000>;
+       };
+};
+
+&usb_1_hsphy {
+       vdda-pll-supply = <&vdd_a_usbhs_core>;
+       vdda33-supply = <&vdd_a_usbhs_3p1>;
+       vdda18-supply = <&vdd_a_usbhs_1p8>;
+};
+
+&usb_1_qmpphy {
+       vdda-phy-supply = <&vdd_a_usbssdp_0_1p2>;
+       vdda-pll-supply = <&vdd_a_usbssdp_0_core>;
+};
+
+&usb_2_hsphy {
+       vdda-pll-supply = <&vdd_a_usbhs_core>;
+       vdda33-supply = <&vdd_a_usbhs_3p1>;
+       vdda18-supply = <&vdd_a_usbhs_1p8>;
+};
+
+/*
+ * PINCTRL - ADDITIONS TO NODES IN PARENT DEVICE TREE FILES
+ *
+ * NOTE: In general if pins leave the Qcard then the pinctrl goes in the
+ * baseboard or board device tree, not here.
+ */
+
+/*
+ * For ts_i2c
+ *
+ * Technically this i2c bus actually leaves the Qcard, but it leaves directly
+ * via the eDP connector (it doesn't hit the baseboard). The external pulls
+ * are on Qcard.
+ */
+&qup_i2c13_data_clk {
+       /* Has external pull */
+       bias-disable;
+       drive-strength = <2>;
+};
+
+/* For mos_bt_uart */
+&qup_uart7_cts {
+       /* Configure a pull-down on CTS to match the pull of the Bluetooth module. */
+       bias-pull-down;
+};
+
+/* For mos_bt_uart */
+&qup_uart7_rts {
+       /* We'll drive RTS, so no pull */
+       bias-disable;
+       drive-strength = <2>;
+};
+
+/* For mos_bt_uart */
+&qup_uart7_tx {
+       /* We'll drive TX, so no pull */
+       bias-disable;
+       drive-strength = <2>;
+};
+
+/* For mos_bt_uart */
+&qup_uart7_rx {
+       /*
+        * Configure a pull-up on RX. This is needed to avoid
+        * garbage data when the TX pin of the Bluetooth module is
+        * in tri-state (module powered off or not driving the
+        * signal yet).
+        */
+       bias-pull-up;
+};
+
+/* eMMC, if stuffed, is straight on the Qcard */
+&sdc1_clk {
+       bias-disable;
+       drive-strength = <16>;
+};
+
+&sdc1_cmd {
+       bias-pull-up;
+       drive-strength = <10>;
+};
+
+&sdc1_data {
+       bias-pull-up;
+       drive-strength = <10>;
+};
+
+&sdc1_rclk {
+       bias-pull-down;
+};
+
+/*
+ * PINCTRL - QCARD
+ *
+ * This has entries that are defined by Qcard even if they go to the main
+ * board. In cases where the pulls may be board dependent we defer those
+ * settings to the board device tree. Drive strengths tend to be assinged here
+ * but could conceivably be overwridden by board device trees.
+ */
+
+&pm8350c_gpios {
+       pmic_edp_bl_en: pmic-edp-bl-en {
+               pins = "gpio7";
+               function = "normal";
+               bias-disable;
+               qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
+
+               /* Force backlight to be disabled to match state at boot. */
+               output-low;
+       };
+
+       pmic_edp_bl_pwm: pmic-edp-bl-pwm {
+               pins = "gpio8";
+               function = "func1";
+               bias-disable;
+               qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
+               output-low;
+               power-source = <0>;
+       };
+};
+
+&tlmm {
+       mos_bt_en: mos-bt-en {
+               pins = "gpio85";
+               function = "gpio";
+               drive-strength = <2>;
+               output-low;
+       };
+
+       /* For mos_bt_uart */
+       qup_uart7_sleep_cts: qup-uart7-sleep-cts {
+               pins = "gpio28";
+               function = "gpio";
+               /*
+                * Configure a pull-down on CTS to match the pull of
+                * the Bluetooth module.
+                */
+               bias-pull-down;
+       };
+
+       /* For mos_bt_uart */
+       qup_uart7_sleep_rts: qup-uart7-sleep-rts {
+               pins = "gpio29";
+               function = "gpio";
+               /*
+                * Configure pull-down on RTS. As RTS is active low
+                * signal, pull it low to indicate the BT SoC that it
+                * can wakeup the system anytime from suspend state by
+                * pulling RX low (by sending wakeup bytes).
+                */
+               bias-pull-down;
+       };
+
+       /* For mos_bt_uart */
+       qup_uart7_sleep_rx: qup-uart7-sleep-rx {
+               pins = "gpio31";
+               function = "gpio";
+               /*
+                * Configure a pull-up on RX. This is needed to avoid
+                * garbage data when the TX pin of the Bluetooth module
+                * is floating which may cause spurious wakeups.
+                */
+               bias-pull-up;
+       };
+
+       /* For mos_bt_uart */
+       qup_uart7_sleep_tx: qup-uart7-sleep-tx {
+               pins = "gpio30";
+               function = "gpio";
+               /*
+                * Configure pull-up on TX when it isn't actively driven
+                * to prevent BT SoC from receiving garbage during sleep.
+                */
+               bias-pull-up;
+       };
+
+       ts_int_conn: ts-int-conn {
+               pins = "gpio55";
+               function = "gpio";
+               bias-pull-up;
+       };
+
+       ts_rst_conn: ts-rst-conn {
+               pins = "gpio54";
+               function = "gpio";
+               bias-pull-up;
+               drive-strength = <2>;
+       };
+};
index 937c2e0..f0b64be 100644 (file)
@@ -4,12 +4,14 @@
  *
  * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
  */
-
+#include <dt-bindings/clock/qcom,camcc-sc7280.h>
 #include <dt-bindings/clock/qcom,dispcc-sc7280.h>
 #include <dt-bindings/clock/qcom,gcc-sc7280.h>
 #include <dt-bindings/clock/qcom,gpucc-sc7280.h>
 #include <dt-bindings/clock/qcom,rpmh.h>
 #include <dt-bindings/clock/qcom,videocc-sc7280.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interconnect/qcom,osm-l3.h>
 #include <dt-bindings/interconnect/qcom,sc7280.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/mailbox/qcom-ipcc.h>
                                           &LITTLE_CPU_SLEEP_1
                                           &CLUSTER_SLEEP_0>;
                        next-level-cache = <&L2_0>;
+                       operating-points-v2 = <&cpu0_opp_table>;
+                       interconnects = <&gem_noc MASTER_APPSS_PROC 3 &mc_virt SLAVE_EBI1 3>,
+                                       <&epss_l3 MASTER_EPSS_L3_APPS &epss_l3 SLAVE_EPSS_L3_SHARED>;
                        qcom,freq-domain = <&cpufreq_hw 0>;
                        #cooling-cells = <2>;
                        L2_0: l2-cache {
                                           &LITTLE_CPU_SLEEP_1
                                           &CLUSTER_SLEEP_0>;
                        next-level-cache = <&L2_100>;
+                       operating-points-v2 = <&cpu0_opp_table>;
+                       interconnects = <&gem_noc MASTER_APPSS_PROC 3 &mc_virt SLAVE_EBI1 3>,
+                                       <&epss_l3 MASTER_EPSS_L3_APPS &epss_l3 SLAVE_EPSS_L3_SHARED>;
                        qcom,freq-domain = <&cpufreq_hw 0>;
                        #cooling-cells = <2>;
                        L2_100: l2-cache {
                                           &LITTLE_CPU_SLEEP_1
                                           &CLUSTER_SLEEP_0>;
                        next-level-cache = <&L2_200>;
+                       operating-points-v2 = <&cpu0_opp_table>;
+                       interconnects = <&gem_noc MASTER_APPSS_PROC 3 &mc_virt SLAVE_EBI1 3>,
+                                       <&epss_l3 MASTER_EPSS_L3_APPS &epss_l3 SLAVE_EPSS_L3_SHARED>;
                        qcom,freq-domain = <&cpufreq_hw 0>;
                        #cooling-cells = <2>;
                        L2_200: l2-cache {
                                           &LITTLE_CPU_SLEEP_1
                                           &CLUSTER_SLEEP_0>;
                        next-level-cache = <&L2_300>;
+                       operating-points-v2 = <&cpu0_opp_table>;
+                       interconnects = <&gem_noc MASTER_APPSS_PROC 3 &mc_virt SLAVE_EBI1 3>,
+                                       <&epss_l3 MASTER_EPSS_L3_APPS &epss_l3 SLAVE_EPSS_L3_SHARED>;
                        qcom,freq-domain = <&cpufreq_hw 0>;
                        #cooling-cells = <2>;
                        L2_300: l2-cache {
                                           &BIG_CPU_SLEEP_1
                                           &CLUSTER_SLEEP_0>;
                        next-level-cache = <&L2_400>;
+                       operating-points-v2 = <&cpu4_opp_table>;
+                       interconnects = <&gem_noc MASTER_APPSS_PROC 3 &mc_virt SLAVE_EBI1 3>,
+                                       <&epss_l3 MASTER_EPSS_L3_APPS &epss_l3 SLAVE_EPSS_L3_SHARED>;
                        qcom,freq-domain = <&cpufreq_hw 1>;
                        #cooling-cells = <2>;
                        L2_400: l2-cache {
                                           &BIG_CPU_SLEEP_1
                                           &CLUSTER_SLEEP_0>;
                        next-level-cache = <&L2_500>;
+                       operating-points-v2 = <&cpu4_opp_table>;
+                       interconnects = <&gem_noc MASTER_APPSS_PROC 3 &mc_virt SLAVE_EBI1 3>,
+                                       <&epss_l3 MASTER_EPSS_L3_APPS &epss_l3 SLAVE_EPSS_L3_SHARED>;
                        qcom,freq-domain = <&cpufreq_hw 1>;
                        #cooling-cells = <2>;
                        L2_500: l2-cache {
                                           &BIG_CPU_SLEEP_1
                                           &CLUSTER_SLEEP_0>;
                        next-level-cache = <&L2_600>;
+                       operating-points-v2 = <&cpu4_opp_table>;
+                       interconnects = <&gem_noc MASTER_APPSS_PROC 3 &mc_virt SLAVE_EBI1 3>,
+                                       <&epss_l3 MASTER_EPSS_L3_APPS &epss_l3 SLAVE_EPSS_L3_SHARED>;
                        qcom,freq-domain = <&cpufreq_hw 1>;
                        #cooling-cells = <2>;
                        L2_600: l2-cache {
                                           &BIG_CPU_SLEEP_1
                                           &CLUSTER_SLEEP_0>;
                        next-level-cache = <&L2_700>;
+                       operating-points-v2 = <&cpu7_opp_table>;
+                       interconnects = <&gem_noc MASTER_APPSS_PROC 3 &mc_virt SLAVE_EBI1 3>,
+                                       <&epss_l3 MASTER_EPSS_L3_APPS &epss_l3 SLAVE_EPSS_L3_SHARED>;
                        qcom,freq-domain = <&cpufreq_hw 2>;
                        #cooling-cells = <2>;
                        L2_700: l2-cache {
                };
        };
 
+       cpu0_opp_table: cpu0-opp-table {
+               compatible = "operating-points-v2";
+               opp-shared;
+
+               cpu0_opp_300mhz: opp-300000000 {
+                       opp-hz = /bits/ 64 <300000000>;
+                       opp-peak-kBps = <800000 9600000>;
+               };
+
+               cpu0_opp_691mhz: opp-691200000 {
+                       opp-hz = /bits/ 64 <691200000>;
+                       opp-peak-kBps = <800000 17817600>;
+               };
+
+               cpu0_opp_806mhz: opp-806400000 {
+                       opp-hz = /bits/ 64 <806400000>;
+                       opp-peak-kBps = <800000 20889600>;
+               };
+
+               cpu0_opp_941mhz: opp-940800000 {
+                       opp-hz = /bits/ 64 <940800000>;
+                       opp-peak-kBps = <1804000 24576000>;
+               };
+
+               cpu0_opp_1152mhz: opp-1152000000 {
+                       opp-hz = /bits/ 64 <1152000000>;
+                       opp-peak-kBps = <2188000 27033600>;
+               };
+
+               cpu0_opp_1325mhz: opp-1324800000 {
+                       opp-hz = /bits/ 64 <1324800000>;
+                       opp-peak-kBps = <2188000 33792000>;
+               };
+
+               cpu0_opp_1517mhz: opp-1516800000 {
+                       opp-hz = /bits/ 64 <1516800000>;
+                       opp-peak-kBps = <3072000 38092800>;
+               };
+
+               cpu0_opp_1651mhz: opp-1651200000 {
+                       opp-hz = /bits/ 64 <1651200000>;
+                       opp-peak-kBps = <3072000 41779200>;
+               };
+
+               cpu0_opp_1805mhz: opp-1804800000 {
+                       opp-hz = /bits/ 64 <1804800000>;
+                       opp-peak-kBps = <4068000 48537600>;
+               };
+
+               cpu0_opp_1958mhz: opp-1958400000 {
+                       opp-hz = /bits/ 64 <1958400000>;
+                       opp-peak-kBps = <4068000 48537600>;
+               };
+
+               cpu0_opp_2016mhz: opp-2016000000 {
+                       opp-hz = /bits/ 64 <2016000000>;
+                       opp-peak-kBps = <6220000 48537600>;
+               };
+       };
+
+       cpu4_opp_table: cpu4-opp-table {
+               compatible = "operating-points-v2";
+               opp-shared;
+
+               cpu4_opp_691mhz: opp-691200000 {
+                       opp-hz = /bits/ 64 <691200000>;
+                       opp-peak-kBps = <1804000 9600000>;
+               };
+
+               cpu4_opp_941mhz: opp-940800000 {
+                       opp-hz = /bits/ 64 <940800000>;
+                       opp-peak-kBps = <2188000 17817600>;
+               };
+
+               cpu4_opp_1229mhz: opp-1228800000 {
+                       opp-hz = /bits/ 64 <1228800000>;
+                       opp-peak-kBps = <4068000 24576000>;
+               };
+
+               cpu4_opp_1344mhz: opp-1344000000 {
+                       opp-hz = /bits/ 64 <1344000000>;
+                       opp-peak-kBps = <4068000 24576000>;
+               };
+
+               cpu4_opp_1517mhz: opp-1516800000 {
+                       opp-hz = /bits/ 64 <1516800000>;
+                       opp-peak-kBps = <4068000 24576000>;
+               };
+
+               cpu4_opp_1651mhz: opp-1651200000 {
+                       opp-hz = /bits/ 64 <1651200000>;
+                       opp-peak-kBps = <6220000 38092800>;
+               };
+
+               cpu4_opp_1901mhz: opp-1900800000 {
+                       opp-hz = /bits/ 64 <1900800000>;
+                       opp-peak-kBps = <6220000 44851200>;
+               };
+
+               cpu4_opp_2054mhz: opp-2054400000 {
+                       opp-hz = /bits/ 64 <2054400000>;
+                       opp-peak-kBps = <6220000 44851200>;
+               };
+
+               cpu4_opp_2112mhz: opp-2112000000 {
+                       opp-hz = /bits/ 64 <2112000000>;
+                       opp-peak-kBps = <6220000 44851200>;
+               };
+
+               cpu4_opp_2131mhz: opp-2131200000 {
+                       opp-hz = /bits/ 64 <2131200000>;
+                       opp-peak-kBps = <6220000 44851200>;
+               };
+
+               cpu4_opp_2208mhz: opp-2208000000 {
+                       opp-hz = /bits/ 64 <2208000000>;
+                       opp-peak-kBps = <6220000 44851200>;
+               };
+
+               cpu4_opp_2400mhz: opp-2400000000 {
+                       opp-hz = /bits/ 64 <2400000000>;
+                       opp-peak-kBps = <8532000 48537600>;
+               };
+
+               cpu4_opp_2611mhz: opp-2611200000 {
+                       opp-hz = /bits/ 64 <2611200000>;
+                       opp-peak-kBps = <8532000 48537600>;
+               };
+       };
+
+       cpu7_opp_table: cpu7-opp-table {
+               compatible = "operating-points-v2";
+               opp-shared;
+
+               cpu7_opp_806mhz: opp-806400000 {
+                       opp-hz = /bits/ 64 <806400000>;
+                       opp-peak-kBps = <1804000 9600000>;
+               };
+
+               cpu7_opp_1056mhz: opp-1056000000 {
+                       opp-hz = /bits/ 64 <1056000000>;
+                       opp-peak-kBps = <2188000 17817600>;
+               };
+
+               cpu7_opp_1325mhz: opp-1324800000 {
+                       opp-hz = /bits/ 64 <1324800000>;
+                       opp-peak-kBps = <4068000 24576000>;
+               };
+
+               cpu7_opp_1517mhz: opp-1516800000 {
+                       opp-hz = /bits/ 64 <1516800000>;
+                       opp-peak-kBps = <4068000 24576000>;
+               };
+
+               cpu7_opp_1766mhz: opp-1766400000 {
+                       opp-hz = /bits/ 64 <1766400000>;
+                       opp-peak-kBps = <6220000 38092800>;
+               };
+
+               cpu7_opp_1862mhz: opp-1862400000 {
+                       opp-hz = /bits/ 64 <1862400000>;
+                       opp-peak-kBps = <6220000 38092800>;
+               };
+
+               cpu7_opp_2035mhz: opp-2035200000 {
+                       opp-hz = /bits/ 64 <2035200000>;
+                       opp-peak-kBps = <6220000 38092800>;
+               };
+
+               cpu7_opp_2112mhz: opp-2112000000 {
+                       opp-hz = /bits/ 64 <2112000000>;
+                       opp-peak-kBps = <6220000 44851200>;
+               };
+
+               cpu7_opp_2208mhz: opp-2208000000 {
+                       opp-hz = /bits/ 64 <2208000000>;
+                       opp-peak-kBps = <6220000 44851200>;
+               };
+
+               cpu7_opp_2381mhz: opp-2380800000 {
+                       opp-hz = /bits/ 64 <2380800000>;
+                       opp-peak-kBps = <6832000 44851200>;
+               };
+
+               cpu7_opp_2400mhz: opp-2400000000 {
+                       opp-hz = /bits/ 64 <2400000000>;
+                       opp-peak-kBps = <8532000 48537600>;
+               };
+
+               cpu7_opp_2515mhz: opp-2515200000 {
+                       opp-hz = /bits/ 64 <2515200000>;
+                       opp-peak-kBps = <8532000 48537600>;
+               };
+
+               cpu7_opp_2707mhz: opp-2707200000 {
+                       opp-hz = /bits/ 64 <2707200000>;
+                       opp-peak-kBps = <8532000 48537600>;
+               };
+
+               cpu7_opp_3014mhz: opp-3014400000 {
+                       opp-hz = /bits/ 64 <3014400000>;
+                       opp-peak-kBps = <8532000 48537600>;
+               };
+       };
+
        memory@80000000 {
                device_type = "memory";
                /* We expect the bootloader to fill in the size */
 
                sdhc_1: sdhci@7c4000 {
                        compatible = "qcom,sc7280-sdhci", "qcom,sdhci-msm-v5";
+                       pinctrl-names = "default", "sleep";
+                       pinctrl-0 = <&sdc1_clk>, <&sdc1_cmd>, <&sdc1_data>, <&sdc1_rclk>;
+                       pinctrl-1 = <&sdc1_clk_sleep>, <&sdc1_cmd_sleep>, <&sdc1_data_sleep>, <&sdc1_rclk_sleep>;
                        status = "disabled";
 
                        reg = <0 0x007c4000 0 0x1000>,
                        interconnect-names = "memory",
                                             "config";
 
+                       qcom,qmp = <&aoss_qmp>;
+
                        qcom,smem-states = <&ipa_smp2p_out 0>,
                                           <&ipa_smp2p_out 1>;
                        qcom,smem-state-names = "ipa-clock-enabled-valid",
                        };
                };
 
-               gmu: gmu@3d69000 {
+               gmu: gmu@3d6a000 {
                        compatible="qcom,adreno-gmu-635.0", "qcom,adreno-gmu";
                        reg = <0 0x03d6a000 0 0x34000>,
                                <0 0x3de0000 0 0x10000>,
 
                sdhc_2: sdhci@8804000 {
                        compatible = "qcom,sc7280-sdhci", "qcom,sdhci-msm-v5";
+                       pinctrl-names = "default", "sleep";
+                       pinctrl-0 = <&sdc2_clk>, <&sdc2_cmd>, <&sdc2_data>;
+                       pinctrl-1 = <&sdc2_clk_sleep>, <&sdc2_cmd_sleep>, <&sdc2_data_sleep>;
                        status = "disabled";
 
                        reg = <0 0x08804000 0 0x1000>;
                        #power-domain-cells = <1>;
                };
 
+               camcc: clock-controller@ad00000 {
+                       compatible = "qcom,sc7280-camcc";
+                       reg = <0 0x0ad00000 0 0x10000>;
+                       clocks = <&rpmhcc RPMH_CXO_CLK>,
+                               <&rpmhcc RPMH_CXO_CLK_A>,
+                               <&sleep_clk>;
+                       clock-names = "bi_tcxo", "bi_tcxo_ao", "sleep_clk";
+                       #clock-cells = <1>;
+                       #reset-cells = <1>;
+                       #power-domain-cells = <1>;
+               };
+
                dispcc: clock-controller@af00000 {
                        compatible = "qcom,sc7280-dispcc";
                        reg = <0 0xaf00000 0 0x20000>;
                        clocks = <&rpmhcc RPMH_CXO_CLK>,
                                 <&gcc GCC_DISP_GPLL0_CLK_SRC>,
-                                <0>, <0>, <0>, <0>, <0>, <0>;
-                       clock-names = "bi_tcxo", "gcc_disp_gpll0_clk",
+                                <&mdss_dsi_phy 0>,
+                                <&mdss_dsi_phy 1>,
+                                <&dp_phy 0>,
+                                <&dp_phy 1>,
+                                <&mdss_edp_phy 0>,
+                                <&mdss_edp_phy 1>;
+                       clock-names = "bi_tcxo",
+                                     "gcc_disp_gpll0_clk",
                                      "dsi0_phy_pll_out_byteclk",
                                      "dsi0_phy_pll_out_dsiclk",
                                      "dp_phy_pll_link_clk",
                        #power-domain-cells = <1>;
                };
 
+               mdss: display-subsystem@ae00000 {
+                       compatible = "qcom,sc7280-mdss";
+                       reg = <0 0x0ae00000 0 0x1000>;
+                       reg-names = "mdss";
+
+                       power-domains = <&dispcc DISP_CC_MDSS_CORE_GDSC>;
+
+                       clocks = <&gcc GCC_DISP_AHB_CLK>,
+                                <&dispcc DISP_CC_MDSS_AHB_CLK>,
+                               <&dispcc DISP_CC_MDSS_MDP_CLK>;
+                       clock-names = "iface",
+                                     "ahb",
+                                     "core";
+
+                       assigned-clocks = <&dispcc DISP_CC_MDSS_MDP_CLK>;
+                       assigned-clock-rates = <300000000>;
+
+                       interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+
+                       interconnects = <&mmss_noc MASTER_MDP0 0 &mc_virt SLAVE_EBI1 0>;
+                       interconnect-names = "mdp0-mem";
+
+                       iommus = <&apps_smmu 0x900 0x402>;
+
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges;
+
+                       status = "disabled";
+
+                       mdss_mdp: display-controller@ae01000 {
+                               compatible = "qcom,sc7280-dpu";
+                               reg = <0 0x0ae01000 0 0x8f030>,
+                                       <0 0x0aeb0000 0 0x2008>;
+                               reg-names = "mdp", "vbif";
+
+                               clocks = <&gcc GCC_DISP_HF_AXI_CLK>,
+                                       <&gcc GCC_DISP_SF_AXI_CLK>,
+                                       <&dispcc DISP_CC_MDSS_AHB_CLK>,
+                                       <&dispcc DISP_CC_MDSS_MDP_LUT_CLK>,
+                                       <&dispcc DISP_CC_MDSS_MDP_CLK>,
+                                       <&dispcc DISP_CC_MDSS_VSYNC_CLK>;
+                               clock-names = "bus",
+                                             "nrt_bus",
+                                             "iface",
+                                             "lut",
+                                             "core",
+                                             "vsync";
+                               assigned-clocks = <&dispcc DISP_CC_MDSS_MDP_CLK>,
+                                               <&dispcc DISP_CC_MDSS_VSYNC_CLK>,
+                                               <&dispcc DISP_CC_MDSS_AHB_CLK>;
+                               assigned-clock-rates = <300000000>,
+                                                       <19200000>,
+                                                       <19200000>;
+                               operating-points-v2 = <&mdp_opp_table>;
+                               power-domains = <&rpmhpd SC7280_CX>;
+
+                               interrupt-parent = <&mdss>;
+                               interrupts = <0>;
+
+                               status = "disabled";
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       port@0 {
+                                               reg = <0>;
+                                               dpu_intf1_out: endpoint {
+                                                       remote-endpoint = <&dsi0_in>;
+                                               };
+                                       };
+
+                                       port@1 {
+                                               reg = <1>;
+                                               dpu_intf5_out: endpoint {
+                                                       remote-endpoint = <&edp_in>;
+                                               };
+                                       };
+
+                                       port@2 {
+                                               reg = <2>;
+                                               dpu_intf0_out: endpoint {
+                                                       remote-endpoint = <&dp_in>;
+                                               };
+                                       };
+                               };
+
+                               mdp_opp_table: opp-table {
+                                       compatible = "operating-points-v2";
+
+                                       opp-200000000 {
+                                               opp-hz = /bits/ 64 <200000000>;
+                                               required-opps = <&rpmhpd_opp_low_svs>;
+                                       };
+
+                                       opp-300000000 {
+                                               opp-hz = /bits/ 64 <300000000>;
+                                               required-opps = <&rpmhpd_opp_svs>;
+                                       };
+
+                                       opp-380000000 {
+                                               opp-hz = /bits/ 64 <380000000>;
+                                               required-opps = <&rpmhpd_opp_svs_l1>;
+                                       };
+
+                                       opp-506666667 {
+                                               opp-hz = /bits/ 64 <506666667>;
+                                               required-opps = <&rpmhpd_opp_nom>;
+                                       };
+                               };
+                       };
+
+                       mdss_dsi: dsi@ae94000 {
+                               compatible = "qcom,mdss-dsi-ctrl";
+                               reg = <0 0x0ae94000 0 0x400>;
+                               reg-names = "dsi_ctrl";
+
+                               interrupt-parent = <&mdss>;
+                               interrupts = <4>;
+
+                               clocks = <&dispcc DISP_CC_MDSS_BYTE0_CLK>,
+                                        <&dispcc DISP_CC_MDSS_BYTE0_INTF_CLK>,
+                                        <&dispcc DISP_CC_MDSS_PCLK0_CLK>,
+                                        <&dispcc DISP_CC_MDSS_ESC0_CLK>,
+                                        <&dispcc DISP_CC_MDSS_AHB_CLK>,
+                                        <&gcc GCC_DISP_HF_AXI_CLK>;
+                               clock-names = "byte",
+                                             "byte_intf",
+                                             "pixel",
+                                             "core",
+                                             "iface",
+                                             "bus";
+
+                               operating-points-v2 = <&dsi_opp_table>;
+                               power-domains = <&rpmhpd SC7280_CX>;
+
+                               phys = <&mdss_dsi_phy>;
+                               phy-names = "dsi";
+
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               status = "disabled";
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       port@0 {
+                                               reg = <0>;
+                                               dsi0_in: endpoint {
+                                                       remote-endpoint = <&dpu_intf1_out>;
+                                               };
+                                       };
+
+                                       port@1 {
+                                               reg = <1>;
+                                               dsi0_out: endpoint {
+                                               };
+                                       };
+                               };
+
+                               dsi_opp_table: opp-table {
+                                       compatible = "operating-points-v2";
+
+                                       opp-187500000 {
+                                               opp-hz = /bits/ 64 <187500000>;
+                                               required-opps = <&rpmhpd_opp_low_svs>;
+                                       };
+
+                                       opp-300000000 {
+                                               opp-hz = /bits/ 64 <300000000>;
+                                               required-opps = <&rpmhpd_opp_svs>;
+                                       };
+
+                                       opp-358000000 {
+                                               opp-hz = /bits/ 64 <358000000>;
+                                               required-opps = <&rpmhpd_opp_svs_l1>;
+                                       };
+                               };
+                       };
+
+                       mdss_dsi_phy: phy@ae94400 {
+                               compatible = "qcom,sc7280-dsi-phy-7nm";
+                               reg = <0 0x0ae94400 0 0x200>,
+                                     <0 0x0ae94600 0 0x280>,
+                                     <0 0x0ae94900 0 0x280>;
+                               reg-names = "dsi_phy",
+                                           "dsi_phy_lane",
+                                           "dsi_pll";
+
+                               #clock-cells = <1>;
+                               #phy-cells = <0>;
+
+                               clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
+                                        <&rpmhcc RPMH_CXO_CLK>;
+                               clock-names = "iface", "ref";
+
+                               status = "disabled";
+                       };
+
+                       mdss_edp: edp@aea0000 {
+                               compatible = "qcom,sc7280-edp";
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&edp_hot_plug_det>;
+
+                               reg = <0 0xaea0000 0 0x200>,
+                                     <0 0xaea0200 0 0x200>,
+                                     <0 0xaea0400 0 0xc00>,
+                                     <0 0xaea1000 0 0x400>;
+
+                               interrupt-parent = <&mdss>;
+                               interrupts = <14>;
+
+                               clocks = <&rpmhcc RPMH_CXO_CLK>,
+                                        <&gcc GCC_EDP_CLKREF_EN>,
+                                        <&dispcc DISP_CC_MDSS_AHB_CLK>,
+                                        <&dispcc DISP_CC_MDSS_EDP_AUX_CLK>,
+                                        <&dispcc DISP_CC_MDSS_EDP_LINK_CLK>,
+                                        <&dispcc DISP_CC_MDSS_EDP_LINK_INTF_CLK>,
+                                        <&dispcc DISP_CC_MDSS_EDP_PIXEL_CLK>;
+                               clock-names = "core_xo",
+                                             "core_ref",
+                                             "core_iface",
+                                             "core_aux",
+                                             "ctrl_link",
+                                             "ctrl_link_iface",
+                                             "stream_pixel";
+                               #clock-cells = <1>;
+                               assigned-clocks = <&dispcc DISP_CC_MDSS_EDP_LINK_CLK_SRC>,
+                                                 <&dispcc DISP_CC_MDSS_EDP_PIXEL_CLK_SRC>;
+                               assigned-clock-parents = <&mdss_edp_phy 0>, <&mdss_edp_phy 1>;
+
+                               phys = <&mdss_edp_phy>;
+                               phy-names = "dp";
+
+                               operating-points-v2 = <&edp_opp_table>;
+                               power-domains = <&rpmhpd SC7280_CX>;
+
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               status = "disabled";
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       port@0 {
+                                               reg = <0>;
+                                               edp_in: endpoint {
+                                                       remote-endpoint = <&dpu_intf5_out>;
+                                               };
+                                       };
+
+                                       port@1 {
+                                               reg = <1>;
+                                               edp_out: endpoint { };
+                                       };
+                               };
+
+                               edp_opp_table: opp-table {
+                                       compatible = "operating-points-v2";
+
+                                       opp-160000000 {
+                                               opp-hz = /bits/ 64 <160000000>;
+                                               required-opps = <&rpmhpd_opp_low_svs>;
+                                       };
+
+                                       opp-270000000 {
+                                               opp-hz = /bits/ 64 <270000000>;
+                                               required-opps = <&rpmhpd_opp_svs>;
+                                       };
+
+                                       opp-540000000 {
+                                               opp-hz = /bits/ 64 <540000000>;
+                                               required-opps = <&rpmhpd_opp_nom>;
+                                       };
+
+                                       opp-810000000 {
+                                               opp-hz = /bits/ 64 <810000000>;
+                                               required-opps = <&rpmhpd_opp_nom>;
+                                       };
+                               };
+                       };
+
+                       mdss_edp_phy: phy@aec2a00 {
+                               compatible = "qcom,sc7280-edp-phy";
+
+                               reg = <0 0xaec2a00 0 0x19c>,
+                                     <0 0xaec2200 0 0xa0>,
+                                     <0 0xaec2600 0 0xa0>,
+                                     <0 0xaec2000 0 0x1c0>;
+
+                               clocks = <&rpmhcc RPMH_CXO_CLK>,
+                                        <&gcc GCC_EDP_CLKREF_EN>;
+                               clock-names = "aux",
+                                             "cfg_ahb";
+
+                               #clock-cells = <1>;
+                               #phy-cells = <0>;
+
+                               status = "disabled";
+                       };
+
+                       mdss_dp: displayport-controller@ae90000 {
+                               compatible = "qcom,sc7280-dp";
+
+                               reg = <0 0x0ae90000 0 0x1400>;
+
+                               interrupt-parent = <&mdss>;
+                               interrupts = <12>;
+
+                               clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
+                                        <&dispcc DISP_CC_MDSS_DP_AUX_CLK>,
+                                        <&dispcc DISP_CC_MDSS_DP_LINK_CLK>,
+                                        <&dispcc DISP_CC_MDSS_DP_LINK_INTF_CLK>,
+                                        <&dispcc DISP_CC_MDSS_DP_PIXEL_CLK>;
+                               clock-names =   "core_iface",
+                                               "core_aux",
+                                               "ctrl_link",
+                                               "ctrl_link_iface",
+                                               "stream_pixel";
+                               #clock-cells = <1>;
+                               assigned-clocks = <&dispcc DISP_CC_MDSS_DP_LINK_CLK_SRC>,
+                                                 <&dispcc DISP_CC_MDSS_DP_PIXEL_CLK_SRC>;
+                               assigned-clock-parents = <&dp_phy 0>, <&dp_phy 1>;
+                               phys = <&dp_phy>;
+                               phy-names = "dp";
+
+                               operating-points-v2 = <&dp_opp_table>;
+                               power-domains = <&rpmhpd SC7280_CX>;
+
+                               #sound-dai-cells = <0>;
+
+                               status = "disabled";
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       port@0 {
+                                               reg = <0>;
+                                               dp_in: endpoint {
+                                                       remote-endpoint = <&dpu_intf0_out>;
+                                               };
+                                       };
+
+                                       port@1 {
+                                               reg = <1>;
+                                               dp_out: endpoint { };
+                                       };
+                               };
+
+                               dp_opp_table: opp-table {
+                                       compatible = "operating-points-v2";
+
+                                       opp-160000000 {
+                                               opp-hz = /bits/ 64 <160000000>;
+                                               required-opps = <&rpmhpd_opp_low_svs>;
+                                       };
+
+                                       opp-270000000 {
+                                               opp-hz = /bits/ 64 <270000000>;
+                                               required-opps = <&rpmhpd_opp_svs>;
+                                       };
+
+                                       opp-540000000 {
+                                               opp-hz = /bits/ 64 <540000000>;
+                                               required-opps = <&rpmhpd_opp_svs_l1>;
+                                       };
+
+                                       opp-810000000 {
+                                               opp-hz = /bits/ 64 <810000000>;
+                                               required-opps = <&rpmhpd_opp_nom>;
+                                       };
+                               };
+                       };
+               };
+
                pdc: interrupt-controller@b220000 {
                        compatible = "qcom,sc7280-pdc", "qcom,pdc";
                        reg = <0 0x0b220000 0 0x30000>;
                        gpio-ranges = <&tlmm 0 0 175>;
                        wakeup-parent = <&pdc>;
 
+                       dp_hot_plug_det: dp-hot-plug-det {
+                               pins = "gpio47";
+                               function = "dp_hot";
+                       };
+
+                       edp_hot_plug_det: edp-hot-plug-det {
+                               pins = "gpio60";
+                               function = "edp_hot";
+                       };
+
                        pcie1_clkreq_n: pcie1-clkreq-n {
                                pins = "gpio79";
                                function = "pcie1_clkreqn";
-                               drive-strength = <2>;
-                               bias-pull-up;
                        };
 
                        qspi_clk: qspi-clk {
                                function = "qup07";
                        };
 
-                       sdc1_on: sdc1-on {
-                               clk {
-                                       pins = "sdc1_clk";
-                               };
-
-                               cmd {
-                                       pins = "sdc1_cmd";
-                               };
-
-                               data {
-                                       pins = "sdc1_data";
-                               };
-
-                               rclk {
-                                       pins = "sdc1_rclk";
-                               };
-                       };
-
-                       sdc1_off: sdc1-off {
-                               clk {
-                                       pins = "sdc1_clk";
-                                       drive-strength = <2>;
-                                       bias-bus-hold;
-                               };
-
-                               cmd {
-                                       pins = "sdc1_cmd";
-                                       drive-strength = <2>;
-                                       bias-bus-hold;
-                               };
-
-                               data {
-                                       pins = "sdc1_data";
-                                       drive-strength = <2>;
-                                       bias-bus-hold;
-                               };
-
-                               rclk {
-                                       pins = "sdc1_rclk";
-                                       bias-bus-hold;
-                               };
-                       };
-
-                       sdc2_on: sdc2-on {
-                               clk {
-                                       pins = "sdc2_clk";
-                               };
-
-                               cmd {
-                                       pins = "sdc2_cmd";
-                               };
-
-                               data {
-                                       pins = "sdc2_data";
-                               };
-                       };
-
-                       sdc2_off: sdc2-off {
-                               clk {
-                                       pins = "sdc2_clk";
-                                       drive-strength = <2>;
-                                       bias-bus-hold;
-                               };
-
-                               cmd {
-                                       pins ="sdc2_cmd";
-                                       drive-strength = <2>;
-                                       bias-bus-hold;
-                               };
-
-                               data {
-                                       pins ="sdc2_data";
-                                       drive-strength = <2>;
-                                       bias-bus-hold;
-                               };
-                       };
-
                        qup_uart8_cts: qup-uart8-cts {
                                pins = "gpio32";
                                function = "qup10";
                                pins = "gpio63";
                                function = "qup17";
                        };
+
+                       sdc1_clk: sdc1-clk {
+                               pins = "sdc1_clk";
+                       };
+
+                       sdc1_cmd: sdc1-cmd {
+                               pins = "sdc1_cmd";
+                       };
+
+                       sdc1_data: sdc1-data {
+                               pins = "sdc1_data";
+                       };
+
+                       sdc1_rclk: sdc1-rclk {
+                               pins = "sdc1_rclk";
+                       };
+
+                       sdc1_clk_sleep: sdc1-clk-sleep {
+                               pins = "sdc1_clk";
+                               drive-strength = <2>;
+                               bias-bus-hold;
+                       };
+
+                       sdc1_cmd_sleep: sdc1-cmd-sleep {
+                               pins = "sdc1_cmd";
+                               drive-strength = <2>;
+                               bias-bus-hold;
+                       };
+
+                       sdc1_data_sleep: sdc1-data-sleep {
+                               pins = "sdc1_data";
+                               drive-strength = <2>;
+                               bias-bus-hold;
+                       };
+
+                       sdc1_rclk_sleep: sdc1-rclk-sleep {
+                               pins = "sdc1_rclk";
+                               drive-strength = <2>;
+                               bias-bus-hold;
+                       };
+
+                       sdc2_clk: sdc2-clk {
+                               pins = "sdc2_clk";
+                       };
+
+                       sdc2_cmd: sdc2-cmd {
+                               pins = "sdc2_cmd";
+                       };
+
+                       sdc2_data: sdc2-data {
+                               pins = "sdc2_data";
+                       };
+
+                       sdc2_clk_sleep: sdc2-clk-sleep {
+                               pins = "sdc2_clk";
+                               drive-strength = <2>;
+                               bias-bus-hold;
+                       };
+
+                       sdc2_cmd_sleep: sdc2-cmd-sleep {
+                               pins = "sdc2_cmd";
+                               drive-strength = <2>;
+                               bias-bus-hold;
+                       };
+
+                       sdc2_data_sleep: sdc2-data-sleep {
+                               pins = "sdc2_data";
+                               drive-strength = <2>;
+                               bias-bus-hold;
+                       };
                };
 
                imem@146a5000 {
                        };
                };
 
+               epss_l3: interconnect@18590000 {
+                       compatible = "qcom,sc7280-epss-l3";
+                       reg = <0 0x18590000 0 0x1000>;
+                       clocks = <&rpmhcc RPMH_CXO_CLK>, <&gcc GCC_GPLL0>;
+                       clock-names = "xo", "alternate";
+                       #interconnect-cells = <1>;
+               };
+
                cpufreq_hw: cpufreq@18591000 {
                        compatible = "qcom,cpufreq-epss";
                        reg = <0 0x18591000 0 0x1000>,
index 9217c3a..2402935 100644 (file)
                                apr {
                                        compatible = "qcom,apr-v2";
                                        qcom,glink-channels = "apr_audio_svc";
-                                       qcom,apr-domain = <APR_DOMAIN_ADSP>;
+                                       qcom,domain = <APR_DOMAIN_ADSP>;
                                        #address-cells = <1>;
                                        #size-cells = <0>;
 
diff --git a/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts b/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts
new file mode 100644 (file)
index 0000000..8b815b2
--- /dev/null
@@ -0,0 +1,183 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2022, Luca Weiss <luca@z3ntu.xyz>
+ */
+/dts-v1/;
+
+#include "sdm632.dtsi"
+#include "pm8953.dtsi"
+
+/ {
+       model = "Fairphone 3";
+       compatible = "fairphone,fp3", "qcom,sdm632";
+       chassis-type = "handset";
+       qcom,msm-id = <349 0>;
+       qcom,board-id = <8 0x10000>;
+
+       aliases {
+               mmc0 = &sdhc_1;
+               mmc1 = &sdhc_2;
+               serial0 = &uart_0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               volume-up {
+                       label = "volume_up";
+                       linux,code = <KEY_VOLUMEUP>;
+                       gpios = <&tlmm 85 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       vph_pwr: vph-pwr-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "vph_pwr";
+               regulator-always-on;
+               regulator-boot-on;
+       };
+};
+
+&hsusb_phy {
+       status = "okay";
+       vdd-supply = <&pm8953_l3>;
+       vdda-pll-supply = <&pm8953_l7>;
+       vdda-phy-dpdm-supply = <&pm8953_l13>;
+};
+
+&pm8953_resin {
+       status = "okay";
+       linux,code = <KEY_VOLUMEDOWN>;
+};
+
+&sdhc_1 {
+       status = "okay";
+       vmmc-supply = <&pm8953_l8>;
+       vqmmc-supply = <&pm8953_l5>;
+};
+
+&sdhc_2 {
+       status = "okay";
+       vmmc-supply = <&pm8953_l11>;
+       vqmmc-supply = <&pm8953_l12>;
+
+       cd-gpios = <&tlmm 133 GPIO_ACTIVE_LOW>;
+};
+
+&rpm_requests {
+       pm8953-regulators {
+               compatible = "qcom,rpm-pm8953-regulators";
+
+               vdd_l1-supply = <&pm8953_s3>;
+               vdd_l2_l3-supply = <&pm8953_s3>;
+               vdd_l4_l5_l6_l7_l16_l19-supply = <&pm8953_s4>;
+               vdd_l8_l11_l12_l13_l14_l15-supply = <&vph_pwr>;
+               vdd_l9_l10_l17_l18_l22-supply = <&vph_pwr>;
+
+               pm8953_s3: s3 {
+                       regulator-min-microvolt = <984000>;
+                       regulator-max-microvolt = <1240000>;
+               };
+               pm8953_s4: s4 {
+                       regulator-min-microvolt = <1036000>;
+                       regulator-max-microvolt = <2040000>;
+               };
+               pm8953_s5: s5 {
+                       regulator-min-microvolt = <1036000>;
+                       regulator-max-microvolt = <2040000>;
+               };
+
+               pm8953_l1: l1 {
+                       regulator-min-microvolt = <975000>;
+                       regulator-max-microvolt = <1050000>;
+               };
+               pm8953_l2: l2 {
+                       regulator-min-microvolt = <975000>;
+                       regulator-max-microvolt = <1175000>;
+               };
+               pm8953_l3: l3 {
+                       regulator-min-microvolt = <925000>;
+                       regulator-max-microvolt = <925000>;
+               };
+               pm8953_l5: l5 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+               };
+               pm8953_l6: l6 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+               };
+               pm8953_l7: l7 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1900000>;
+               };
+               pm8953_l8: l8 {
+                       regulator-min-microvolt = <2900000>;
+                       regulator-max-microvolt = <2900000>;
+               };
+               pm8953_l9: l9 {
+                       regulator-min-microvolt = <3000000>;
+                       regulator-max-microvolt = <3300000>;
+               };
+               pm8953_l10: l10 {
+                       regulator-min-microvolt = <2800000>;
+                       regulator-max-microvolt = <3000000>;
+               };
+               pm8953_l11: l11 {
+                       regulator-min-microvolt = <2950000>;
+                       regulator-max-microvolt = <2950000>;
+               };
+               pm8953_l12: l12 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <2950000>;
+               };
+               pm8953_l13: l13 {
+                       regulator-min-microvolt = <3125000>;
+                       regulator-max-microvolt = <3125000>;
+               };
+               pm8953_l16: l16 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+               };
+               pm8953_l17: l17 {
+                       regulator-min-microvolt = <2850000>;
+                       regulator-max-microvolt = <2850000>;
+               };
+               pm8953_l19: l19 {
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1350000>;
+               };
+               pm8953_l22: l22 {
+                       regulator-min-microvolt = <2800000>;
+                       regulator-max-microvolt = <2800000>;
+               };
+               pm8953_l23: l23 {
+                       regulator-min-microvolt = <975000>;
+                       regulator-max-microvolt = <1225000>;
+               };
+       };
+};
+
+&tlmm {
+       /*
+        * 0-3: unused but protected by TZ
+        * 135-138: fingerprint reader (SPI)
+        */
+       gpio-reserved-ranges = <0 4>, <135 4>;
+};
+
+&uart_0 {
+       status = "okay";
+};
+
+&usb3 {
+       status = "okay";
+};
+
+&usb3_dwc3 {
+       dr_mode = "peripheral";
+};
diff --git a/arch/arm64/boot/dts/qcom/sdm632.dtsi b/arch/arm64/boot/dts/qcom/sdm632.dtsi
new file mode 100644 (file)
index 0000000..645b9f6
--- /dev/null
@@ -0,0 +1,81 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright (c) 2022, The Linux Foundation. All rights reserved. */
+
+#include "msm8953.dtsi"
+
+/ {
+       thermal-zones {
+               /delete-node/cpu1-thermal;
+               /delete-node/cpu2-thermal;
+               /delete-node/cpu3-thermal;
+
+               cpu0-thermal {
+                       thermal-sensors = <&tsens0 13>;
+
+                       cooling-maps {
+                               map0 {
+                                       cooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                                        <&CPU1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                                        <&CPU2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                                        <&CPU3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
+               };
+
+               cpu4-thermal {
+                       thermal-sensors = <&tsens0 5>;
+               };
+
+               cpu5-thermal {
+                       thermal-sensors = <&tsens0 6>;
+               };
+
+               cpu6-thermal {
+                       thermal-sensors = <&tsens0 7>;
+               };
+
+               cpu7-thermal {
+                       thermal-sensors = <&tsens0 8>;
+               };
+       };
+};
+
+/*
+ * SDM632 uses Kryo 250 instead of Cortex A53
+ * CPU0-3 are efficiency cores, CPU4-7 are performance cores
+ */
+&CPU0 {
+       compatible = "qcom,kryo250";
+};
+
+&CPU1 {
+       compatible = "qcom,kryo250";
+};
+
+&CPU2 {
+       compatible = "qcom,kryo250";
+};
+
+&CPU3 {
+       compatible = "qcom,kryo250";
+};
+
+&CPU4 {
+       compatible = "qcom,kryo250";
+       capacity-dmips-mhz = <1980>;
+};
+
+&CPU5 {
+       compatible = "qcom,kryo250";
+       capacity-dmips-mhz = <1980>;
+};
+
+&CPU6 {
+       compatible = "qcom,kryo250";
+       capacity-dmips-mhz = <1980>;
+};
+
+&CPU7 {
+       compatible = "qcom,kryo250";
+       capacity-dmips-mhz = <1980>;
+};
index 4a6285a..e7e4cc5 100644 (file)
@@ -708,7 +708,7 @@ ap_ts_i2c: &i2c14 {
                pinctrl-0 = <&ec_ap_int_l>;
                spi-max-frequency = <3000000>;
 
-               cros_ec_pwm: ec-pwm {
+               cros_ec_pwm: pwm {
                        compatible = "google,cros-ec-pwm";
                        #pwm-cells = <1>;
                };
index 13f80a0..28fe45c 100644 (file)
        status = "okay";
 };
 
+&gpi_dma0 {
+       status = "okay";
+};
+
 &gpu {
        status = "okay";
        zap-shader {
                port@0 {
                        reg = <0>;
                        csiphy0_ep: endpoint {
-                               clock-lanes = <7>;
                                data-lanes = <0 1 2 3>;
                                remote-endpoint = <&ov8856_ep>;
                        };
 
                port {
                        ov8856_ep: endpoint {
-                               clock-lanes = <1>;
                                link-frequencies = /bits/ 64
                                        <360000000 180000000>;
                                data-lanes = <1 2 3 4>;
 
                port {
                        ov7251_ep: endpoint {
-                               clock-lanes = <1>;
                                data-lanes = <0 1>;
 //                             remote-endpoint = <&csiphy3_ep>;
                        };
index 7f42e53..1084d5c 100644 (file)
@@ -54,7 +54,7 @@
                 * it is otherwise possible for an allocation adjacent to the
                 * rmtfs_mem region to trigger an XPU violation, causing a crash.
                 */
-               rmtfs_lower_guard: memory@f5b00000 {
+               rmtfs_lower_guard: rmtfs-lower-guard@f5b00000 {
                        no-map;
                        reg = <0 0xf5b00000 0 0x1000>;
                };
@@ -63,7 +63,7 @@
                 * but given the same address every time. Hard code it as this address is
                 * where the modem firmware expects it to be.
                 */
-               rmtfs_mem: memory@f5b01000 {
+               rmtfs_mem: rmtfs-mem@f5b01000 {
                        compatible = "qcom,rmtfs-mem";
                        reg = <0 0xf5b01000 0 0x200000>;
                        no-map;
@@ -71,7 +71,7 @@
                        qcom,client-id = <1>;
                        qcom,vmid = <15>;
                };
-               rmtfs_upper_guard: memory@f5d01000 {
+               rmtfs_upper_guard: rmtfs-upper-guard@f5d01000 {
                        no-map;
                        reg = <0 0xf5d01000 0 0x1000>;
                };
@@ -80,7 +80,7 @@
                 * It seems like reserving the old rmtfs_mem region is also needed to prevent
                 * random crashes which are most likely modem related, more testing needed.
                 */
-               removed_region: memory@88f00000 {
+               removed_region: removed-region@88f00000 {
                        no-map;
                        reg = <0 0x88f00000 0 0x1c00000>;
                };
        };
 };
 
+&i2c10 {
+       status = "okay";
+       clock-frequency = <100000>;
+
+       bq27441_fg: bq27441-battery@55 {
+               compatible = "ti,bq27411";
+               status = "okay";
+               reg = <0x55>;
+       };
+};
+
 &i2c12 {
        status = "okay";
        clock-frequency = <400000>;
index 5936b47..bf2cf92 100644 (file)
        chassis-type = "handset";
        qcom,msm-id = <0x141 0x20001>;
        qcom,board-id = <8 0 17819 22>;
+
+       battery: battery {
+               compatible = "simple-battery";
+
+               charge-full-design-microamp-hours = <3300000>;
+               voltage-min-design-microvolt = <3400000>;
+               voltage-max-design-microvolt = <4400000>;
+       };
 };
 
 &display_panel {
@@ -20,3 +28,7 @@
 
        compatible = "samsung,sofef00";
 };
+
+&bq27441_fg {
+       monitored-battery = <&battery>;
+};
index 78a0b99..1b6b5bf 100644 (file)
        chassis-type = "handset";
        qcom,msm-id = <0x141 0x20001>;
        qcom,board-id = <8 0 18801 41>;
+
+       battery: battery {
+               compatible = "simple-battery";
+
+               charge-full-design-microamp-hours = <3700000>;
+               voltage-min-design-microvolt = <3400000>;
+               voltage-max-design-microvolt = <4400000>;
+       };
 };
 
 &display_panel {
        compatible = "samsung,s6e3fc2x01";
 };
 
+&bq27441_fg {
+       monitored-battery = <&battery>;
+};
+
 &rmi4_f12 {
        touchscreen-y-mm = <148>;
 };
diff --git a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
new file mode 100644 (file)
index 0000000..8553c8b
--- /dev/null
@@ -0,0 +1,736 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2022, Alexander Martinz <amartinz@shiftphones.com>
+ * Copyright (c) 2022, Caleb Connolly <caleb@connolly.tech>
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
+#include "sdm845.dtsi"
+#include "pm8998.dtsi"
+#include "pmi8998.dtsi"
+
+/ {
+       model = "SHIFT SHIFT6mq";
+       compatible = "shift,axolotl", "qcom,sdm845";
+       qcom,msm-id = <321 0x20001>;
+       qcom,board-id = <11 0>;
+
+       aliases {
+               display0 = &framebuffer0;
+               serial0 = &uart9;
+       };
+
+       chosen {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               stdout-path = "serial0";
+
+               /* Use framebuffer setup by the bootloader. */
+               framebuffer0: framebuffer@9d400000 {
+                       compatible = "simple-framebuffer";
+                       reg = <0x0 0x9d400000 0x0 (1080 * 2160 * 4)>;
+                       width = <1080>;
+                       height = <2160>;
+                       stride = <(1080 * 4)>;
+                       format = "a8r8g8b8";
+               };
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               autorepeat;
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&volume_up_gpio>;
+
+               vol-up {
+                       label = "volume_up";
+                       linux,code = <KEY_VOLUMEUP>;
+                       gpios = <&pm8998_gpio 6 GPIO_ACTIVE_LOW>;
+                       debounce-interval = <15>;
+               };
+       };
+
+       reserved-memory {
+               framebuffer_region@9d400000 {
+                       reg = <0x0 0x9d400000 0x0 (1080 * 2160 * 4)>;
+                       no-map;
+               };
+
+               ramoops: ramoops@b0000000 {
+                       compatible = "ramoops";
+                       reg = <0 0xb0000000 0 0x00400000>;
+                       record-size = <0x40000>;
+                       console-size = <0x40000>;
+                       ftrace-size = <0x40000>;
+                       pmsg-size = <0x200000>;
+                       ecc-size = <0x0>;
+               };
+       };
+
+       battery: battery {
+               compatible = "simple-battery";
+
+               charge-full-design-microamp-hours = <3850000>;
+               voltage-min-design-microvolt = <3600000>;
+               voltage-max-design-microvolt = <4400000>;
+       };
+
+       vph_pwr: vph-pwr-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "vph_pwr";
+               regulator-min-microvolt = <3700000>;
+               regulator-max-microvolt = <3700000>;
+       };
+
+       vreg_s4a_1p8: pm8998-smps4 {
+               compatible = "regulator-fixed";
+               regulator-name = "vreg_s4a_1p8";
+
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+
+               regulator-always-on;
+               regulator-boot-on;
+
+               vin-supply = <&vph_pwr>;
+       };
+};
+
+&adsp_pas {
+       status = "okay";
+       firmware-name = "qcom/sdm845/axolotl/adsp.mbn";
+};
+
+&apps_rsc {
+       pm8998-rpmh-regulators {
+               compatible = "qcom,pm8998-rpmh-regulators";
+               qcom,pmic-id = "a";
+
+               vdd-s1-supply = <&vph_pwr>;
+               vdd-s2-supply = <&vph_pwr>;
+               vdd-s3-supply = <&vph_pwr>;
+               vdd-s4-supply = <&vph_pwr>;
+               vdd-s5-supply = <&vph_pwr>;
+               vdd-s6-supply = <&vph_pwr>;
+               vdd-s7-supply = <&vph_pwr>;
+               vdd-s8-supply = <&vph_pwr>;
+               vdd-s9-supply = <&vph_pwr>;
+               vdd-s10-supply = <&vph_pwr>;
+               vdd-s11-supply = <&vph_pwr>;
+               vdd-s12-supply = <&vph_pwr>;
+               vdd-s13-supply = <&vph_pwr>;
+               vdd-l1-l27-supply = <&vreg_s7a_1p025>;
+               vdd-l2-l8-l17-supply = <&vreg_s3a_1p35>;
+               vdd-l3-l11-supply = <&vreg_s7a_1p025>;
+               vdd-l4-l5-supply = <&vreg_s7a_1p025>;
+               vdd-l6-supply = <&vph_pwr>;
+               vdd-l7-l12-l14-l15-supply = <&vreg_s5a_2p04>;
+               vdd-l9-supply = <&vreg_bob>;
+               vdd-l10-l23-l25-supply = <&vreg_bob>;
+               vdd-l13-l19-l21-supply = <&vreg_bob>;
+               vdd-l16-l28-supply = <&vreg_bob>;
+               vdd-l18-l22-supply = <&vreg_bob>;
+               vdd-l20-l24-supply = <&vreg_bob>;
+               vdd-l26-supply = <&vreg_s3a_1p35>;
+               vin-lvs-1-2-supply = <&vreg_s4a_1p8>;
+
+               vreg_s2a_1p125: smps2 {
+                       regulator-min-microvolt = <1100000>;
+                       regulator-max-microvolt = <1100000>;
+               };
+
+               vreg_s3a_1p35: smps3 {
+                       regulator-min-microvolt = <1352000>;
+                       regulator-max-microvolt = <1352000>;
+               };
+
+               vreg_s5a_2p04: smps5 {
+                       regulator-min-microvolt = <1904000>;
+                       regulator-max-microvolt = <2040000>;
+               };
+
+               vreg_s7a_1p025: smps7 {
+                       regulator-min-microvolt = <900000>;
+                       regulator-max-microvolt = <1028000>;
+               };
+
+               vdd_qusb_hs0:
+               vdda_hp_pcie_core:
+               vdda_mipi_csi0_0p9:
+               vdda_mipi_csi1_0p9:
+               vdda_mipi_csi2_0p9:
+               vdda_mipi_dsi0_pll:
+               vdda_mipi_dsi1_pll:
+               vdda_qlink_lv:
+               vdda_qlink_lv_ck:
+               vdda_qrefs_0p875:
+               vdda_pcie_core:
+               vdda_pll_cc_ebi01:
+               vdda_pll_cc_ebi23:
+               vdda_sp_sensor:
+               vdda_ufs1_core:
+               vdda_ufs2_core:
+               vdda_usb1_ss_core:
+               vdda_usb2_ss_core:
+               vreg_l1a_0p875: ldo1 {
+                       regulator-min-microvolt = <880000>;
+                       regulator-max-microvolt = <880000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vddpx_10:
+               vreg_l2a_1p2: ldo2 {
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-always-on;
+               };
+
+               vreg_l3a_1p0: ldo3 {
+                       regulator-min-microvolt = <1000000>;
+                       regulator-max-microvolt = <1000000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vdd_wcss_cx:
+               vdd_wcss_mx:
+               vdda_wcss_pll:
+               vreg_l5a_0p8: ldo5 {
+                       regulator-min-microvolt = <800000>;
+                       regulator-max-microvolt = <800000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vddpx_13:
+               vreg_l6a_1p8: ldo6 {
+                       regulator-min-microvolt = <1856000>;
+                       regulator-max-microvolt = <1856000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l7a_1p8: ldo7 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l8a_1p2: ldo8 {
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1248000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l9a_1p8: ldo9 {
+                       regulator-min-microvolt = <1704000>;
+                       regulator-max-microvolt = <2928000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l10a_1p8: ldo10 {
+                       regulator-min-microvolt = <1704000>;
+                       regulator-max-microvolt = <2928000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l11a_1p0: ldo11 {
+                       regulator-min-microvolt = <1000000>;
+                       regulator-max-microvolt = <1048000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vdd_qfprom:
+               vdd_qfprom_sp:
+               vdda_apc1_cs_1p8:
+               vdda_gfx_cs_1p8:
+               vdda_qrefs_1p8:
+               vdda_qusb_hs0_1p8:
+               vddpx_11:
+               vreg_l12a_1p8: ldo12 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vddpx_2:
+               vreg_l13a_2p95: ldo13 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <2960000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l14a_1p88: ldo14 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l15a_1p8: ldo15 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l16a_2p7: ldo16 {
+                       regulator-min-microvolt = <2704000>;
+                       regulator-max-microvolt = <2704000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l17a_1p3: ldo17 {
+                       regulator-min-microvolt = <1304000>;
+                       regulator-max-microvolt = <1304000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l18a_2p7: ldo18 {
+                       regulator-min-microvolt = <2704000>;
+                       regulator-max-microvolt = <2960000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l19a_3p0: ldo19 {
+                       regulator-min-microvolt = <2856000>;
+                       regulator-max-microvolt = <3104000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l20a_2p95: ldo20 {
+                       regulator-min-microvolt = <2704000>;
+                       regulator-max-microvolt = <2960000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l21a_2p95: ldo21 {
+                       regulator-min-microvolt = <2704000>;
+                       regulator-max-microvolt = <2960000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l22a_2p85: ldo22 {
+                       regulator-min-microvolt = <2864000>;
+                       regulator-max-microvolt = <3312000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l23a_3p3: ldo23 {
+                       regulator-min-microvolt = <3000000>;
+                       regulator-max-microvolt = <3312000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vdda_qusb_hs0_3p1:
+               vreg_l24a_3p075: ldo24 {
+                       regulator-min-microvolt = <3088000>;
+                       regulator-max-microvolt = <3088000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l25a_3p3: ldo25 {
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3312000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vdda_hp_pcie_1p2:
+               vdda_hv_ebi0:
+               vdda_hv_ebi1:
+               vdda_hv_ebi2:
+               vdda_hv_ebi3:
+               vdda_mipi_csi_1p25:
+               vdda_mipi_dsi0_1p2:
+               vdda_mipi_dsi1_1p2:
+               vdda_pcie_1p2:
+               vdda_ufs1_1p2:
+               vdda_ufs2_1p2:
+               vdda_usb1_ss_1p2:
+               vdda_usb2_ss_1p2:
+               vreg_l26a_1p2: ldo26 {
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l28a_3p0: ldo28 {
+                       regulator-min-microvolt = <2856000>;
+                       regulator-max-microvolt = <3008000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_lvs1a_1p8: lvs1 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+               };
+
+               vreg_lvs2a_1p8: lvs2 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+               };
+       };
+
+       pmi8998-rpmh-regulators {
+               compatible = "qcom,pmi8998-rpmh-regulators";
+               qcom,pmic-id = "b";
+
+               vdd-bob-supply = <&vph_pwr>;
+
+               vreg_bob: bob {
+                       regulator-min-microvolt = <3312000>;
+                       regulator-max-microvolt = <3600000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
+                       regulator-allow-bypass;
+               };
+       };
+
+       pm8005-rpmh-regulators {
+               compatible = "qcom,pm8005-rpmh-regulators";
+               qcom,pmic-id = "c";
+
+               vdd-s1-supply = <&vph_pwr>;
+               vdd-s2-supply = <&vph_pwr>;
+               vdd-s3-supply = <&vph_pwr>;
+               vdd-s4-supply = <&vph_pwr>;
+
+               vreg_s3c_0p6: smps3 {
+                       regulator-min-microvolt = <600000>;
+                       regulator-max-microvolt = <600000>;
+               };
+       };
+};
+
+&cdsp_pas {
+       status = "okay";
+       firmware-name = "qcom/sdm845/axolotl/cdsp.mbn";
+};
+
+&dsi0 {
+       status = "okay";
+       vdda-supply = <&vdda_mipi_dsi0_1p2>;
+
+       panel@0 {
+               compatible = "visionox,rm69299-shift";
+               status = "okay";
+               reg = <0>;
+               vdda-supply = <&vreg_l14a_1p88>;
+               vdd3p3-supply = <&vreg_l28a_3p0>;
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               reset-gpios = <&tlmm 6 GPIO_ACTIVE_HIGH>;
+
+               pinctrl-names = "default", "sleep";
+               pinctrl-0 = <&sde_dsi_active &sde_te_active>;
+               pinctrl-1 = <&sde_dsi_suspend &sde_te_suspend>;
+
+               port {
+                       panel_in_0: endpoint {
+                               remote-endpoint = <&dsi0_out>;
+                       };
+               };
+       };
+};
+
+&dsi0_out {
+       remote-endpoint = <&panel_in_0>;
+       data-lanes = <0 1 2 3>;
+};
+
+&dsi0_phy {
+       status = "okay";
+       vdds-supply = <&vdda_mipi_dsi0_pll>;
+};
+
+&gcc {
+       protected-clocks = <GCC_QSPI_CORE_CLK>,
+                          <GCC_QSPI_CORE_CLK_SRC>,
+                          <GCC_QSPI_CNOC_PERIPH_AHB_CLK>,
+                          <GCC_LPASS_Q6_AXI_CLK>,
+                          <GCC_LPASS_SWAY_CLK>;
+};
+
+&gmu {
+       status = "okay";
+};
+
+&gpu {
+       status = "okay";
+
+       zap-shader {
+               memory-region = <&gpu_mem>;
+               firmware-name = "qcom/sdm845/axolotl/a630_zap.mbn";
+       };
+};
+
+&i2c5 {
+       status="okay";
+
+       touchscreen@38 {
+               compatible = "focaltech,fts8719";
+               reg = <0x38>;
+               wakeup-source;
+               interrupt-parent = <&tlmm>;
+               interrupts = <125 0x2>;
+               vdd-supply = <&vreg_l28a_3p0>;
+               vcc-i2c-supply = <&vreg_l14a_1p88>;
+
+               pinctrl-names = "default", "suspend";
+               pinctrl-0 = <&ts_int_active &ts_reset_active>;
+               pinctrl-1 = <&ts_int_suspend &ts_reset_suspend>;
+
+               reset-gpio = <&tlmm 99 GPIO_ACTIVE_HIGH>;
+               irq-gpio = <&tlmm 125 GPIO_TRANSITORY>;
+               touchscreen-size-x = <1080>;
+               touchscreen-size-y = <2160>;
+               focaltech,max-touch-number = <5>;
+       };
+};
+
+&ipa {
+       status = "okay";
+
+       memory-region = <&ipa_fw_mem>;
+       firmware-name = "qcom/sdm845/axolotl/ipa_fws.mbn";
+};
+
+&mdss {
+       status = "okay";
+};
+
+&mss_pil {
+       status = "okay";
+       firmware-name = "qcom/sdm845/axolotl/mba.mbn", "qcom/sdm845/axolotl/modem.mbn";
+};
+
+&pm8998_gpio {
+       volume_up_gpio: pm8998_gpio6 {
+               pinconf {
+                       pins = "gpio6";
+                       function = "normal";
+                       input-enable;
+                       bias-pull-up;
+                       qcom,drive-strength = <0>;
+               };
+       };
+};
+
+&pm8998_pon {
+       volume_down_resin: resin {
+               compatible = "qcom,pm8941-resin";
+               interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
+               debounce = <15625>;
+               bias-pull-up;
+               linux,code = <KEY_VOLUMEDOWN>;
+       };
+};
+
+&qup_uart9_default {
+       pinconf-rx {
+               pins = "gpio5";
+               drive-strength = <2>;
+               bias-pull-up;
+       };
+
+       pinconf-tx {
+               pins = "gpio4";
+               drive-strength = <2>;
+               bias-disable;
+       };
+};
+
+&qupv3_id_0 {
+       status = "okay";
+};
+
+&qupv3_id_1 {
+       status = "okay";
+};
+
+&tlmm {
+       gpio-reserved-ranges = <0 4>, <81 4>;
+
+       sde_dsi_active: sde-dsi-active {
+               mux {
+                       pins = "gpio6", "gpio11";
+                       function = "gpio";
+               };
+
+               config {
+                       pins = "gpio6", "gpio11";
+                       drive-strength = <8>;
+                       bias-disable = <0>;
+               };
+       };
+
+       sde_dsi_suspend: sde-dsi-suspend {
+               mux {
+                       pins = "gpio6", "gpio11";
+                       function = "gpio";
+               };
+
+               config {
+                       pins = "gpio6", "gpio11";
+                       drive-strength = <2>;
+                       bias-pull-down;
+               };
+       };
+
+       sde_te_active: sde-te-active {
+               mux {
+                       pins = "gpio10";
+                       function = "mdp_vsync";
+               };
+
+               config {
+                       pins = "gpio10";
+                       drive-strength = <2>;
+                       bias-pull-down;
+               };
+       };
+
+       sde_te_suspend: sde-te-suspend {
+               mux {
+                       pins = "gpio10";
+                       function = "mdp_vsync";
+               };
+
+               config {
+                       pins = "gpio10";
+                       drive-strength = <2>;
+                       bias-pull-down;
+               };
+       };
+
+       ts_int_active: ts-int-active {
+               mux {
+                       pins = "gpio125";
+                       function = "gpio";
+               };
+
+               config {
+                       pins = "gpio125";
+                       drive-strength = <8>;
+                       bias-pull-up;
+                       input-enable;
+               };
+       };
+
+       ts_int_suspend: ts-int-suspend {
+               mux {
+                       pins = "gpio125";
+                       function = "gpio";
+               };
+
+               config {
+                       pins = "gpio125";
+                       drive-strength = <2>;
+                       bias-pull-down;
+                       input-enable;
+               };
+       };
+
+       ts_reset_active: ts-reset-active {
+               mux {
+                       pins = "gpio99";
+                       function = "gpio";
+               };
+
+               config {
+                       pins = "gpio99";
+                       drive-strength = <8>;
+                       bias-pull-up;
+               };
+       };
+
+       ts_reset_suspend: ts-reset-suspend {
+               mux {
+                       pins = "gpio99";
+                       function = "gpio";
+               };
+
+               config {
+                       pins = "gpio99";
+                       drive-strength = <2>;
+                       bias-pull-down;
+               };
+       };
+};
+
+&uart6 {
+       status = "okay";
+
+       bluetooth {
+               compatible = "qcom,wcn3990-bt";
+
+               vddio-supply = <&vreg_s4a_1p8>;
+               vddxo-supply = <&vreg_l7a_1p8>;
+               vddrf-supply = <&vreg_l17a_1p3>;
+               vddch0-supply = <&vreg_l25a_3p3>;
+               max-speed = <3200000>;
+       };
+};
+
+&uart9 {
+       status = "okay";
+};
+
+&ufs_mem_hc {
+       status = "okay";
+
+       reset-gpios = <&tlmm 150 GPIO_ACTIVE_LOW>;
+
+       vcc-supply = <&vreg_l20a_2p95>;
+       vcc-max-microamp = <600000>;
+};
+
+&ufs_mem_phy {
+       status = "okay";
+
+       vdda-phy-supply = <&vdda_ufs1_core>;
+       vdda-pll-supply = <&vdda_ufs1_1p2>;
+};
+
+&usb_1 {
+       status = "okay";
+};
+
+&usb_1_dwc3 {
+       dr_mode = "peripheral";
+};
+
+&usb_1_hsphy {
+       status = "okay";
+
+       vdd-supply = <&vreg_l1a_0p875>;
+       vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
+       vdda-pll-supply = <&vreg_l12a_1p8>;
+};
+
+&usb_1_qmpphy {
+       status = "okay";
+
+       vdda-phy-supply = <&vreg_l26a_1p2>;
+       vdda-pll-supply = <&vreg_l1a_0p875>;
+};
+
+&venus {
+       status = "okay";
+       firmware-name = "qcom/sdm845/axolotl/venus.mbn";
+};
+
+&wifi {
+       status = "okay";
+
+       vdd-0.8-cx-mx-supply = <&vreg_l5a_0p8>;
+       vdd-1.3-rfa-supply = <&vreg_l17a_1p3>;
+       vdd-1.8-xo-supply = <&vreg_l7a_1p8>;
+       vdd-3.3-ch0-supply = <&vreg_l25a_3p3>;
+       vdd-3.3-ch1-supply = <&vreg_l23a_3p3>;
+
+       qcom,snoc-host-cap-8bit-quirk;
+};
index cfdeaa8..41f4e46 100644 (file)
@@ -12,6 +12,7 @@
 #include <dt-bindings/clock/qcom,lpass-sdm845.h>
 #include <dt-bindings/clock/qcom,rpmh.h>
 #include <dt-bindings/clock/qcom,videocc-sdm845.h>
+#include <dt-bindings/dma/qcom-gpi.h>
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/interconnect/qcom,osm-l3.h>
 #include <dt-bindings/interconnect/qcom,sdm845.h>
                #size-cells = <2>;
                ranges;
 
-               hyp_mem: memory@85700000 {
+               hyp_mem: hyp-mem@85700000 {
                        reg = <0 0x85700000 0 0x600000>;
                        no-map;
                };
 
-               xbl_mem: memory@85e00000 {
+               xbl_mem: xbl-mem@85e00000 {
                        reg = <0 0x85e00000 0 0x100000>;
                        no-map;
                };
 
-               aop_mem: memory@85fc0000 {
+               aop_mem: aop-mem@85fc0000 {
                        reg = <0 0x85fc0000 0 0x20000>;
                        no-map;
                };
 
-               aop_cmd_db_mem: memory@85fe0000 {
+               aop_cmd_db_mem: aop-cmd-db-mem@85fe0000 {
                        compatible = "qcom,cmd-db";
                        reg = <0x0 0x85fe0000 0 0x20000>;
                        no-map;
                        hwlocks = <&tcsr_mutex 3>;
                };
 
-               tz_mem: memory@86200000 {
+               tz_mem: tz@86200000 {
                        reg = <0 0x86200000 0 0x2d00000>;
                        no-map;
                };
 
-               rmtfs_mem: memory@88f00000 {
+               rmtfs_mem: rmtfs@88f00000 {
                        compatible = "qcom,rmtfs-mem";
                        reg = <0 0x88f00000 0 0x200000>;
                        no-map;
                        qcom,vmid = <15>;
                };
 
-               qseecom_mem: memory@8ab00000 {
+               qseecom_mem: qseecom@8ab00000 {
                        reg = <0 0x8ab00000 0 0x1400000>;
                        no-map;
                };
 
-               camera_mem: memory@8bf00000 {
+               camera_mem: camera-mem@8bf00000 {
                        reg = <0 0x8bf00000 0 0x500000>;
                        no-map;
                };
 
-               ipa_fw_mem: memory@8c400000 {
+               ipa_fw_mem: ipa-fw@8c400000 {
                        reg = <0 0x8c400000 0 0x10000>;
                        no-map;
                };
 
-               ipa_gsi_mem: memory@8c410000 {
+               ipa_gsi_mem: ipa-gsi@8c410000 {
                        reg = <0 0x8c410000 0 0x5000>;
                        no-map;
                };
 
-               gpu_mem: memory@8c415000 {
+               gpu_mem: gpu@8c415000 {
                        reg = <0 0x8c415000 0 0x2000>;
                        no-map;
                };
 
-               adsp_mem: memory@8c500000 {
+               adsp_mem: adsp@8c500000 {
                        reg = <0 0x8c500000 0 0x1a00000>;
                        no-map;
                };
 
-               wlan_msa_mem: memory@8df00000 {
+               wlan_msa_mem: wlan-msa@8df00000 {
                        reg = <0 0x8df00000 0 0x100000>;
                        no-map;
                };
 
-               mpss_region: memory@8e000000 {
+               mpss_region: mpss@8e000000 {
                        reg = <0 0x8e000000 0 0x7800000>;
                        no-map;
                };
 
-               venus_mem: memory@95800000 {
+               venus_mem: venus@95800000 {
                        reg = <0 0x95800000 0 0x500000>;
                        no-map;
                };
 
-               cdsp_mem: memory@95d00000 {
+               cdsp_mem: cdsp@95d00000 {
                        reg = <0 0x95d00000 0 0x800000>;
                        no-map;
                };
 
-               mba_region: memory@96500000 {
+               mba_region: mba@96500000 {
                        reg = <0 0x96500000 0 0x200000>;
                        no-map;
                };
 
-               slpi_mem: memory@96700000 {
+               slpi_mem: slpi@96700000 {
                        reg = <0 0x96700000 0 0x1400000>;
                        no-map;
                };
 
-               spss_mem: memory@97b00000 {
+               spss_mem: spss@97b00000 {
                        reg = <0 0x97b00000 0 0x100000>;
                        no-map;
                };
                        apr {
                                compatible = "qcom,apr-v2";
                                qcom,glink-channels = "apr_audio_svc";
-                               qcom,apr-domain = <APR_DOMAIN_ADSP>;
+                               qcom,domain = <APR_DOMAIN_ADSP>;
                                #address-cells = <1>;
                                #size-cells = <0>;
                                qcom,intents = <512 20>;
                        };
                };
 
+               gpi_dma0: dma-controller@800000 {
+                       #dma-cells = <3>;
+                       compatible = "qcom,sdm845-gpi-dma";
+                       reg = <0 0x00800000 0 0x60000>;
+                       interrupts = <GIC_SPI 244 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 245 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 246 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 247 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 248 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 249 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 250 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 251 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 252 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 253 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 254 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 255 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>;
+                       dma-channels = <13>;
+                       dma-channel-mask = <0xfa>;
+                       iommus = <&apps_smmu 0x0016 0x0>;
+                       status = "disabled";
+               };
+
                qupv3_id_0: geniqup@8c0000 {
                        compatible = "qcom,geni-se-qup";
                        reg = <0 0x008c0000 0 0x6000>;
                                interconnects = <&aggre1_noc MASTER_QUP_1 0 &config_noc SLAVE_BLSP_1 0>,
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_1 0>;
                                interconnect-names = "qup-core", "qup-config";
+                               dmas = <&gpi_dma0 0 0 QCOM_GPI_SPI>,
+                                      <&gpi_dma0 1 0 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                        };
                };
 
+               gpi_dma1: dma-controller@0xa00000 {
+                       #dma-cells = <3>;
+                       compatible = "qcom,sdm845-gpi-dma";
+                       reg = <0 0x00a00000 0 0x60000>;
+                       interrupts = <GIC_SPI 279 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 280 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 281 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 282 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 283 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 284 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 293 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 294 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 295 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 296 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 297 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 298 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 299 IRQ_TYPE_LEVEL_HIGH>;
+                       dma-channels = <13>;
+                       dma-channel-mask = <0xfa>;
+                       iommus = <&apps_smmu 0x06d6 0x0>;
+                       status = "disabled";
+               };
+
                qupv3_id_1: geniqup@ac0000 {
                        compatible = "qcom,geni-se-qup";
                        reg = <0 0x00ac0000 0 0x6000>;
                        };
                };
 
-               system-cache-controller@1100000 {
+               llcc: system-cache-controller@1100000 {
                        compatible = "qcom,sdm845-llcc";
                        reg = <0 0x01100000 0 0x200000>, <0 0x01300000 0 0x50000>;
                        reg-names = "llcc_base", "llcc_broadcast_base";
                                               "gpio2", "gpio3";
                                        function = "qup0";
                                };
+
+                               config {
+                                       pins = "gpio0", "gpio1",
+                                              "gpio2", "gpio3";
+                                       drive-strength = <6>;
+                                       bias-disable;
+                               };
                        };
 
                        qup_spi1_default: qup-spi1-default {
                                        #clock-cells = <0>;
                                        clock-frequency = <9600000>;
                                        clock-output-names = "mclk";
-                                       qcom,micbias1-millivolt = <1800>;
-                                       qcom,micbias2-millivolt = <1800>;
-                                       qcom,micbias3-millivolt = <1800>;
-                                       qcom,micbias4-millivolt = <1800>;
+                                       qcom,micbias1-microvolt = <1800000>;
+                                       qcom,micbias2-microvolt = <1800000>;
+                                       qcom,micbias3-microvolt = <1800000>;
+                                       qcom,micbias4-microvolt = <1800000>;
 
                                        #address-cells = <1>;
                                        #size-cells = <1>;
                        #clock-cells = <1>;
                        #reset-cells = <1>;
                        #power-domain-cells = <1>;
+                       clocks = <&rpmhcc RPMH_CXO_CLK>;
+                       clock-names = "bi_tcxo";
                };
 
                dsi_opp_table: dsi-opp-table {
                };
 
                aoss_qmp: power-controller@c300000 {
-                       compatible = "qcom,sdm845-aoss-qmp";
+                       compatible = "qcom,sdm845-aoss-qmp", "qcom,aoss-qmp";
                        reg = <0 0x0c300000 0 0x100000>;
                        interrupts = <GIC_SPI 389 IRQ_TYPE_EDGE_RISING>;
                        mboxes = <&apss_shared 0>;
                        };
                };
 
-               gpu-thermal-top {
+               gpu-top-thermal {
                        polling-delay-passive = <250>;
                        polling-delay = <1000>;
 
                        };
                };
 
-               gpu-thermal-bottom {
+               gpu-bottom-thermal {
                        polling-delay-passive = <250>;
                        polling-delay = <1000>;
 
index 58845a1..fd12619 100644 (file)
                };
        };
 
-       panel {
-               compatible = "boe,nv133fhm-n61";
-               no-hpd;
-
-               ports {
-                       port {
-                               panel_in_edp: endpoint {
-                                       remote-endpoint = <&sn65dsi86_out>;
-                               };
-                       };
-               };
-       };
-
        /* Reserved memory changes for IPA */
        reserved-memory {
                wlan_msa_mem: memory@8c400000 {
 
                clock-frequency = <19200000>;
        };
+
+       backlight: backlight {
+               compatible = "pwm-backlight";
+               pwms = <&sn65dsi86 1000000>;
+               enable-gpios = <&tlmm 11 GPIO_ACTIVE_HIGH>;
+       };
 };
 
 &adsp_pas {
                clock-names = "refclk";
 
                no-hpd;
+               #pwm-cells = <1>;
 
                ports {
                        #address-cells = <1>;
                                };
                        };
                };
+
+               aux-bus {
+                       panel: panel {
+                               compatible = "boe,nv133fhm-n61";
+                               backlight = <&backlight>;
+
+                               port {
+                                       panel_in_edp: endpoint {
+                                               remote-endpoint = <&sn65dsi86_out>;
+                                       };
+                               };
+                       };
+               };
        };
 };
 
diff --git a/arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts b/arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts
new file mode 100644 (file)
index 0000000..2a552d8
--- /dev/null
@@ -0,0 +1,748 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Samsung Galaxy Book2
+ *
+ * Copyright (c) 2022, Xilin Wu <strongtz@yeah.net>
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
+#include <dt-bindings/input/gpio-keys.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
+#include <dt-bindings/sound/qcom,q6afe.h>
+#include <dt-bindings/sound/qcom,q6asm.h>
+#include "sdm850.dtsi"
+#include "pm8998.dtsi"
+
+/*
+ * Update following upstream (sdm845.dtsi) reserved
+ * memory mappings for firmware loading to succeed
+ */
+/delete-node/ &qseecom_mem;
+/delete-node/ &wlan_msa_mem;
+/delete-node/ &slpi_mem;
+/delete-node/ &ipa_fw_mem;
+/delete-node/ &ipa_gsi_mem;
+/delete-node/ &gpu_mem;
+/delete-node/ &mpss_region;
+/delete-node/ &adsp_mem;
+/delete-node/ &cdsp_mem;
+/delete-node/ &venus_mem;
+/delete-node/ &mba_region;
+/delete-node/ &spss_mem;
+
+/ {
+       model = "Samsung Galaxy Book2";
+       compatible = "samsung,w737", "qcom,sdm845";
+       chassis-type = "convertible";
+
+       chosen {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               // Firmware initialized the display at 1280p instead of 1440p
+               framebuffer0: framebuffer@80400000 {
+                       compatible = "simple-framebuffer";
+                       reg = <0 0x80400000 0 (1920 * 1280 * 4)>;
+                       width = <1920>;
+                       height = <1280>;
+                       stride = <(1920 * 4)>;
+                       format = "a8r8g8b8";
+               };
+       };
+
+       aliases {
+               hsuart0 = &uart6;
+       };
+
+       /* Reserved memory changes */
+       reserved-memory {
+               /* Bootloader display framebuffer region */
+               cont_splash_mem: memory@80400000 {
+                       reg = <0x0 0x80400000 0x0 0x960000>;
+                       no-map;
+               };
+
+               qseecom_mem: memory@8b500000 {
+                       reg = <0 0x8b500000 0 0xa00000>;
+                       no-map;
+               };
+
+               wlan_msa_mem: memory@8c400000 {
+                       reg = <0 0x8c400000 0 0x100000>;
+                       no-map;
+               };
+
+               slpi_mem: memory@8c500000 {
+                       reg = <0 0x8c500000 0 0x1200000>;
+                       no-map;
+               };
+
+               ipa_fw_mem: memory@8d700000 {
+                       reg = <0 0x8d700000 0 0x100000>;
+                       no-map;
+               };
+
+               gpu_mem: memory@8d800000 {
+                       reg = <0 0x8d800000 0 0x5000>;
+                       no-map;
+               };
+
+               mpss_region: memory@8e000000 {
+                       reg = <0 0x8e000000 0 0x8000000>;
+                       no-map;
+               };
+
+               adsp_mem: memory@96000000 {
+                       reg = <0 0x96000000 0 0x2000000>;
+                       no-map;
+               };
+
+               cdsp_mem: memory@98000000 {
+                       reg = <0 0x98000000 0 0x800000>;
+                       no-map;
+               };
+
+               venus_mem: memory@98800000 {
+                       reg = <0 0x98800000 0 0x500000>;
+                       no-map;
+               };
+
+               mba_region: memory@98d00000 {
+                       reg = <0 0x98d00000 0 0x200000>;
+                       no-map;
+               };
+
+               spss_mem: memory@98f00000 {
+                       reg = <0 0x98f00000 0 0x100000>;
+                       no-map;
+               };
+       };
+};
+
+&adsp_pas {
+       firmware-name = "qcom/samsung/w737/qcadsp850.mbn";
+       status = "okay";
+};
+
+&apps_rsc {
+       pm8998-rpmh-regulators {
+               compatible = "qcom,pm8998-rpmh-regulators";
+               qcom,pmic-id = "a";
+
+               vdd-l2-l8-l17-supply = <&vreg_s3a_1p35>;
+               vdd-l7-l12-l14-l15-supply = <&vreg_s5a_2p04>;
+
+               vreg_s2a_1p125: smps2 {
+               };
+
+               vreg_s3a_1p35: smps3 {
+                       regulator-min-microvolt = <1352000>;
+                       regulator-max-microvolt = <1352000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_s4a_1p8: smps4 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_s5a_2p04: smps5 {
+                       regulator-min-microvolt = <2040000>;
+                       regulator-max-microvolt = <2040000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_s7a_1p025: smps7 {
+               };
+
+               vdd_qusb_hs0:
+               vdda_hp_pcie_core:
+               vdda_mipi_csi0_0p9:
+               vdda_mipi_csi1_0p9:
+               vdda_mipi_csi2_0p9:
+               vdda_mipi_dsi0_pll:
+               vdda_mipi_dsi1_pll:
+               vdda_qlink_lv:
+               vdda_qlink_lv_ck:
+               vdda_qrefs_0p875:
+               vdda_pcie_core:
+               vdda_pll_cc_ebi01:
+               vdda_pll_cc_ebi23:
+               vdda_sp_sensor:
+               vdda_ufs1_core:
+               vdda_ufs2_core:
+               vdda_usb1_ss_core:
+               vdda_usb2_ss_core:
+               vreg_l1a_0p875: ldo1 {
+                       regulator-min-microvolt = <880000>;
+                       regulator-max-microvolt = <880000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vddpx_10:
+               vreg_l2a_1p2: ldo2 {
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-always-on;
+               };
+
+               vreg_l3a_1p0: ldo3 {
+               };
+
+               vdd_wcss_cx:
+               vdd_wcss_mx:
+               vdda_wcss_pll:
+               vreg_l5a_0p8: ldo5 {
+                       regulator-min-microvolt = <800000>;
+                       regulator-max-microvolt = <800000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vddpx_13:
+               vreg_l6a_1p8: ldo6 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l7a_1p8: ldo7 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l8a_1p2: ldo8 {
+               };
+
+               vreg_l9a_1p8: ldo9 {
+               };
+
+               vreg_l10a_1p8: ldo10 {
+               };
+
+               vreg_l11a_1p0: ldo11 {
+               };
+
+               vdd_qfprom:
+               vdd_qfprom_sp:
+               vdda_apc1_cs_1p8:
+               vdda_gfx_cs_1p8:
+               vdda_qrefs_1p8:
+               vdda_qusb_hs0_1p8:
+               vddpx_11:
+               vreg_l12a_1p8: ldo12 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vddpx_2:
+               vreg_l13a_2p95: ldo13 {
+               };
+
+               vreg_l14a_1p88: ldo14 {
+                       regulator-min-microvolt = <1880000>;
+                       regulator-max-microvolt = <1880000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-always-on;
+               };
+
+               vreg_l15a_1p8: ldo15 {
+               };
+
+               vreg_l16a_2p7: ldo16 {
+               };
+
+               vreg_l17a_1p3: ldo17 {
+                       regulator-min-microvolt = <1304000>;
+                       regulator-max-microvolt = <1304000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l18a_1p8: ldo18 {
+               };
+
+               vreg_l19a_3p0: ldo19 {
+                       regulator-min-microvolt = <3100000>;
+                       regulator-max-microvolt = <3108000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l20a_2p95: ldo20 {
+                       regulator-min-microvolt = <2960000>;
+                       regulator-max-microvolt = <2960000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l21a_2p95: ldo21 {
+               };
+
+               vreg_l22a_2p85: ldo22 {
+               };
+
+               vreg_l23a_3p3: ldo23 {
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3312000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vdda_qusb_hs0_3p1:
+               vreg_l24a_3p075: ldo24 {
+                       regulator-min-microvolt = <3075000>;
+                       regulator-max-microvolt = <3083000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l25a_3p3: ldo25 {
+                       regulator-min-microvolt = <3104000>;
+                       regulator-max-microvolt = <3112000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vdda_hp_pcie_1p2:
+               vdda_hv_ebi0:
+               vdda_hv_ebi1:
+               vdda_hv_ebi2:
+               vdda_hv_ebi3:
+               vdda_mipi_csi_1p25:
+               vdda_mipi_dsi0_1p2:
+               vdda_mipi_dsi1_1p2:
+               vdda_pcie_1p2:
+               vdda_ufs1_1p2:
+               vdda_ufs2_1p2:
+               vdda_usb1_ss_1p2:
+               vdda_usb2_ss_1p2:
+               vreg_l26a_1p2: ldo26 {
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1208000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l28a_3p0: ldo28 {
+               };
+
+               vreg_lvs1a_1p8: lvs1 {
+               };
+
+               vreg_lvs2a_1p8: lvs2 {
+               };
+       };
+};
+
+&cdsp_pas {
+       firmware-name = "qcom/samsung/w737/qccdsp850.mbn";
+       status = "okay";
+};
+
+&gcc {
+       protected-clocks = <GCC_QSPI_CORE_CLK>,
+                          <GCC_QSPI_CORE_CLK_SRC>,
+                          <GCC_QSPI_CNOC_PERIPH_AHB_CLK>,
+                          <GCC_LPASS_Q6_AXI_CLK>,
+                          <GCC_LPASS_SWAY_CLK>;
+};
+
+&i2c10 {
+       status = "okay";
+       clock-frequency = <400000>;
+
+       /* SN65DSI86 @ 0x2c */
+       /* The panel requires dual DSI, which is not supported by the bridge driver */
+};
+
+&i2c11 {
+       status = "okay";
+       clock-frequency = <400000>;
+
+       /* HID-I2C Touchscreen @ 0x20 */
+};
+
+&i2c15 {
+       status = "okay";
+       clock-frequency = <400000>;
+
+       digitizer@9 {
+               compatible = "wacom,w9013", "hid-over-i2c";
+               reg = <0x9>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pen_irq_l>, <&pen_pdct_l>, <&pen_rst_l>;
+
+               post-power-on-delay-ms = <120>;
+
+               interrupt-parent = <&tlmm>;
+               interrupts = <119 IRQ_TYPE_LEVEL_LOW>;
+
+               hid-descr-addr = <0x1>;
+       };
+};
+
+&ipa {
+       status = "okay";
+       memory-region = <&ipa_fw_mem>;
+       firmware-name = "qcom/samsung/w737/ipa_fws.elf";
+};
+
+/* No idea why it causes an SError when enabled */
+&llcc {
+       status = "disabled";
+};
+
+&mss_pil {
+       status = "okay";
+       firmware-name = "qcom/samsung/w737/qcdsp1v2850.mbn", "qcom/samsung/w737/qcdsp2850.mbn";
+};
+
+&qup_i2c10_default {
+       pinconf {
+               pins = "gpio55", "gpio56";
+               drive-strength = <2>;
+               bias-disable;
+       };
+};
+
+&qup_i2c11_default {
+       pinconf {
+               pins = "gpio31", "gpio32";
+               drive-strength = <2>;
+               bias-disable;
+       };
+};
+
+&qup_i2c12_default {
+       drive-strength = <2>;
+       bias-disable;
+};
+
+&qup_uart6_default {
+       pinmux {
+                pins = "gpio45", "gpio46", "gpio47", "gpio48";
+                function = "qup6";
+       };
+
+       cts {
+               pins = "gpio45";
+               bias-pull-down;
+       };
+
+       rts-tx {
+               pins = "gpio46", "gpio47";
+               drive-strength = <2>;
+               bias-disable;
+       };
+
+       rx {
+               pins = "gpio48";
+               bias-pull-up;
+       };
+};
+
+&qupv3_id_0 {
+       status = "okay";
+};
+
+&qupv3_id_1 {
+       status = "okay";
+};
+
+&q6asmdai {
+       dai@0 {
+               reg = <0>;
+       };
+
+       dai@1 {
+               reg = <1>;
+       };
+
+       dai@2 {
+               reg = <2>;
+       };
+};
+
+&sound {
+       compatible = "qcom,sdm845-sndcard";
+       model = "Samsung-W737";
+
+       audio-routing =
+               "RX_BIAS", "MCLK",
+               "AMIC2", "MIC BIAS2",
+               "SpkrLeft IN", "SPK1 OUT",
+               "SpkrRight IN", "SPK2 OUT",
+               "MM_DL1",  "MultiMedia1 Playback",
+               "MM_DL3",  "MultiMedia3 Playback",
+               "MultiMedia2 Capture", "MM_UL2";
+
+       mm1-dai-link {
+               link-name = "MultiMedia1";
+               cpu {
+                       sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA1>;
+               };
+       };
+
+       mm2-dai-link {
+               link-name = "MultiMedia2";
+               cpu {
+                       sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA2>;
+               };
+       };
+
+       mm3-dai-link {
+               link-name = "MultiMedia3";
+               cpu {
+                       sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA3>;
+               };
+       };
+
+       slim-dai-link {
+               link-name = "SLIM Playback";
+               cpu {
+                       sound-dai = <&q6afedai SLIMBUS_0_RX>;
+               };
+
+               platform {
+                       sound-dai = <&q6routing>;
+               };
+
+               codec {
+                       sound-dai =  <&left_spkr>, <&right_spkr>, <&swm 0>, <&wcd9340 0>;
+               };
+       };
+
+       slimcap-dai-link {
+               link-name = "SLIM Capture";
+               cpu {
+                       sound-dai = <&q6afedai SLIMBUS_0_TX>;
+               };
+
+               platform {
+                       sound-dai = <&q6routing>;
+               };
+
+               codec {
+                       sound-dai = <&wcd9340 1>;
+               };
+       };
+
+       slim-wcd-dai-link {
+               link-name = "SLIM WCD Playback";
+               cpu {
+                       sound-dai = <&q6afedai SLIMBUS_1_RX>;
+               };
+
+               platform {
+                       sound-dai = <&q6routing>;
+               };
+
+               codec {
+                       sound-dai =  <&wcd9340 2>;
+               };
+       };
+};
+
+&tlmm {
+       gpio-reserved-ranges = <0 6>, <85 4>;
+
+       pen_irq_l: pen-irq-l {
+               pinmux {
+                       pins = "gpio119";
+                       function = "gpio";
+               };
+
+               pinconf {
+                       pins = "gpio119";
+                       bias-disable;
+               };
+       };
+
+       pen_pdct_l: pen-pdct-l {
+               pinmux {
+                       pins = "gpio124";
+                       function = "gpio";
+               };
+
+               pinconf {
+                       pins = "gpio124";
+                       bias-disable;
+                       drive-strength = <2>;
+                       output-high;
+               };
+       };
+
+       pen_rst_l: pen-rst-l {
+               pinmux  {
+                       pins = "gpio21";
+                       function = "gpio";
+               };
+
+               pinconf {
+                       pins = "gpio21";
+                       bias-disable;
+                       drive-strength = <2>;
+
+                       /*
+                        * The pen driver doesn't currently support
+                        * driving this reset line.  By specifying
+                        * output-high here we're relying on the fact
+                        * that this pin has a default pulldown at boot
+                        * (which makes sure the pen was in reset if it
+                        * was powered) and then we set it high here to
+                        * take it out of reset.  Better would be if the
+                        * pen driver could control this and we could
+                        * remove "output-high" here.
+                        */
+                       output-high;
+               };
+       };
+
+       wcd_intr_default: wcd_intr_default {
+               pins = "gpio54";
+               function = "gpio";
+
+               input-enable;
+               bias-pull-down;
+               drive-strength = <2>;
+       };
+};
+
+&uart6 {
+       status = "okay";
+
+       bluetooth {
+               compatible = "qcom,wcn3990-bt";
+
+               vddio-supply = <&vreg_s4a_1p8>;
+               vddxo-supply = <&vreg_l7a_1p8>;
+               vddrf-supply = <&vreg_l17a_1p3>;
+               vddch0-supply = <&vreg_l25a_3p3>;
+               vddch1-supply = <&vreg_l23a_3p3>;
+               max-speed = <3200000>;
+       };
+};
+
+&ufs_mem_hc {
+       status = "okay";
+
+       reset-gpios = <&tlmm 150 GPIO_ACTIVE_LOW>;
+
+       vcc-supply = <&vreg_l20a_2p95>;
+       vcc-max-microamp = <600000>;
+};
+
+&ufs_mem_phy {
+       status = "okay";
+
+       vdda-phy-supply = <&vdda_ufs1_core>;
+       vdda-pll-supply = <&vdda_ufs1_1p2>;
+};
+
+&usb_1 {
+       status = "okay";
+};
+
+&usb_1_dwc3 {
+       dr_mode = "host";
+};
+
+&usb_1_hsphy {
+       status = "okay";
+
+       vdd-supply = <&vdda_usb1_ss_core>;
+       vdda-pll-supply = <&vdda_qusb_hs0_1p8>;
+       vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>;
+
+       qcom,imp-res-offset-value = <8>;
+       qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_21_6_MA>;
+       qcom,preemphasis-level = <QUSB2_V2_PREEMPHASIS_5_PERCENT>;
+       qcom,preemphasis-width = <QUSB2_V2_PREEMPHASIS_WIDTH_HALF_BIT>;
+};
+
+&usb_1_qmpphy {
+       status = "okay";
+
+       vdda-phy-supply = <&vdda_usb1_ss_1p2>;
+       vdda-pll-supply = <&vdda_usb1_ss_core>;
+};
+
+&usb_2 {
+       status = "okay";
+};
+
+&usb_2_dwc3 {
+       dr_mode = "host";
+};
+
+&usb_2_hsphy {
+       status = "okay";
+
+       vdd-supply = <&vdda_usb2_ss_core>;
+       vdda-pll-supply = <&vdda_qusb_hs0_1p8>;
+       vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>;
+
+       qcom,imp-res-offset-value = <8>;
+       qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_22_8_MA>;
+};
+
+&usb_2_qmpphy {
+       status = "okay";
+
+       vdda-phy-supply = <&vdda_usb2_ss_1p2>;
+       vdda-pll-supply = <&vdda_usb2_ss_core>;
+};
+
+&venus {
+       status = "okay";
+       firmware-name = "qcom/samsung/w737/qcvss850.mbn";
+};
+
+&wcd9340{
+       pinctrl-0 = <&wcd_intr_default>;
+       pinctrl-names = "default";
+       clock-names = "extclk";
+       clocks = <&rpmhcc RPMH_LN_BB_CLK2>;
+       reset-gpios = <&tlmm 64 0>;
+       vdd-buck-supply = <&vreg_s4a_1p8>;
+       vdd-buck-sido-supply = <&vreg_s4a_1p8>;
+       vdd-tx-supply = <&vreg_s4a_1p8>;
+       vdd-rx-supply = <&vreg_s4a_1p8>;
+       vdd-io-supply = <&vreg_s4a_1p8>;
+       qcom,mbhc-buttons-vthreshold-microvolt = <75000 150000 237000 500000 500000 500000 500000 500000>;
+       qcom,mbhc-headset-vthreshold-microvolt = <1700000>;
+       qcom,mbhc-headphone-vthreshold-microvolt = <50000>;
+
+       swm: swm@c85 {
+               left_spkr: wsa8810-left{
+                       compatible = "sdw10217211000";
+                       reg = <0 3>;
+                       powerdown-gpios = <&wcdgpio 1 GPIO_ACTIVE_HIGH>;
+                       #thermal-sensor-cells = <0>;
+                       sound-name-prefix = "SpkrLeft";
+                       #sound-dai-cells = <0>;
+               };
+
+               right_spkr: wsa8810-right{
+                       compatible = "sdw10217211000";
+                       powerdown-gpios = <&wcdgpio 2 GPIO_ACTIVE_HIGH>;
+                       reg = <0 4>;
+                       #thermal-sensor-cells = <0>;
+                       sound-name-prefix = "SpkrRight";
+                       #sound-dai-cells = <0>;
+               };
+       };
+};
+
+&wifi {
+       status = "okay";
+
+       vdd-0.8-cx-mx-supply = <&vreg_l5a_0p8>;
+       vdd-1.8-xo-supply = <&vreg_l7a_1p8>;
+       vdd-1.3-rfa-supply = <&vreg_l17a_1p3>;
+       vdd-3.3-ch0-supply = <&vreg_l25a_3p3>;
+       vdd-3.3-ch1-supply = <&vreg_l23a_3p3>;
+
+       qcom,snoc-host-cap-8bit-quirk;
+};
index 49e6bca..e81b2a7 100644 (file)
                                 <&xo_board>;
                        clock-names = "iface", "core", "xo";
 
-                       power-domains = <&rpmpd 0>;
+                       power-domains = <&rpmpd SM6125_VDDCX>;
 
                        bus-width = <8>;
                        non-removable;
                        pinctrl-1 = <&sdc2_state_off>;
                        pinctrl-names = "default", "sleep";
 
-                       power-domains = <&rpmpd 0>;
+                       power-domains = <&rpmpd SM6125_VDDCX>;
 
                        bus-width = <4>;
                        status = "disabled";
index d4af9e0..adb6ca2 100644 (file)
@@ -10,6 +10,7 @@
 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
 #include "sm7225.dtsi"
+#include "pm6150l.dtsi"
 #include "pm6350.dtsi"
 
 / {
        firmware-name = "qcom/sm7225/fairphone4/modem.mdt";
 };
 
+&pm6150l_wled {
+       status = "okay";
+
+       qcom,switching-freq = <800>;
+       qcom,current-limit-microamp = <20000>;
+       qcom,num-strings = <2>;
+};
+
 &pm6350_gpios {
        gpio_keys_pin: gpio-keys-pin {
                pins = "gpio2";
index 5901c28..a73317e 100644 (file)
        /* MAX34417 @ 0x1e */
 };
 
-&pon {
-       pwrkey {
-               status = "okay";
-       };
-
-       resin {
-               compatible = "qcom,pm8941-resin";
-               interrupts = <0x0 0x8 0x1 IRQ_TYPE_EDGE_BOTH>;
-               debounce = <15625>;
-               bias-pull-up;
-               linux,code = <KEY_VOLUMEDOWN>;
-       };
+&pon_pwrkey {
+       status = "okay";
 };
 
 &qupv3_id_0 {
        firmware-name = "qcom/sm8150/microsoft/slpi.mdt";
 };
 
+&pon_resin {
+       status = "okay";
+
+       linux,code = <KEY_VOLUMEDOWN>;
+};
+
 &tlmm {
        gpio-reserved-ranges = <126 4>;
 
index 6012322..d15fee4 100644 (file)
                                reg = <0 0x00880000 0 0x4000>;
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP0_S0_CLK>;
+                               dmas = <&gpi_dma0 0 0 QCOM_GPI_I2C>,
+                                      <&gpi_dma0 1 0 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_i2c0_default>;
                                interrupts = <GIC_SPI 601 IRQ_TYPE_LEVEL_HIGH>;
                                reg-names = "se";
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP0_S0_CLK>;
+                               dmas = <&gpi_dma0 0 0 QCOM_GPI_SPI>,
+                                      <&gpi_dma0 1 0 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_spi0_default>;
                                interrupts = <GIC_SPI 601 IRQ_TYPE_LEVEL_HIGH>;
                                reg = <0 0x00884000 0 0x4000>;
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP0_S1_CLK>;
+                               dmas = <&gpi_dma0 0 1 QCOM_GPI_I2C>,
+                                      <&gpi_dma0 1 1 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_i2c1_default>;
                                interrupts = <GIC_SPI 602 IRQ_TYPE_LEVEL_HIGH>;
                                reg-names = "se";
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP0_S1_CLK>;
+                               dmas = <&gpi_dma0 0 1 QCOM_GPI_SPI>,
+                                      <&gpi_dma0 1 1 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_spi1_default>;
                                interrupts = <GIC_SPI 602 IRQ_TYPE_LEVEL_HIGH>;
                                reg = <0 0x00888000 0 0x4000>;
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP0_S2_CLK>;
+                               dmas = <&gpi_dma0 0 2 QCOM_GPI_I2C>,
+                                      <&gpi_dma0 1 2 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_i2c2_default>;
                                interrupts = <GIC_SPI 603 IRQ_TYPE_LEVEL_HIGH>;
                                reg-names = "se";
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP0_S2_CLK>;
+                               dmas = <&gpi_dma0 0 2 QCOM_GPI_SPI>,
+                                      <&gpi_dma0 1 2 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_spi2_default>;
                                interrupts = <GIC_SPI 603 IRQ_TYPE_LEVEL_HIGH>;
                                reg = <0 0x0088c000 0 0x4000>;
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP0_S3_CLK>;
+                               dmas = <&gpi_dma0 0 3 QCOM_GPI_I2C>,
+                                      <&gpi_dma0 1 3 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_i2c3_default>;
                                interrupts = <GIC_SPI 604 IRQ_TYPE_LEVEL_HIGH>;
                                reg-names = "se";
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP0_S3_CLK>;
+                               dmas = <&gpi_dma0 0 3 QCOM_GPI_SPI>,
+                                      <&gpi_dma0 1 3 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_spi3_default>;
                                interrupts = <GIC_SPI 604 IRQ_TYPE_LEVEL_HIGH>;
                                reg = <0 0x00890000 0 0x4000>;
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP0_S4_CLK>;
+                               dmas = <&gpi_dma0 0 4 QCOM_GPI_I2C>,
+                                      <&gpi_dma0 1 4 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_i2c4_default>;
                                interrupts = <GIC_SPI 605 IRQ_TYPE_LEVEL_HIGH>;
                                reg-names = "se";
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP0_S4_CLK>;
+                               dmas = <&gpi_dma0 0 4 QCOM_GPI_SPI>,
+                                      <&gpi_dma0 1 4 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_spi4_default>;
                                interrupts = <GIC_SPI 605 IRQ_TYPE_LEVEL_HIGH>;
                                reg = <0 0x00894000 0 0x4000>;
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP0_S5_CLK>;
+                               dmas = <&gpi_dma0 0 5 QCOM_GPI_I2C>,
+                                      <&gpi_dma0 1 5 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_i2c5_default>;
                                interrupts = <GIC_SPI 606 IRQ_TYPE_LEVEL_HIGH>;
                                reg-names = "se";
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP0_S5_CLK>;
+                               dmas = <&gpi_dma0 0 5 QCOM_GPI_SPI>,
+                                      <&gpi_dma0 1 5 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_spi5_default>;
                                interrupts = <GIC_SPI 606 IRQ_TYPE_LEVEL_HIGH>;
                                reg = <0 0x00898000 0 0x4000>;
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP0_S6_CLK>;
+                               dmas = <&gpi_dma0 0 6 QCOM_GPI_I2C>,
+                                      <&gpi_dma0 1 6 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_i2c6_default>;
                                interrupts = <GIC_SPI 607 IRQ_TYPE_LEVEL_HIGH>;
                                reg-names = "se";
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP0_S6_CLK>;
+                               dmas = <&gpi_dma0 0 6 QCOM_GPI_SPI>,
+                                      <&gpi_dma0 1 6 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_spi6_default>;
                                interrupts = <GIC_SPI 607 IRQ_TYPE_LEVEL_HIGH>;
                                reg = <0 0x0089c000 0 0x4000>;
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP0_S7_CLK>;
+                               dmas = <&gpi_dma0 0 7 QCOM_GPI_I2C>,
+                                      <&gpi_dma0 1 7 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_i2c7_default>;
                                interrupts = <GIC_SPI 607 IRQ_TYPE_LEVEL_HIGH>;
                                reg-names = "se";
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP0_S7_CLK>;
+                               dmas = <&gpi_dma0 0 7 QCOM_GPI_SPI>,
+                                      <&gpi_dma0 1 7 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_spi7_default>;
                                interrupts = <GIC_SPI 608 IRQ_TYPE_LEVEL_HIGH>;
                                reg = <0 0x00a80000 0 0x4000>;
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP1_S0_CLK>;
+                               dmas = <&gpi_dma1 0 0 QCOM_GPI_I2C>,
+                                      <&gpi_dma1 1 0 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_i2c8_default>;
                                interrupts = <GIC_SPI 353 IRQ_TYPE_LEVEL_HIGH>;
                                reg-names = "se";
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP1_S0_CLK>;
+                               dmas = <&gpi_dma1 0 0 QCOM_GPI_SPI>,
+                                      <&gpi_dma1 1 0 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_spi8_default>;
                                interrupts = <GIC_SPI 353 IRQ_TYPE_LEVEL_HIGH>;
                                reg = <0 0x00a84000 0 0x4000>;
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP1_S1_CLK>;
+                               dmas = <&gpi_dma1 0 1 QCOM_GPI_I2C>,
+                                      <&gpi_dma1 1 1 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_i2c9_default>;
                                interrupts = <GIC_SPI 354 IRQ_TYPE_LEVEL_HIGH>;
                                reg-names = "se";
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP1_S1_CLK>;
+                               dmas = <&gpi_dma1 0 1 QCOM_GPI_SPI>,
+                                      <&gpi_dma1 1 1 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_spi9_default>;
                                interrupts = <GIC_SPI 354 IRQ_TYPE_LEVEL_HIGH>;
                                reg = <0 0x00a88000 0 0x4000>;
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP1_S2_CLK>;
+                               dmas = <&gpi_dma1 0 2 QCOM_GPI_I2C>,
+                                      <&gpi_dma1 1 2 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_i2c10_default>;
                                interrupts = <GIC_SPI 355 IRQ_TYPE_LEVEL_HIGH>;
                                reg-names = "se";
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP1_S2_CLK>;
+                               dmas = <&gpi_dma1 0 2 QCOM_GPI_SPI>,
+                                      <&gpi_dma1 1 2 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_spi10_default>;
                                interrupts = <GIC_SPI 355 IRQ_TYPE_LEVEL_HIGH>;
                                reg = <0 0x00a8c000 0 0x4000>;
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP1_S3_CLK>;
+                               dmas = <&gpi_dma1 0 3 QCOM_GPI_I2C>,
+                                      <&gpi_dma1 1 3 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_i2c11_default>;
                                interrupts = <GIC_SPI 356 IRQ_TYPE_LEVEL_HIGH>;
                                reg-names = "se";
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP1_S3_CLK>;
+                               dmas = <&gpi_dma1 0 3 QCOM_GPI_SPI>,
+                                      <&gpi_dma1 1 3 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_spi11_default>;
                                interrupts = <GIC_SPI 356 IRQ_TYPE_LEVEL_HIGH>;
                                reg = <0 0x00a90000 0 0x4000>;
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP1_S4_CLK>;
+                               dmas = <&gpi_dma1 0 4 QCOM_GPI_I2C>,
+                                      <&gpi_dma1 1 4 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_i2c12_default>;
                                interrupts = <GIC_SPI 357 IRQ_TYPE_LEVEL_HIGH>;
                                reg-names = "se";
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP1_S4_CLK>;
+                               dmas = <&gpi_dma1 0 4 QCOM_GPI_SPI>,
+                                      <&gpi_dma1 1 4 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_spi12_default>;
                                interrupts = <GIC_SPI 357 IRQ_TYPE_LEVEL_HIGH>;
                                reg = <0 0x0094000 0 0x4000>;
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP1_S5_CLK>;
+                               dmas = <&gpi_dma2 0 5 QCOM_GPI_I2C>,
+                                      <&gpi_dma2 1 5 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_i2c16_default>;
                                interrupts = <GIC_SPI 358 IRQ_TYPE_LEVEL_HIGH>;
                                reg-names = "se";
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP1_S5_CLK>;
+                               dmas = <&gpi_dma2 0 5 QCOM_GPI_SPI>,
+                                      <&gpi_dma2 1 5 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_spi16_default>;
                                interrupts = <GIC_SPI 358 IRQ_TYPE_LEVEL_HIGH>;
                                reg = <0 0x00c80000 0 0x4000>;
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP2_S0_CLK>;
+                               dmas = <&gpi_dma2 0 0 QCOM_GPI_I2C>,
+                                      <&gpi_dma2 1 0 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_i2c17_default>;
                                interrupts = <GIC_SPI 373 IRQ_TYPE_LEVEL_HIGH>;
                                reg-names = "se";
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP2_S0_CLK>;
+                               dmas = <&gpi_dma2 0 0 QCOM_GPI_SPI>,
+                                      <&gpi_dma2 1 0 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_spi17_default>;
                                interrupts = <GIC_SPI 373 IRQ_TYPE_LEVEL_HIGH>;
                                reg = <0 0x00c84000 0 0x4000>;
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP2_S1_CLK>;
+                               dmas = <&gpi_dma2 0 1 QCOM_GPI_I2C>,
+                                      <&gpi_dma2 1 1 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_i2c18_default>;
                                interrupts = <GIC_SPI 583 IRQ_TYPE_LEVEL_HIGH>;
                                reg-names = "se";
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP2_S1_CLK>;
+                               dmas = <&gpi_dma2 0 1 QCOM_GPI_SPI>,
+                                      <&gpi_dma2 1 1 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_spi18_default>;
                                interrupts = <GIC_SPI 583 IRQ_TYPE_LEVEL_HIGH>;
                                reg = <0 0x00c88000 0 0x4000>;
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP2_S2_CLK>;
+                               dmas = <&gpi_dma2 0 2 QCOM_GPI_I2C>,
+                                      <&gpi_dma2 1 2 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_i2c19_default>;
                                interrupts = <GIC_SPI 584 IRQ_TYPE_LEVEL_HIGH>;
                                reg-names = "se";
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP2_S2_CLK>;
+                               dmas = <&gpi_dma2 0 2 QCOM_GPI_SPI>,
+                                      <&gpi_dma2 1 2 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_spi19_default>;
                                interrupts = <GIC_SPI 584 IRQ_TYPE_LEVEL_HIGH>;
                                reg = <0 0x00c8c000 0 0x4000>;
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP2_S3_CLK>;
+                               dmas = <&gpi_dma2 0 3 QCOM_GPI_I2C>,
+                                      <&gpi_dma2 1 3 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_i2c13_default>;
                                interrupts = <GIC_SPI 585 IRQ_TYPE_LEVEL_HIGH>;
                                reg-names = "se";
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP2_S3_CLK>;
+                               dmas = <&gpi_dma2 0 3 QCOM_GPI_SPI>,
+                                      <&gpi_dma2 1 3 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_spi13_default>;
                                interrupts = <GIC_SPI 585 IRQ_TYPE_LEVEL_HIGH>;
                                reg = <0 0x00c90000 0 0x4000>;
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP2_S4_CLK>;
+                               dmas = <&gpi_dma2 0 4 QCOM_GPI_I2C>,
+                                      <&gpi_dma2 1 4 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_i2c14_default>;
                                interrupts = <GIC_SPI 586 IRQ_TYPE_LEVEL_HIGH>;
                                reg-names = "se";
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP2_S4_CLK>;
+                               dmas = <&gpi_dma2 0 4 QCOM_GPI_SPI>,
+                                      <&gpi_dma2 1 4 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_spi14_default>;
                                interrupts = <GIC_SPI 586 IRQ_TYPE_LEVEL_HIGH>;
                                reg = <0 0x00c94000 0 0x4000>;
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP2_S5_CLK>;
+                               dmas = <&gpi_dma2 0 5 QCOM_GPI_I2C>,
+                                      <&gpi_dma2 1 5 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_i2c15_default>;
                                interrupts = <GIC_SPI 587 IRQ_TYPE_LEVEL_HIGH>;
                                reg-names = "se";
                                clock-names = "se";
                                clocks = <&gcc GCC_QUPV3_WRAP2_S5_CLK>;
+                               dmas = <&gpi_dma2 0 5 QCOM_GPI_SPI>,
+                                      <&gpi_dma2 1 5 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&qup_spi15_default>;
                                interrupts = <GIC_SPI 587 IRQ_TYPE_LEVEL_HIGH>;
                        qcom,tcs-offset = <0xd00>;
                        qcom,drv-id = <2>;
                        qcom,tcs-config = <ACTIVE_TCS  2>,
-                                         <SLEEP_TCS   1>,
-                                         <WAKE_TCS    1>,
-                                         <CONTROL_TCS 0>;
+                                         <SLEEP_TCS   3>,
+                                         <WAKE_TCS    3>,
+                                         <CONTROL_TCS 1>;
 
                        rpmhcc: clock-controller {
                                compatible = "qcom,sm8150-rpmh-clk";
                        #freq-domain-cells = <1>;
                };
 
+               lmh_cluster1: lmh@18350800 {
+                       compatible = "qcom,sm8150-lmh";
+                       reg = <0 0x18350800 0 0x400>;
+                       interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
+                       cpus = <&CPU4>;
+                       qcom,lmh-temp-arm-millicelsius = <60000>;
+                       qcom,lmh-temp-low-millicelsius = <84500>;
+                       qcom,lmh-temp-high-millicelsius = <85000>;
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+               };
+
+               lmh_cluster0: lmh@18358800 {
+                       compatible = "qcom,sm8150-lmh";
+                       reg = <0 0x18358800 0 0x400>;
+                       interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+                       cpus = <&CPU0>;
+                       qcom,lmh-temp-arm-millicelsius = <60000>;
+                       qcom,lmh-temp-low-millicelsius = <84500>;
+                       qcom,lmh-temp-high-millicelsius = <85000>;
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+               };
+
                wifi: wifi@18800000 {
                        compatible = "qcom,wcn3990-wifi";
                        reg = <0 0x18800000 0 0x800000>;
                        };
                };
 
-               gpu-thermal-top {
+               gpu-top-thermal {
                        polling-delay-passive = <250>;
                        polling-delay = <1000>;
 
                        };
                };
 
-               gpu-thermal-bottom {
+               gpu-bottom-thermal {
                        polling-delay-passive = <250>;
                        polling-delay = <1000>;
 
index 5617a46..fdaf303 100644 (file)
@@ -98,6 +98,8 @@
                        capacity-dmips-mhz = <448>;
                        dynamic-power-coefficient = <205>;
                        next-level-cache = <&L2_0>;
+                       power-domains = <&CPU_PD0>;
+                       power-domain-names = "psci";
                        qcom,freq-domain = <&cpufreq_hw 0>;
                        operating-points-v2 = <&cpu0_opp_table>;
                        interconnects = <&gem_noc MASTER_AMPSS_M0 &mc_virt SLAVE_EBI_CH0>,
                        capacity-dmips-mhz = <448>;
                        dynamic-power-coefficient = <205>;
                        next-level-cache = <&L2_100>;
+                       power-domains = <&CPU_PD1>;
+                       power-domain-names = "psci";
                        qcom,freq-domain = <&cpufreq_hw 0>;
                        operating-points-v2 = <&cpu0_opp_table>;
                        interconnects = <&gem_noc MASTER_AMPSS_M0 &mc_virt SLAVE_EBI_CH0>,
                        capacity-dmips-mhz = <448>;
                        dynamic-power-coefficient = <205>;
                        next-level-cache = <&L2_200>;
+                       power-domains = <&CPU_PD2>;
+                       power-domain-names = "psci";
                        qcom,freq-domain = <&cpufreq_hw 0>;
                        operating-points-v2 = <&cpu0_opp_table>;
                        interconnects = <&gem_noc MASTER_AMPSS_M0 &mc_virt SLAVE_EBI_CH0>,
                        capacity-dmips-mhz = <448>;
                        dynamic-power-coefficient = <205>;
                        next-level-cache = <&L2_300>;
+                       power-domains = <&CPU_PD3>;
+                       power-domain-names = "psci";
                        qcom,freq-domain = <&cpufreq_hw 0>;
                        operating-points-v2 = <&cpu0_opp_table>;
                        interconnects = <&gem_noc MASTER_AMPSS_M0 &mc_virt SLAVE_EBI_CH0>,
                        capacity-dmips-mhz = <1024>;
                        dynamic-power-coefficient = <379>;
                        next-level-cache = <&L2_400>;
+                       power-domains = <&CPU_PD4>;
+                       power-domain-names = "psci";
                        qcom,freq-domain = <&cpufreq_hw 1>;
                        operating-points-v2 = <&cpu4_opp_table>;
                        interconnects = <&gem_noc MASTER_AMPSS_M0 &mc_virt SLAVE_EBI_CH0>,
                        capacity-dmips-mhz = <1024>;
                        dynamic-power-coefficient = <379>;
                        next-level-cache = <&L2_500>;
+                       power-domains = <&CPU_PD5>;
+                       power-domain-names = "psci";
                        qcom,freq-domain = <&cpufreq_hw 1>;
                        operating-points-v2 = <&cpu4_opp_table>;
                        interconnects = <&gem_noc MASTER_AMPSS_M0 &mc_virt SLAVE_EBI_CH0>,
                        capacity-dmips-mhz = <1024>;
                        dynamic-power-coefficient = <379>;
                        next-level-cache = <&L2_600>;
+                       power-domains = <&CPU_PD6>;
+                       power-domain-names = "psci";
                        qcom,freq-domain = <&cpufreq_hw 1>;
                        operating-points-v2 = <&cpu4_opp_table>;
                        interconnects = <&gem_noc MASTER_AMPSS_M0 &mc_virt SLAVE_EBI_CH0>,
                        capacity-dmips-mhz = <1024>;
                        dynamic-power-coefficient = <444>;
                        next-level-cache = <&L2_700>;
+                       power-domains = <&CPU_PD7>;
+                       power-domain-names = "psci";
                        qcom,freq-domain = <&cpufreq_hw 2>;
                        operating-points-v2 = <&cpu7_opp_table>;
                        interconnects = <&gem_noc MASTER_AMPSS_M0 &mc_virt SLAVE_EBI_CH0>,
                                };
                        };
                };
+
+               idle-states {
+                       entry-method = "psci";
+
+                       LITTLE_CPU_SLEEP_0: cpu-sleep-0-0 {
+                               compatible = "arm,idle-state";
+                               idle-state-name = "silver-rail-power-collapse";
+                               arm,psci-suspend-param = <0x40000004>;
+                               entry-latency-us = <360>;
+                               exit-latency-us = <531>;
+                               min-residency-us = <3934>;
+                               local-timer-stop;
+                       };
+
+                       BIG_CPU_SLEEP_0: cpu-sleep-1-0 {
+                               compatible = "arm,idle-state";
+                               idle-state-name = "gold-rail-power-collapse";
+                               arm,psci-suspend-param = <0x40000004>;
+                               entry-latency-us = <702>;
+                               exit-latency-us = <1061>;
+                               min-residency-us = <4488>;
+                               local-timer-stop;
+                       };
+               };
+
+               domain-idle-states {
+                       CLUSTER_SLEEP_0: cluster-sleep-0 {
+                               compatible = "domain-idle-state";
+                               idle-state-name = "cluster-llcc-off";
+                               arm,psci-suspend-param = <0x4100c244>;
+                               entry-latency-us = <3264>;
+                               exit-latency-us = <6562>;
+                               min-residency-us = <9987>;
+                               local-timer-stop;
+                       };
+               };
        };
 
        cpu0_opp_table: cpu0_opp_table {
        psci {
                compatible = "arm,psci-1.0";
                method = "smc";
+
+               CPU_PD0: cpu0 {
+                       #power-domain-cells = <0>;
+                       power-domains = <&CLUSTER_PD>;
+                       domain-idle-states = <&LITTLE_CPU_SLEEP_0>;
+               };
+
+               CPU_PD1: cpu1 {
+                       #power-domain-cells = <0>;
+                       power-domains = <&CLUSTER_PD>;
+                       domain-idle-states = <&LITTLE_CPU_SLEEP_0>;
+               };
+
+               CPU_PD2: cpu2 {
+                       #power-domain-cells = <0>;
+                       power-domains = <&CLUSTER_PD>;
+                       domain-idle-states = <&LITTLE_CPU_SLEEP_0>;
+               };
+
+               CPU_PD3: cpu3 {
+                       #power-domain-cells = <0>;
+                       power-domains = <&CLUSTER_PD>;
+                       domain-idle-states = <&LITTLE_CPU_SLEEP_0>;
+               };
+
+               CPU_PD4: cpu4 {
+                       #power-domain-cells = <0>;
+                       power-domains = <&CLUSTER_PD>;
+                       domain-idle-states = <&BIG_CPU_SLEEP_0>;
+               };
+
+               CPU_PD5: cpu5 {
+                       #power-domain-cells = <0>;
+                       power-domains = <&CLUSTER_PD>;
+                       domain-idle-states = <&BIG_CPU_SLEEP_0>;
+               };
+
+               CPU_PD6: cpu6 {
+                       #power-domain-cells = <0>;
+                       power-domains = <&CLUSTER_PD>;
+                       domain-idle-states = <&BIG_CPU_SLEEP_0>;
+               };
+
+               CPU_PD7: cpu7 {
+                       #power-domain-cells = <0>;
+                       power-domains = <&CLUSTER_PD>;
+                       domain-idle-states = <&BIG_CPU_SLEEP_0>;
+               };
+
+               CLUSTER_PD: cpu-cluster0 {
+                       #power-domain-cells = <0>;
+                       domain-idle-states = <&CLUSTER_SLEEP_0>;
+               };
        };
 
        reserved-memory {
                        phys = <&pcie0_lane>;
                        phy-names = "pciephy";
 
-                       perst-gpio = <&tlmm 79 GPIO_ACTIVE_LOW>;
-                       enable-gpio = <&tlmm 81 GPIO_ACTIVE_HIGH>;
+                       perst-gpios = <&tlmm 79 GPIO_ACTIVE_LOW>;
+                       wake-gpios = <&tlmm 81 GPIO_ACTIVE_HIGH>;
 
                        pinctrl-names = "default";
                        pinctrl-0 = <&pcie0_default_state>;
                        ranges = <0x01000000 0x0 0x40200000 0x0 0x40200000 0x0 0x100000>,
                                 <0x02000000 0x0 0x40300000 0x0 0x40300000 0x0 0x1fd00000>;
 
-                       interrupts = <GIC_SPI 306 IRQ_TYPE_EDGE_RISING>;
+                       interrupts = <GIC_SPI 307 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "msi";
                        #interrupt-cells = <1>;
                        interrupt-map-mask = <0 0 0 0x7>;
                        phys = <&pcie1_lane>;
                        phy-names = "pciephy";
 
-                       perst-gpio = <&tlmm 82 GPIO_ACTIVE_LOW>;
-                       enable-gpio = <&tlmm 84 GPIO_ACTIVE_HIGH>;
+                       perst-gpios = <&tlmm 82 GPIO_ACTIVE_LOW>;
+                       wake-gpios = <&tlmm 84 GPIO_ACTIVE_HIGH>;
 
                        pinctrl-names = "default";
                        pinctrl-0 = <&pcie1_default_state>;
                        ranges = <0x01000000 0x0 0x64200000 0x0 0x64200000 0x0 0x100000>,
                                 <0x02000000 0x0 0x64300000 0x0 0x64300000 0x0 0x3d00000>;
 
-                       interrupts = <GIC_SPI 236 IRQ_TYPE_EDGE_RISING>;
+                       interrupts = <GIC_SPI 243 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "msi";
                        #interrupt-cells = <1>;
                        interrupt-map-mask = <0 0 0 0x7>;
                        phys = <&pcie2_lane>;
                        phy-names = "pciephy";
 
-                       perst-gpio = <&tlmm 85 GPIO_ACTIVE_LOW>;
-                       enable-gpio = <&tlmm 87 GPIO_ACTIVE_HIGH>;
+                       perst-gpios = <&tlmm 85 GPIO_ACTIVE_LOW>;
+                       wake-gpios = <&tlmm 87 GPIO_ACTIVE_HIGH>;
 
                        pinctrl-names = "default";
                        pinctrl-0 = <&pcie2_default_state>;
                                apr {
                                        compatible = "qcom,apr-v2";
                                        qcom,glink-channels = "apr_audio_svc";
-                                       qcom,apr-domain = <APR_DOMAIN_ADSP>;
+                                       qcom,domain = <APR_DOMAIN_ADSP>;
                                        #address-cells = <1>;
                                        #size-cells = <0>;
 
 
                        clocks = <&rpmhcc RPMH_CXO_CLK>, <&gcc GPLL0>;
                        clock-names = "xo", "alternate";
-
+                       interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "dcvsh-irq-0", "dcvsh-irq-1", "dcvsh-irq-2";
                        #freq-domain-cells = <1>;
                };
        };
                        };
                };
 
-               gpu-thermal-top {
+               gpu-top-thermal {
                        polling-delay-passive = <250>;
                        polling-delay = <1000>;
 
                        };
                };
 
-               gpu-thermal-bottom {
+               gpu-bottom-thermal {
                        polling-delay-passive = <250>;
                        polling-delay = <1000>;
 
index 53b39e7..4fb835e 100644 (file)
                        interconnect-names = "memory",
                                             "config";
 
+                       qcom,qmp = <&aoss_qmp>;
+
                        qcom,smem-states = <&ipa_smp2p_out 0>,
                                           <&ipa_smp2p_out 1>;
                        qcom,smem-state-names = "ipa-clock-enabled-valid",
                        qcom,tcs-offset = <0xd00>;
                        qcom,drv-id = <2>;
                        qcom,tcs-config = <ACTIVE_TCS  2>, <SLEEP_TCS   3>,
-                                         <WAKE_TCS    3>, <CONTROL_TCS 1>;
+                                         <WAKE_TCS    3>, <CONTROL_TCS 0>;
 
                        rpmhcc: clock-controller {
                                compatible = "qcom,sm8350-rpmh-clk";
                        };
                };
 
-               gpu-thermal-top {
+               gpu-top-thermal {
                        polling-delay-passive = <250>;
                        polling-delay = <1000>;
 
                        };
                };
 
-               gpu-thermal-bottom {
+               gpu-bottom-thermal {
                        polling-delay-passive = <250>;
                        polling-delay = <1000>;
 
                        };
                };
 
-               modem1-thermal-top {
+               modem1-top-thermal {
                        polling-delay-passive = <250>;
                        polling-delay = <1000>;
 
                        };
                };
 
-               modem2-thermal-top {
+               modem2-top-thermal {
                        polling-delay-passive = <250>;
                        polling-delay = <1000>;
 
                        };
                };
 
-               modem3-thermal-top {
+               modem3-top-thermal {
                        polling-delay-passive = <250>;
                        polling-delay = <1000>;
 
                        };
                };
 
-               modem4-thermal-top {
+               modem4-top-thermal {
                        polling-delay-passive = <250>;
                        polling-delay = <1000>;
 
                        };
                };
 
-               camera-thermal-top {
+               camera-top-thermal {
                        polling-delay-passive = <250>;
                        polling-delay = <1000>;
 
                        };
                };
 
-               cam-thermal-bottom {
+               cam-bottom-thermal {
                        polling-delay-passive = <250>;
                        polling-delay = <1000>;
 
diff --git a/arch/arm64/boot/dts/qcom/sm8450-hdk.dts b/arch/arm64/boot/dts/qcom/sm8450-hdk.dts
new file mode 100644 (file)
index 0000000..f0fcb14
--- /dev/null
@@ -0,0 +1,405 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2022, Linaro Limited
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
+#include "sm8450.dtsi"
+
+/ {
+       model = "Qualcomm Technologies, Inc. SM8450 HDK";
+       compatible = "qcom,sm8450-hdk", "qcom,sm8450";
+
+       aliases {
+               serial0 = &uart7;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       vph_pwr: vph-pwr-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "vph_pwr";
+               regulator-min-microvolt = <3700000>;
+               regulator-max-microvolt = <3700000>;
+
+               regulator-always-on;
+               regulator-boot-on;
+       };
+};
+
+&apps_rsc {
+       pm8350-rpmh-regulators {
+               compatible = "qcom,pm8350-rpmh-regulators";
+               qcom,pmic-id = "b";
+
+               vdd-s1-supply = <&vph_pwr>;
+               vdd-s2-supply = <&vph_pwr>;
+               vdd-s3-supply = <&vph_pwr>;
+               vdd-s4-supply = <&vph_pwr>;
+               vdd-s5-supply = <&vph_pwr>;
+               vdd-s6-supply = <&vph_pwr>;
+               vdd-s7-supply = <&vph_pwr>;
+               vdd-s8-supply = <&vph_pwr>;
+               vdd-s9-supply = <&vph_pwr>;
+               vdd-s10-supply = <&vph_pwr>;
+               vdd-s11-supply = <&vph_pwr>;
+               vdd-s12-supply = <&vph_pwr>;
+
+               vdd-l1-l4-supply = <&vreg_s11b_0p95>;
+               vdd-l2-l7-supply = <&vreg_bob>;
+               vdd-l3-l5-supply = <&vreg_bob>;
+               vdd-l6-l9-l10-supply = <&vreg_s12b_1p25>;
+               vdd-l8-supply = <&vreg_s2h_0p95>;
+
+               vreg_s10b_1p8: smps10 {
+                       regulator-name = "vreg_s10b_1p8";
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+               };
+
+               vreg_s11b_0p95: smps11 {
+                       regulator-name = "vreg_s11b_0p95";
+                       regulator-min-microvolt = <966000>;
+                       regulator-max-microvolt = <1104000>;
+               };
+
+               vreg_s12b_1p25: smps12 {
+                       regulator-name = "vreg_s12b_1p25";
+                       regulator-min-microvolt = <1350000>;
+                       regulator-max-microvolt = <1400000>;
+               };
+
+               vreg_l1b_0p91: ldo1 {
+                       regulator-name = "vreg_l1b_0p91";
+                       regulator-min-microvolt = <912000>;
+                       regulator-max-microvolt = <920000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l2b_3p07: ldo2 {
+                       regulator-name = "vreg_l2b_3p07";
+                       regulator-min-microvolt = <3072000>;
+                       regulator-max-microvolt = <3072000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l3b_0p9: ldo3 {
+                       regulator-name = "vreg_l3b_0p9";
+                       regulator-min-microvolt = <904000>;
+                       regulator-max-microvolt = <904000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l5b_0p88: ldo5 {
+                       regulator-name = "vreg_l5b_0p88";
+                       regulator-min-microvolt = <880000>;
+                       regulator-max-microvolt = <888000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l6b_1p2: ldo6 {
+                       regulator-name = "vreg_l6b_1p2";
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l7b_2p5: ldo7 {
+                       regulator-name = "vreg_l7b_2p5";
+                       regulator-min-microvolt = <2504000>;
+                       regulator-max-microvolt = <2504000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l9b_1p2: ldo9 {
+                       regulator-name = "vreg_l9b_1p2";
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+       };
+
+       pm8350c-rpmh-regulators {
+               compatible = "qcom,pm8350c-rpmh-regulators";
+               qcom,pmic-id = "c";
+
+               vdd-s1-supply = <&vph_pwr>;
+               vdd-s2-supply = <&vph_pwr>;
+               vdd-s3-supply = <&vph_pwr>;
+               vdd-s4-supply = <&vph_pwr>;
+               vdd-s5-supply = <&vph_pwr>;
+               vdd-s6-supply = <&vph_pwr>;
+               vdd-s7-supply = <&vph_pwr>;
+               vdd-s8-supply = <&vph_pwr>;
+               vdd-s9-supply = <&vph_pwr>;
+               vdd-s10-supply = <&vph_pwr>;
+
+               vdd-l1-l12-supply = <&vreg_bob>;
+               vdd-l2-l8-supply = <&vreg_bob>;
+               vdd-l3-l4-l5-l7-l13-supply = <&vreg_bob>;
+               vdd-l6-l9-l11-supply = <&vreg_bob>;
+               vdd-l10-supply = <&vreg_s12b_1p25>;
+
+               vdd-bob-supply = <&vph_pwr>;
+
+               vreg_s1c_1p86: smps1 {
+                       regulator-name = "vreg_s1c_1p86";
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <2024000>;
+               };
+
+               vreg_s10c_1p05: smps10 {
+                       regulator-name = "vreg_s10c_1p05";
+                       regulator-min-microvolt = <1000000>;
+                       regulator-max-microvolt = <1100000>;
+               };
+
+               vreg_bob: bob {
+                       regulator-name = "vreg_bob";
+                       regulator-min-microvolt = <3008000>;
+                       regulator-max-microvolt = <3960000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
+               };
+
+               vreg_l1c_1p8: ldo1 {
+                       regulator-name = "vreg_l1c_1p8";
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l3c_3p0: ldo3 {
+                       regulator-name = "vreg_l3c_3p0";
+                       regulator-min-microvolt = <3296000>;
+                       regulator-max-microvolt = <3304000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l4c_1p8: ldo4 {
+                       regulator-name = "vreg_l4c_1p8";
+                       regulator-min-microvolt = <1704000>;
+                       regulator-max-microvolt = <3000000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l5c_1p8: ldo5 {
+                       regulator-name = "vreg_l5c_1p8";
+                       regulator-min-microvolt = <1704000>;
+                       regulator-max-microvolt = <3000000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l6c_1p8: ldo6 {
+                       regulator-name = "vreg_l6c_1p8";
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <3008000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l7c_3p0: ldo7 {
+                       regulator-name = "vreg_l7c_3p0";
+                       regulator-min-microvolt = <3008000>;
+                       regulator-max-microvolt = <3008000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l8c_1p8: ldo8 {
+                       regulator-name = "vreg_l8c_1p8";
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l9c_2p96: ldo9 {
+                       regulator-name = "vreg_l9c_2p96";
+                       regulator-min-microvolt = <2960000>;
+                       regulator-max-microvolt = <3008000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l12c_1p8: ldo12 {
+                       regulator-name = "vreg_l12c_1p8";
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1968000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l13c_3p0: ldo13 {
+                       regulator-name = "vreg_l13c_3p0";
+                       regulator-min-microvolt = <3000000>;
+                       regulator-max-microvolt = <3000000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+       };
+
+       pm8450-rpmh-regulators {
+               compatible = "qcom,pm8450-rpmh-regulators";
+               qcom,pmic-id = "h";
+
+               vdd-s1-supply = <&vph_pwr>;
+               vdd-s2-supply = <&vph_pwr>;
+               vdd-s3-supply = <&vph_pwr>;
+               vdd-s4-supply = <&vph_pwr>;
+               vdd-s5-supply = <&vph_pwr>;
+               vdd-s6-supply = <&vph_pwr>;
+
+               vdd-l2-supply = <&vreg_bob>;
+               vdd-l3-supply = <&vreg_bob>;
+               vdd-l4-supply = <&vreg_bob>;
+
+               vreg_s2h_0p95: smps2 {
+                       regulator-name = "vreg_s2h_0p95";
+                       regulator-min-microvolt = <848000>;
+                       regulator-max-microvolt = <1104000>;
+               };
+
+               vreg_s3h_0p5: smps3 {
+                       regulator-name = "vreg_s3h_0p5";
+                       regulator-min-microvolt = <500000>;
+                       regulator-max-microvolt = <500000>;
+               };
+
+               vreg_l2h_0p91: ldo2 {
+                       regulator-name = "vreg_l2h_0p91";
+                       regulator-min-microvolt = <880000>;
+                       regulator-max-microvolt = <912000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l3h_0p91: ldo3 {
+                       regulator-name = "vreg_l3h_0p91";
+                       regulator-min-microvolt = <912000>;
+                       regulator-max-microvolt = <912000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+       };
+
+       pmr735a-rpmh-regulators {
+               compatible = "qcom,pmr735a-rpmh-regulators";
+               qcom,pmic-id = "e";
+
+               vdd-s1-supply = <&vph_pwr>;
+               vdd-s2-supply = <&vph_pwr>;
+               vdd-s3-supply = <&vph_pwr>;
+
+               vdd-l1-l2-supply = <&vreg_s2e_0p85>;
+               vdd-l3-supply = <&vreg_s1e_1p25>;
+               vdd-l4-supply = <&vreg_s1c_1p86>;
+               vdd-l5-l6-supply = <&vreg_s1c_1p86>;
+               vdd-l7-bob-supply = <&vreg_bob>;
+
+               vreg_s1e_1p25: smps1 {
+                       regulator-name = "vreg_s1e_1p25";
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1296000>;
+               };
+
+               vreg_s2e_0p85: smps2 {
+                       regulator-name = "vreg_s2e_0p85";
+                       regulator-min-microvolt = <500000>;
+                       regulator-max-microvolt = <1040000>;
+               };
+
+               vreg_l1e_0p8: ldo1 {
+                       regulator-name = "vreg_l1e_0p8";
+                       regulator-min-microvolt = <800000>;
+                       regulator-max-microvolt = <800000>;
+               };
+
+               vreg_l2e_0p8: ldo2 {
+                       regulator-name = "vreg_l2e_0p8";
+                       regulator-min-microvolt = <800000>;
+                       regulator-max-microvolt = <800000>;
+               };
+
+               vreg_l3e_1p2: ldo3 {
+                       regulator-name = "vreg_l3e_1p2";
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+               };
+
+               vreg_l4e_1p7: ldo4 {
+                       regulator-name = "vreg_l4e_1p7";
+                       regulator-min-microvolt = <1776000>;
+                       regulator-max-microvolt = <1776000>;
+               };
+
+               vreg_l5e_0p88: ldo5 {
+                       regulator-name = "vreg_l5e_0p88";
+                       regulator-min-microvolt = <880000>;
+                       regulator-max-microvolt = <880000>;
+               };
+
+               vreg_l6e_1p2: ldo6 {
+                       regulator-name = "vreg_l6e_1p2";
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+               };
+
+               vreg_l7e_2p8: ldo7 {
+                       regulator-name = "vreg_l7e_2p8";
+                       regulator-min-microvolt = <2800000>;
+                       regulator-max-microvolt = <2800000>;
+               };
+       };
+};
+
+&qupv3_id_0 {
+       status = "okay";
+};
+
+&tlmm {
+       gpio-reserved-ranges = <28 4>, <36 4>;
+};
+
+&uart7 {
+       status = "okay";
+};
+
+&ufs_mem_hc {
+       status = "okay";
+
+       reset-gpios = <&tlmm 210 GPIO_ACTIVE_LOW>;
+
+       vcc-supply = <&vreg_l7b_2p5>;
+       vcc-max-microamp = <1100000>;
+       vccq-supply = <&vreg_l9b_1p2>;
+       vccq-max-microamp = <1200000>;
+};
+
+&ufs_mem_phy {
+       status = "okay";
+
+       vdda-phy-supply = <&vreg_l5b_0p88>;
+       vdda-pll-supply = <&vreg_l6b_1p2>;
+       vdda-max-microamp = <173000>;
+       vdda-pll-max-microamp = <24900>;
+};
+
+&usb_1 {
+       status = "okay";
+};
+
+&usb_1_dwc3 {
+       dr_mode = "peripheral";
+};
+
+&usb_1_hsphy {
+       status = "okay";
+
+       vdda-pll-supply = <&vreg_l5b_0p88>;
+       vdda18-supply = <&vreg_l1c_1p8>;
+       vdda33-supply = <&vreg_l2b_3p07>;
+};
+
+&usb_1_qmpphy {
+       status = "okay";
+
+       vdda-phy-supply = <&vreg_l6b_1p2>;
+       vdda-pll-supply = <&vreg_l1b_0p91>;
+};
index b68ab24..9526632 100644 (file)
        status = "okay";
 };
 
+&remoteproc_adsp {
+       status = "okay";
+       firmware-name = "qcom/sm8450/adsp.mbn";
+};
+
+&remoteproc_cdsp {
+       status = "okay";
+       firmware-name = "qcom/sm8450/cdsp.mbn";
+};
+
+&remoteproc_mpss {
+       status = "okay";
+       firmware-name = "qcom/sm8450/modem.mbn";
+};
+
+&remoteproc_slpi {
+       status = "okay";
+       firmware-name = "qcom/sm8450/slpi.mbn";
+};
+
 &tlmm {
        gpio-reserved-ranges = <28 4>, <36 4>;
 };
index 10c25ad..0cd5af8 100644 (file)
@@ -7,7 +7,9 @@
 #include <dt-bindings/clock/qcom,gcc-sm8450.h>
 #include <dt-bindings/clock/qcom,rpmh.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/mailbox/qcom-ipcc.h>
 #include <dt-bindings/power/qcom-rpmpd.h>
+#include <dt-bindings/interconnect/qcom,sm8450.h>
 #include <dt-bindings/soc/qcom,rpmh-rsc.h>
 
 / {
                                compatible = "arm,idle-state";
                                idle-state-name = "silver-rail-power-collapse";
                                arm,psci-suspend-param = <0x40000004>;
-                               entry-latency-us = <274>;
-                               exit-latency-us = <480>;
-                               min-residency-us = <3934>;
+                               entry-latency-us = <800>;
+                               exit-latency-us = <750>;
+                               min-residency-us = <4090>;
                                local-timer-stop;
                        };
 
                                compatible = "arm,idle-state";
                                idle-state-name = "gold-rail-power-collapse";
                                arm,psci-suspend-param = <0x40000004>;
-                               entry-latency-us = <327>;
-                               exit-latency-us = <1502>;
-                               min-residency-us = <4488>;
+                               entry-latency-us = <600>;
+                               exit-latency-us = <1550>;
+                               min-residency-us = <4791>;
                                local-timer-stop;
                        };
                };
                        CLUSTER_SLEEP_0: cluster-sleep-0 {
                                compatible = "domain-idle-state";
                                idle-state-name = "cluster-l3-off";
-                               arm,psci-suspend-param = <0x4100c344>;
-                               entry-latency-us = <584>;
-                               exit-latency-us = <2332>;
-                               min-residency-us = <6118>;
+                               arm,psci-suspend-param = <0x41000044>;
+                               entry-latency-us = <1050>;
+                               exit-latency-us = <2500>;
+                               min-residency-us = <5309>;
                                local-timer-stop;
                        };
 
                                compatible = "domain-idle-state";
                                idle-state-name = "cluster-power-collapse";
                                arm,psci-suspend-param = <0x4100c344>;
-                               entry-latency-us = <2893>;
-                               exit-latency-us = <4023>;
-                               min-residency-us = <9987>;
+                               entry-latency-us = <2700>;
+                               exit-latency-us = <3500>;
+                               min-residency-us = <13959>;
                                local-timer-stop;
                        };
                };
                };
        };
 
+       clk_virt: interconnect@0 {
+               compatible = "qcom,sm8450-clk-virt";
+               #interconnect-cells = <2>;
+               qcom,bcm-voters = <&apps_bcm_voter>;
+       };
+
+       mc_virt: interconnect@1 {
+               compatible = "qcom,sm8450-mc-virt";
+               #interconnect-cells = <2>;
+               qcom,bcm-voters = <&apps_bcm_voter>;
+       };
+
        memory@a0000000 {
                device_type = "memory";
                /* We expect the bootloader to fill in the size */
 
                CLUSTER_PD: cpu-cluster0 {
                        #power-domain-cells = <0>;
-                       domain-idle-states = <&CLUSTER_SLEEP_0>;
+                       domain-idle-states = <&CLUSTER_SLEEP_0>, <&CLUSTER_SLEEP_1>;
                };
        };
 
                        no-map;
                };
 
+               rmtfs_mem: memory@9fd00000 {
+                       compatible = "qcom,rmtfs-mem";
+                       reg = <0x0 0x9fd00000 0x0 0x280000>;
+                       no-map;
+
+                       qcom,client-id = <1>;
+                       qcom,vmid = <15>;
+               };
+
                global_sync_mem: memory@a6f00000 {
                        reg = <0x0 0xa6f00000 0x0 0x100000>;
                        no-map;
                };
        };
 
+       smp2p-adsp {
+               compatible = "qcom,smp2p";
+               qcom,smem = <443>, <429>;
+               interrupts-extended = <&ipcc IPCC_CLIENT_LPASS
+                                            IPCC_MPROC_SIGNAL_SMP2P
+                                            IRQ_TYPE_EDGE_RISING>;
+               mboxes = <&ipcc IPCC_CLIENT_LPASS
+                               IPCC_MPROC_SIGNAL_SMP2P>;
+
+               qcom,local-pid = <0>;
+               qcom,remote-pid = <2>;
+
+               smp2p_adsp_out: master-kernel {
+                       qcom,entry-name = "master-kernel";
+                       #qcom,smem-state-cells = <1>;
+               };
+
+               smp2p_adsp_in: slave-kernel {
+                       qcom,entry-name = "slave-kernel";
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+       };
+
+       smp2p-cdsp {
+               compatible = "qcom,smp2p";
+               qcom,smem = <94>, <432>;
+               interrupts-extended = <&ipcc IPCC_CLIENT_CDSP
+                                            IPCC_MPROC_SIGNAL_SMP2P
+                                            IRQ_TYPE_EDGE_RISING>;
+               mboxes = <&ipcc IPCC_CLIENT_CDSP
+                               IPCC_MPROC_SIGNAL_SMP2P>;
+
+               qcom,local-pid = <0>;
+               qcom,remote-pid = <5>;
+
+               smp2p_cdsp_out: master-kernel {
+                       qcom,entry-name = "master-kernel";
+                       #qcom,smem-state-cells = <1>;
+               };
+
+               smp2p_cdsp_in: slave-kernel {
+                       qcom,entry-name = "slave-kernel";
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+       };
+
+       smp2p-modem {
+               compatible = "qcom,smp2p";
+               qcom,smem = <435>, <428>;
+               interrupts-extended = <&ipcc IPCC_CLIENT_MPSS
+                                            IPCC_MPROC_SIGNAL_SMP2P
+                                            IRQ_TYPE_EDGE_RISING>;
+               mboxes = <&ipcc IPCC_CLIENT_MPSS
+                               IPCC_MPROC_SIGNAL_SMP2P>;
+
+               qcom,local-pid = <0>;
+               qcom,remote-pid = <1>;
+
+               smp2p_modem_out: master-kernel {
+                       qcom,entry-name = "master-kernel";
+                       #qcom,smem-state-cells = <1>;
+               };
+
+               smp2p_modem_in: slave-kernel {
+                       qcom,entry-name = "slave-kernel";
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+
+               ipa_smp2p_out: ipa-ap-to-modem {
+                       qcom,entry-name = "ipa";
+                       #qcom,smem-state-cells = <1>;
+               };
+
+               ipa_smp2p_in: ipa-modem-to-ap {
+                       qcom,entry-name = "ipa";
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+       };
+
+       smp2p-slpi {
+               compatible = "qcom,smp2p";
+               qcom,smem = <481>, <430>;
+               interrupts-extended = <&ipcc IPCC_CLIENT_SLPI
+                                            IPCC_MPROC_SIGNAL_SMP2P
+                                            IRQ_TYPE_EDGE_RISING>;
+               mboxes = <&ipcc IPCC_CLIENT_SLPI
+                               IPCC_MPROC_SIGNAL_SMP2P>;
+
+               qcom,local-pid = <0>;
+               qcom,remote-pid = <3>;
+
+               smp2p_slpi_out: master-kernel {
+                       qcom,entry-name = "master-kernel";
+                       #qcom,smem-state-cells = <1>;
+               };
+
+               smp2p_slpi_in: slave-kernel {
+                       qcom,entry-name = "slave-kernel";
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+       };
+
        soc: soc@0 {
                #address-cells = <2>;
                #size-cells = <2>;
                        };
                };
 
+               config_noc: interconnect@1500000 {
+                       compatible = "qcom,sm8450-config-noc";
+                       reg = <0 0x01500000 0 0x1c000>;
+                       #interconnect-cells = <2>;
+                       qcom,bcm-voters = <&apps_bcm_voter>;
+               };
+
+               system_noc: interconnect@1680000 {
+                       compatible = "qcom,sm8450-system-noc";
+                       reg = <0 0x01680000 0 0x1e200>;
+                       #interconnect-cells = <2>;
+                       qcom,bcm-voters = <&apps_bcm_voter>;
+               };
+
+               pcie_noc: interconnect@16c0000 {
+                       compatible = "qcom,sm8450-pcie-anoc";
+                       reg = <0 0x016c0000 0 0xe280>;
+                       #interconnect-cells = <2>;
+                       qcom,bcm-voters = <&apps_bcm_voter>;
+               };
+
+               aggre1_noc: interconnect@16e0000 {
+                       compatible = "qcom,sm8450-aggre1-noc";
+                       reg = <0 0x016e0000 0 0x1c080>;
+                       #interconnect-cells = <2>;
+                       clocks = <&gcc GCC_AGGRE_UFS_PHY_AXI_CLK>,
+                                <&gcc GCC_AGGRE_USB3_PRIM_AXI_CLK>;
+                       qcom,bcm-voters = <&apps_bcm_voter>;
+               };
+
+               aggre2_noc: interconnect@1700000 {
+                       compatible = "qcom,sm8450-aggre2-noc";
+                       reg = <0 0x01700000 0 0x31080>;
+                       #interconnect-cells = <2>;
+                       qcom,bcm-voters = <&apps_bcm_voter>;
+                       clocks = <&gcc GCC_AGGRE_NOC_PCIE_0_AXI_CLK>,
+                                <&gcc GCC_AGGRE_NOC_PCIE_1_AXI_CLK>,
+                                <&gcc GCC_AGGRE_UFS_PHY_AXI_CLK>,
+                                <&rpmhcc RPMH_IPA_CLK>;
+               };
+
+               mmss_noc: interconnect@1740000 {
+                       compatible = "qcom,sm8450-mmss-noc";
+                       reg = <0 0x01740000 0 0x1f080>;
+                       #interconnect-cells = <2>;
+                       qcom,bcm-voters = <&apps_bcm_voter>;
+               };
+
                tcsr_mutex: hwlock@1f40000 {
                        compatible = "qcom,tcsr-mutex";
                        reg = <0x0 0x01f40000 0x0 0x40000>;
                        };
                };
 
+               remoteproc_slpi: remoteproc@2400000 {
+                       compatible = "qcom,sm8450-slpi-pas";
+                       reg = <0 0x02400000 0 0x4000>;
+
+                       interrupts-extended = <&pdc 9 IRQ_TYPE_LEVEL_HIGH>,
+                                             <&smp2p_slpi_in 0 IRQ_TYPE_EDGE_RISING>,
+                                             <&smp2p_slpi_in 1 IRQ_TYPE_EDGE_RISING>,
+                                             <&smp2p_slpi_in 2 IRQ_TYPE_EDGE_RISING>,
+                                             <&smp2p_slpi_in 3 IRQ_TYPE_EDGE_RISING>;
+                       interrupt-names = "wdog", "fatal", "ready",
+                                         "handover", "stop-ack";
+
+                       clocks = <&rpmhcc RPMH_CXO_CLK>;
+                       clock-names = "xo";
+
+                       power-domains = <&rpmhpd SM8450_LCX>,
+                                       <&rpmhpd SM8450_LMX>;
+                       power-domain-names = "lcx", "lmx";
+
+                       memory-region = <&slpi_mem>;
+
+                       qcom,qmp = <&aoss_qmp>;
+
+                       qcom,smem-states = <&smp2p_slpi_out 0>;
+                       qcom,smem-state-names = "stop";
+
+                       status = "disabled";
+
+                       glink-edge {
+                               interrupts-extended = <&ipcc IPCC_CLIENT_SLPI
+                                                            IPCC_MPROC_SIGNAL_GLINK_QMP
+                                                            IRQ_TYPE_EDGE_RISING>;
+                               mboxes = <&ipcc IPCC_CLIENT_SLPI
+                                               IPCC_MPROC_SIGNAL_GLINK_QMP>;
+
+                               label = "slpi";
+                               qcom,remote-pid = <3>;
+                       };
+               };
+
+               remoteproc_adsp: remoteproc@30000000 {
+                       compatible = "qcom,sm8450-adsp-pas";
+                       reg = <0 0x030000000 0 0x100>;
+
+                       interrupts-extended = <&pdc 6 IRQ_TYPE_LEVEL_HIGH>,
+                                             <&smp2p_adsp_in 0 IRQ_TYPE_EDGE_RISING>,
+                                             <&smp2p_adsp_in 1 IRQ_TYPE_EDGE_RISING>,
+                                             <&smp2p_adsp_in 2 IRQ_TYPE_EDGE_RISING>,
+                                             <&smp2p_adsp_in 3 IRQ_TYPE_EDGE_RISING>;
+                       interrupt-names = "wdog", "fatal", "ready",
+                                         "handover", "stop-ack";
+
+                       clocks = <&rpmhcc RPMH_CXO_CLK>;
+                       clock-names = "xo";
+
+                       power-domains = <&rpmhpd SM8450_LCX>,
+                                       <&rpmhpd SM8450_LMX>;
+                       power-domain-names = "lcx", "lmx";
+
+                       memory-region = <&adsp_mem>;
+
+                       qcom,qmp = <&aoss_qmp>;
+
+                       qcom,smem-states = <&smp2p_adsp_out 0>;
+                       qcom,smem-state-names = "stop";
+
+                       status = "disabled";
+
+                       remoteproc_adsp_glink: glink-edge {
+                               interrupts-extended = <&ipcc IPCC_CLIENT_LPASS
+                                                            IPCC_MPROC_SIGNAL_GLINK_QMP
+                                                            IRQ_TYPE_EDGE_RISING>;
+                               mboxes = <&ipcc IPCC_CLIENT_LPASS
+                                               IPCC_MPROC_SIGNAL_GLINK_QMP>;
+
+                               label = "lpass";
+                               qcom,remote-pid = <2>;
+                       };
+               };
+
+               remoteproc_cdsp: remoteproc@32300000 {
+                       compatible = "qcom,sm8450-cdsp-pas";
+                       reg = <0 0x032300000 0 0x1400000>;
+
+                       interrupts-extended = <&intc GIC_SPI 578 IRQ_TYPE_LEVEL_HIGH>,
+                                             <&smp2p_cdsp_in 0 IRQ_TYPE_EDGE_RISING>,
+                                             <&smp2p_cdsp_in 1 IRQ_TYPE_EDGE_RISING>,
+                                             <&smp2p_cdsp_in 2 IRQ_TYPE_EDGE_RISING>,
+                                             <&smp2p_cdsp_in 3 IRQ_TYPE_EDGE_RISING>;
+                       interrupt-names = "wdog", "fatal", "ready",
+                                         "handover", "stop-ack";
+
+                       clocks = <&rpmhcc RPMH_CXO_CLK>;
+                       clock-names = "xo";
+
+                       power-domains = <&rpmhpd SM8450_CX>,
+                                       <&rpmhpd SM8450_MXC>;
+                       power-domain-names = "cx", "mxc";
+
+                       memory-region = <&cdsp_mem>;
+
+                       qcom,qmp = <&aoss_qmp>;
+
+                       qcom,smem-states = <&smp2p_cdsp_out 0>;
+                       qcom,smem-state-names = "stop";
+
+                       status = "disabled";
+
+                       glink-edge {
+                               interrupts-extended = <&ipcc IPCC_CLIENT_CDSP
+                                                            IPCC_MPROC_SIGNAL_GLINK_QMP
+                                                            IRQ_TYPE_EDGE_RISING>;
+                               mboxes = <&ipcc IPCC_CLIENT_CDSP
+                                               IPCC_MPROC_SIGNAL_GLINK_QMP>;
+
+                               label = "cdsp";
+                               qcom,remote-pid = <5>;
+                       };
+               };
+
+               remoteproc_mpss: remoteproc@4080000 {
+                       compatible = "qcom,sm8450-mpss-pas";
+                       reg = <0x0 0x04080000 0x0 0x4040>;
+
+                       interrupts-extended = <&intc GIC_SPI 264 IRQ_TYPE_LEVEL_HIGH>,
+                                             <&smp2p_modem_in 0 IRQ_TYPE_EDGE_RISING>,
+                                             <&smp2p_modem_in 1 IRQ_TYPE_EDGE_RISING>,
+                                             <&smp2p_modem_in 2 IRQ_TYPE_EDGE_RISING>,
+                                             <&smp2p_modem_in 3 IRQ_TYPE_EDGE_RISING>,
+                                             <&smp2p_modem_in 7 IRQ_TYPE_EDGE_RISING>;
+                       interrupt-names = "wdog", "fatal", "ready", "handover",
+                                         "stop-ack", "shutdown-ack";
+
+                       clocks = <&rpmhcc RPMH_CXO_CLK>;
+                       clock-names = "xo";
+
+                       power-domains = <&rpmhpd 0>,
+                                       <&rpmhpd 12>;
+                       power-domain-names = "cx", "mss";
+
+                       memory-region = <&mpss_mem>;
+
+                       qcom,qmp = <&aoss_qmp>;
+
+                       qcom,smem-states = <&smp2p_modem_out 0>;
+                       qcom,smem-state-names = "stop";
+
+                       status = "disabled";
+
+                       glink-edge {
+                               interrupts-extended = <&ipcc IPCC_CLIENT_MPSS
+                                                            IPCC_MPROC_SIGNAL_GLINK_QMP
+                                                            IRQ_TYPE_EDGE_RISING>;
+                               mboxes = <&ipcc IPCC_CLIENT_MPSS
+                                               IPCC_MPROC_SIGNAL_GLINK_QMP>;
+                               interrupts = <GIC_SPI 449 IRQ_TYPE_EDGE_RISING>;
+                               label = "modem";
+                               qcom,remote-pid = <1>;
+                       };
+               };
+
                pdc: interrupt-controller@b220000 {
                        compatible = "qcom,sm8450-pdc", "qcom,pdc";
                        reg = <0 0x0b220000 0 0x30000>, <0 0x174000f0 0 0x64>;
                        interrupt-controller;
                };
 
+               aoss_qmp: power-controller@c300000 {
+                       compatible = "qcom,sm8450-aoss-qmp", "qcom,aoss-qmp";
+                       reg = <0 0x0c300000 0 0x400>;
+                       interrupts-extended = <&ipcc IPCC_CLIENT_AOP IPCC_MPROC_SIGNAL_GLINK_QMP
+                                                    IRQ_TYPE_EDGE_RISING>;
+                       mboxes = <&ipcc IPCC_CLIENT_AOP IPCC_MPROC_SIGNAL_GLINK_QMP>;
+
+                       #clock-cells = <0>;
+               };
+
+               ipcc: mailbox@ed18000 {
+                       compatible = "qcom,sm8450-ipcc", "qcom,ipcc";
+                       reg = <0 0x0ed18000 0 0x1000>;
+                       interrupts = <GIC_SPI 229 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-controller;
+                       #interrupt-cells = <3>;
+                       #mbox-cells = <2>;
+               };
+
                tlmm: pinctrl@f100000 {
                        compatible = "qcom,sm8450-tlmm";
                        reg = <0 0x0f100000 0 0x300000>;
                        #freq-domain-cells = <1>;
                };
 
+               gem_noc: interconnect@19100000 {
+                       compatible = "qcom,sm8450-gem-noc";
+                       reg = <0 0x19100000 0 0xbb800>;
+                       #interconnect-cells = <2>;
+                       qcom,bcm-voters = <&apps_bcm_voter>;
+               };
+
+               system-cache-controller@19200000 {
+                       compatible = "qcom,sm8450-llcc";
+                       reg = <0 0x19200000 0 0x580000>, <0 0x19a00000 0 0x80000>;
+                       reg-names = "llcc_base", "llcc_broadcast_base";
+                       interrupts = <GIC_SPI 266 IRQ_TYPE_LEVEL_HIGH>;
+               };
+
                ufs_mem_hc: ufshc@1d84000 {
                        compatible = "qcom,sm8450-ufshc", "qcom,ufshc",
                                     "jedec,ufs-2.0";
 
                        iommus = <&apps_smmu 0xe0 0x0>;
 
+                       interconnects = <&aggre1_noc MASTER_UFS_MEM &mc_virt SLAVE_EBI1>,
+                                       <&gem_noc MASTER_APPSS_PROC &config_noc SLAVE_UFS_MEM_CFG>;
+                       interconnect-names = "ufs-ddr", "cpu-ufs";
                        clock-names =
                                "core_clk",
                                "bus_aggr_clk",
                                phy-names = "usb2-phy", "usb3-phy";
                        };
                };
+
+               nsp_noc: interconnect@320c0000 {
+                       compatible = "qcom,sm8450-nsp-noc";
+                       reg = <0 0x320c0000 0 0x10000>;
+                       #interconnect-cells = <2>;
+                       qcom,bcm-voters = <&apps_bcm_voter>;
+               };
+
+               lpass_ag_noc: interconnect@3c40000 {
+                       compatible = "qcom,sm8450-lpass-ag-noc";
+                       reg = <0 0x3c40000 0 0x17200>;
+                       #interconnect-cells = <2>;
+                       qcom,bcm-voters = <&apps_bcm_voter>;
+               };
        };
 
        timer {
index 5bc8065..d000f6b 100644 (file)
@@ -75,4 +75,7 @@ dtb-$(CONFIG_ARCH_R8A77961) += r8a779m3-ulcb-kf.dtb
 
 dtb-$(CONFIG_ARCH_R8A77965) += r8a779m5-salvator-xs.dtb
 
+dtb-$(CONFIG_ARCH_R9A07G044) += r9a07g044c2-smarc.dtb
 dtb-$(CONFIG_ARCH_R9A07G044) += r9a07g044l2-smarc.dtb
+
+dtb-$(CONFIG_ARCH_R9A07G054) += r9a07g054l2-smarc.dtb
index 2692cc6..5ad6cd1 100644 (file)
                clocks = <&x304_clk>;
                clock-names = "xin";
 
-               assigned-clocks = <&versaclock6_bb 1>,
-                                  <&versaclock6_bb 2>,
-                                  <&versaclock6_bb 3>,
-                                  <&versaclock6_bb 4>;
-               assigned-clock-rates =  <24000000>, <24000000>, <24000000>, <24576000>;
+               assigned-clocks = <&versaclock6_bb 1>, <&versaclock6_bb 2>,
+                                 <&versaclock6_bb 3>, <&versaclock6_bb 4>;
+               assigned-clock-rates = <24000000>, <24000000>, <24000000>,
+                                      <24576000>;
 
                OUT1 {
                        idt,mode = <VC5_CMOS>;
index 0d13680..877d076 100644 (file)
@@ -77,7 +77,7 @@
 };
 
 &gpio6 {
-       usb_hub_reset {
+       usb-hub-reset-hog {
                gpio-hog;
                gpios = <10 GPIO_ACTIVE_HIGH>;
                output-high;
        vqmmc-supply = <&reg_1p8v>;
        non-removable;
        cap-power-off-card;
-       pm-ignore-notify;
        keep-power-in-suspend;
        mmc-pwrseq = <&wlan_pwrseq>;
        status = "okay";
diff --git a/arch/arm64/boot/dts/renesas/gmsl-cameras.dtsi b/arch/arm64/boot/dts/renesas/gmsl-cameras.dtsi
new file mode 100644 (file)
index 0000000..d45f072
--- /dev/null
@@ -0,0 +1,332 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2017 Ideas on Board <kieran.bingham@ideasonboard.com>
+ * Copyright (C) 2021 Jacopo Mondi <jacopo+renesas@jmondi.org>
+ *
+ * Device Tree Source (overlay) that describes GMSL camera connected to
+ * Fakra connectors for the Eagle V3M and Condor V3H (and compatible) boards.
+ *
+ * The following cameras are currently supported: RDACM20 and RDACM21.
+ *
+ * The board .dts file that include this has to select which cameras are in use
+ * by specifying the camera model with:
+ *
+ * #define GMSL_CAMERA_RDACM20
+ * or
+ * #define GMSL_CAMERA_RDACM21
+ *
+ * And which cameras are connected to the board by defining:
+ * for GMSL channel 0:
+ *        #define GMSL_CAMERA_0
+ *        #define GMSL_CAMERA_1
+ *        #define GMSL_CAMERA_2
+ *        #define GMSL_CAMERA_3
+ *
+ * for GMSL channel 1:
+ *        #define GMSL_CAMERA_4
+ *        #define GMSL_CAMERA_5
+ *        #define GMSL_CAMERA_6
+ *        #define GMSL_CAMERA_7
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+
+/* Validate the board file settings. */
+#if !defined(GMSL_CAMERA_RDACM20) && !defined(GMSL_CAMERA_RDACM21)
+#error "Camera model should be defined by the board file"
+#endif
+
+#if defined(GMSL_CAMERA_RDACM20) && defined(GMSL_CAMERA_RDACM21)
+#error "A single camera model should be selected"
+#endif
+
+#if !defined(GMSL_CAMERA_0) && !defined(GMSL_CAMERA_1) && \
+    !defined(GMSL_CAMERA_2) && !defined(GMSL_CAMERA_3) && \
+    !defined(GMSL_CAMERA_4) && !defined(GMSL_CAMERA_5) && \
+    !defined(GMSL_CAMERA_6) && !defined(GMSL_CAMERA_7)
+#error "At least one camera should be selected"
+#endif
+
+/* Deduce from the enabled cameras which GMSL channels are active. */
+#if defined(GMSL_CAMERA_0) || defined(GMSL_CAMERA_1) || \
+    defined(GMSL_CAMERA_2) || defined(GMSL_CAMERA_3)
+#define GMSL_0
+#endif
+
+#if defined(GMSL_CAMERA_4) || defined(GMSL_CAMERA_5) || \
+    defined(GMSL_CAMERA_6) || defined(GMSL_CAMERA_7)
+#define GMSL_1
+#endif
+
+/* Deduce the camera model compatible string. */
+#if defined(GMSL_CAMERA_RDACM20)
+#define GMSL_CAMERA_MODEL "imi,rdacm20"
+#elif defined(GMSL_CAMERA_RDACM21)
+#define GMSL_CAMERA_MODEL "imi,rdacm21"
+#endif
+
+#ifdef GMSL_0
+&vin0 {
+       status = "okay";
+};
+
+&vin1 {
+       status = "okay";
+};
+
+&vin2 {
+       status = "okay";
+};
+
+&vin3 {
+       status = "okay";
+};
+
+&gmsl0 {
+       status = "okay";
+
+#if defined(GMSL_CAMERA_RDACM21)
+       maxim,reverse-channel-microvolt = <100000>;
+#endif
+
+       ports {
+#ifdef GMSL_CAMERA_0
+               port@0 {
+                       max9286_in0: endpoint {
+                               remote-endpoint = <&fakra_con0>;
+                       };
+               };
+#endif
+
+#ifdef GMSL_CAMERA_1
+               port@1 {
+                       max9286_in1: endpoint{
+                               remote-endpoint = <&fakra_con1>;
+                       };
+
+               };
+#endif
+
+#ifdef GMSL_CAMERA_2
+               port@2 {
+                       max9286_in2: endpoint {
+                               remote-endpoint = <&fakra_con2>;
+                       };
+
+               };
+#endif
+
+#ifdef GMSL_CAMERA_3
+               port@3 {
+                       max9286_in3: endpoint {
+                               remote-endpoint = <&fakra_con3>;
+                       };
+
+               };
+#endif
+       };
+
+       i2c-mux {
+#ifdef GMSL_CAMERA_0
+               i2c@0 {
+                       status = "okay";
+
+                       camera@51 {
+                               compatible = GMSL_CAMERA_MODEL;
+                               reg = <0x51>, <0x61>;
+
+                               port {
+                                       fakra_con0: endpoint {
+                                               remote-endpoint = <&max9286_in0>;
+                                       };
+                               };
+                       };
+               };
+#endif
+
+#ifdef GMSL_CAMERA_1
+               i2c@1 {
+                       status = "okay";
+
+                       camera@52 {
+                               compatible = GMSL_CAMERA_MODEL;
+                               reg = <0x52>, <0x62>;
+
+                               port {
+                                       fakra_con1: endpoint {
+                                               remote-endpoint = <&max9286_in1>;
+                                       };
+                               };
+                       };
+               };
+#endif
+
+#ifdef GMSL_CAMERA_2
+               i2c@2 {
+                       status = "okay";
+
+                       camera@53 {
+                               compatible = GMSL_CAMERA_MODEL;
+                               reg = <0x53>, <0x63>;
+
+                               port {
+                                       fakra_con2: endpoint {
+                                               remote-endpoint = <&max9286_in2>;
+                                       };
+                               };
+                       };
+               };
+#endif
+
+#ifdef GMSL_CAMERA_3
+               i2c@3 {
+                       status = "okay";
+
+                       camera@54 {
+                               compatible = GMSL_CAMERA_MODEL;
+                               reg = <0x54>, <0x64>;
+
+                               port {
+                                       fakra_con3: endpoint {
+                                               remote-endpoint = <&max9286_in3>;
+                                       };
+                               };
+                       };
+               };
+#endif
+       };
+};
+#endif /* ifdef GMSL_0 */
+
+#ifdef GMSL_1
+&vin4 {
+       status = "okay";
+};
+
+&vin5 {
+       status = "okay";
+};
+
+&vin6 {
+       status = "okay";
+};
+
+&vin7 {
+       status = "okay";
+};
+
+&gmsl1 {
+       status = "okay";
+
+#if defined(GMSL_CAMERA_RDACM21)
+       maxim,reverse-channel-microvolt = <100000>;
+#endif
+
+       ports {
+#ifdef GMSL_CAMERA_4
+               port@0 {
+                       max9286_in4: endpoint {
+                               remote-endpoint = <&fakra_con4>;
+                       };
+               };
+#endif
+
+#ifdef GMSL_CAMERA_5
+               port@1 {
+                       max9286_in5: endpoint{
+                               remote-endpoint = <&fakra_con5>;
+                       };
+
+               };
+#endif
+
+#ifdef GMSL_CAMERA_6
+               port@2 {
+                       max9286_in6: endpoint {
+                               remote-endpoint = <&fakra_con6>;
+                       };
+
+               };
+#endif
+
+#ifdef GMSL_CAMERA_7
+               port@3 {
+                       max9286_in7: endpoint {
+                               remote-endpoint = <&fakra_con7>;
+                       };
+
+               };
+#endif
+       };
+
+       i2c-mux {
+#ifdef GMSL_CAMERA_4
+               i2c@0 {
+                       status = "okay";
+
+                       camera@55 {
+                               compatible = GMSL_CAMERA_MODEL;
+                               reg = <0x55>, <0x65>;
+
+                               port {
+                                       fakra_con4: endpoint {
+                                               remote-endpoint = <&max9286_in4>;
+                                       };
+                               };
+                       };
+               };
+#endif
+
+#ifdef GMSL_CAMERA_5
+               i2c@1 {
+                       status = "okay";
+
+                       camera@56 {
+                               compatible = GMSL_CAMERA_MODEL;
+                               reg = <0x56>, <0x66>;
+
+                               port {
+                                       fakra_con5: endpoint {
+                                               remote-endpoint = <&max9286_in5>;
+                                       };
+                               };
+                       };
+               };
+#endif
+
+#ifdef GMSL_CAMERA_6
+               i2c@2 {
+                       status = "okay";
+
+                       camera@57 {
+                               compatible = GMSL_CAMERA_MODEL;
+                               reg = <0x57>, <0x67>;
+
+                               port {
+                                       fakra_con6: endpoint {
+                                               remote-endpoint = <&max9286_in6>;
+                                       };
+                               };
+                       };
+               };
+#endif
+
+#ifdef GMSL_CAMERA_7
+               i2c@3 {
+                       status = "okay";
+
+                       camera@58 {
+                               compatible = GMSL_CAMERA_MODEL;
+                               reg = <0x58>, <0x68>;
+
+                               port {
+                                       fakra_con7: endpoint {
+                                               remote-endpoint = <&max9286_in7>;
+                                       };
+                               };
+                       };
+               };
+#endif
+       };
+};
+#endif /* ifdef GMSL_1 */
index 0c7e6f7..935d065 100644 (file)
 };
 
 &gpio6 {
-       usb1-reset {
+       usb1-reset-hog {
                gpio-hog;
                gpios = <10 GPIO_ACTIVE_LOW>;
                output-low;
index 40c5e8d..d66d17e 100644 (file)
@@ -20,7 +20,7 @@
         * When GP1_20 is LOW LVDS0 is connected to the LVDS connector
         * When GP1_20 is HIGH LVDS0 is connected to the LT8918L
         */
-       lvds-connector-en-gpio {
+       lvds-connector-en-hog {
                gpio-hog;
                gpios = <20 GPIO_ACTIVE_HIGH>;
                output-low;
index eda6a84..1284612 100644 (file)
                         * clkout       : #clock-cells = <0>;   <&rcar_sound>;
                         * clkout0/1/2/3: #clock-cells = <1>;   <&rcar_sound N>;
                         */
-                       compatible =  "renesas,rcar_sound-r8a774a1", "renesas,rcar_sound-gen3";
-                       reg =   <0 0xec500000 0 0x1000>, /* SCU */
-                               <0 0xec5a0000 0 0x100>,  /* ADG */
-                               <0 0xec540000 0 0x1000>, /* SSIU */
-                               <0 0xec541000 0 0x280>,  /* SSI */
-                               <0 0xec760000 0 0x200>;  /* Audio DMAC peri peri*/
+                       compatible = "renesas,rcar_sound-r8a774a1", "renesas,rcar_sound-gen3";
+                       reg = <0 0xec500000 0 0x1000>, /* SCU */
+                             <0 0xec5a0000 0 0x100>,  /* ADG */
+                             <0 0xec540000 0 0x1000>, /* SSIU */
+                             <0 0xec541000 0 0x280>,  /* SSI */
+                             <0 0xec760000 0 0x200>;  /* Audio DMAC peri peri*/
                        reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";
 
                        clocks = <&cpg CPG_MOD 1005>,
                                        dma-names = "rx", "tx";
                                };
                                ssiu40: ssiu-32 {
-                                       dmas =  <&audma0 0x71>, <&audma1 0x72>;
+                                       dmas = <&audma0 0x71>, <&audma1 0x72>;
                                        dma-names = "rx", "tx";
                                };
                                ssiu41: ssiu-33 {
index 3c0d59d..89d7083 100644 (file)
@@ -11,7 +11,7 @@
 
 / {
        model = "Beacon Embedded Works RZ/G2N Development Kit";
-       compatible =    "beacon,beacon-rzg2n", "renesas,r8a774b1";
+       compatible = "beacon,beacon-rzg2n", "renesas,r8a774b1";
 
        aliases {
                serial0 = &scif2;
index 44f79fb..a4b406a 100644 (file)
                         * clkout       : #clock-cells = <0>;   <&rcar_sound>;
                         * clkout0/1/2/3: #clock-cells = <1>;   <&rcar_sound N>;
                         */
-                       compatible =  "renesas,rcar_sound-r8a774b1", "renesas,rcar_sound-gen3";
+                       compatible = "renesas,rcar_sound-r8a774b1", "renesas,rcar_sound-gen3";
                        reg = <0 0xec500000 0 0x1000>, /* SCU */
                              <0 0xec5a0000 0 0x100>,  /* ADG */
                              <0 0xec540000 0 0x1000>, /* SSIU */
                                        dma-names = "rx", "tx";
                                };
                                ssiu40: ssiu-32 {
-                                       dmas =  <&audma0 0x71>, <&audma1 0x72>;
+                                       dmas = <&audma0 0x71>, <&audma1 0x72>;
                                        dma-names = "rx", "tx";
                                };
                                ssiu41: ssiu-33 {
index a7b27d0..c1812d1 100644 (file)
@@ -68,7 +68,7 @@
         * When GP0_17 is low LVDS[01] are connected to the LVDS connector
         * When GP0_17 is high LVDS[01] are connected to the LT8918L
         */
-       lvds-connector-en-gpio{
+       lvds-connector-en-hog {
                gpio-hog;
                gpios = <17 GPIO_ACTIVE_HIGH>;
                output-low;
index b8dcbbb..e123c8d 100644 (file)
                         */
                        compatible = "renesas,rcar_sound-r8a774c0",
                                     "renesas,rcar_sound-gen3";
-                       reg =   <0 0xec500000 0 0x1000>, /* SCU */
-                               <0 0xec5a0000 0 0x100>,  /* ADG */
-                               <0 0xec540000 0 0x1000>, /* SSIU */
-                               <0 0xec541000 0 0x280>,  /* SSI */
-                               <0 0xec760000 0 0x200>;  /* Audio DMAC peri peri*/
+                       reg = <0 0xec500000 0 0x1000>, /* SCU */
+                             <0 0xec5a0000 0 0x100>,  /* ADG */
+                             <0 0xec540000 0 0x1000>, /* SSIU */
+                             <0 0xec541000 0 0x280>,  /* SSI */
+                             <0 0xec760000 0 0x200>;  /* Audio DMAC peri peri*/
                        reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";
 
                        clocks = <&cpg CPG_MOD 1005>,
index 7b6649a..3e9ced3 100644 (file)
@@ -11,7 +11,7 @@
 
 / {
        model = "Beacon Embedded Works RZ/G2H Development Kit";
-       compatible =    "beacon,beacon-rzg2h", "renesas,r8a774e1";
+       compatible = "beacon,beacon-rzg2h", "renesas,r8a774e1";
 
        aliases {
                serial0 = &scif2;
index e6d8610..989c1c0 100644 (file)
                         * clkout       : #clock-cells = <0>;   <&rcar_sound>;
                         * clkout0/1/2/3: #clock-cells = <1>;   <&rcar_sound N>;
                         */
-                       compatible =  "renesas,rcar_sound-r8a774e1", "renesas,rcar_sound-gen3";
+                       compatible = "renesas,rcar_sound-r8a774e1", "renesas,rcar_sound-gen3";
                        reg = <0 0xec500000 0 0x1000>, /* SCU */
                              <0 0xec5a0000 0 0x100>,  /* ADG */
                              <0 0xec540000 0 0x1000>, /* SSIU */
                                        dma-names = "rx", "tx";
                                };
                                ssiu40: ssiu-32 {
-                                       dmas =  <&audma0 0x71>, <&audma1 0x72>;
+                                       dmas = <&audma0 0x71>, <&audma1 0x72>;
                                        dma-names = "rx", "tx";
                                };
                                ssiu41: ssiu-33 {
index 9265a57..4e87e87 100644 (file)
                         * clkout       : #clock-cells = <0>;   <&rcar_sound>;
                         * clkout0/1/2/3: #clock-cells = <1>;   <&rcar_sound N>;
                         */
-                       compatible =  "renesas,rcar_sound-r8a7795", "renesas,rcar_sound-gen3";
-                       reg =   <0 0xec500000 0 0x1000>, /* SCU */
-                               <0 0xec5a0000 0 0x100>,  /* ADG */
-                               <0 0xec540000 0 0x1000>, /* SSIU */
-                               <0 0xec541000 0 0x280>,  /* SSI */
-                               <0 0xec760000 0 0x200>;  /* Audio DMAC peri peri*/
+                       compatible = "renesas,rcar_sound-r8a7795", "renesas,rcar_sound-gen3";
+                       reg = <0 0xec500000 0 0x1000>, /* SCU */
+                             <0 0xec5a0000 0 0x100>,  /* ADG */
+                             <0 0xec540000 0 0x1000>, /* SSIU */
+                             <0 0xec541000 0 0x280>,  /* SSI */
+                             <0 0xec760000 0 0x200>;  /* Audio DMAC peri peri*/
                        reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";
 
                        clocks = <&cpg CPG_MOD 1005>,
                                        dma-names = "rx", "tx";
                                };
                                ssiu40: ssiu-32 {
-                                       dmas =  <&audma0 0x71>, <&audma1 0x72>;
+                                       dmas = <&audma0 0x71>, <&audma1 0x72>;
                                        dma-names = "rx", "tx";
                                };
                                ssiu41: ssiu-33 {
                        };
                };
 
+               mlp: mlp@ec520000 {
+                       compatible = "renesas,r8a7795-mlp",
+                                    "renesas,rcar-gen3-mlp";
+                       reg = <0 0xec520000 0 0x800>;
+                       interrupts = <GIC_SPI 384 IRQ_TYPE_LEVEL_HIGH>,
+                               <GIC_SPI 385 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 802>;
+                       power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
+                       resets = <&cpg 802>;
+                       status = "disabled";
+               };
+
                audma0: dma-controller@ec700000 {
                        compatible = "renesas,dmac-r8a7795",
                                     "renesas,rcar-dmac";
index 26f7103..6f79da8 100644 (file)
                         * clkout       : #clock-cells = <0>;   <&rcar_sound>;
                         * clkout0/1/2/3: #clock-cells = <1>;   <&rcar_sound N>;
                         */
-                       compatible =  "renesas,rcar_sound-r8a7796", "renesas,rcar_sound-gen3";
-                       reg =   <0 0xec500000 0 0x1000>, /* SCU */
-                               <0 0xec5a0000 0 0x100>,  /* ADG */
-                               <0 0xec540000 0 0x1000>, /* SSIU */
-                               <0 0xec541000 0 0x280>,  /* SSI */
-                               <0 0xec760000 0 0x200>;  /* Audio DMAC peri peri*/
+                       compatible = "renesas,rcar_sound-r8a7796", "renesas,rcar_sound-gen3";
+                       reg = <0 0xec500000 0 0x1000>, /* SCU */
+                             <0 0xec5a0000 0 0x100>,  /* ADG */
+                             <0 0xec540000 0 0x1000>, /* SSIU */
+                             <0 0xec541000 0 0x280>,  /* SSI */
+                             <0 0xec760000 0 0x200>;  /* Audio DMAC peri peri*/
                        reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";
 
                        clocks = <&cpg CPG_MOD 1005>,
                                        dma-names = "rx", "tx";
                                };
                                ssiu40: ssiu-32 {
-                                       dmas =  <&audma0 0x71>, <&audma1 0x72>;
+                                       dmas = <&audma0 0x71>, <&audma1 0x72>;
                                        dma-names = "rx", "tx";
                                };
                                ssiu41: ssiu-33 {
                        };
                };
 
+               mlp: mlp@ec520000 {
+                       compatible = "renesas,r8a7796-mlp",
+                                    "renesas,rcar-gen3-mlp";
+                       reg = <0 0xec520000 0 0x800>;
+                       interrupts = <GIC_SPI 384 IRQ_TYPE_LEVEL_HIGH>,
+                               <GIC_SPI 385 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 802>;
+                       power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
+                       resets = <&cpg 802>;
+                       status = "disabled";
+               };
+
                audma0: dma-controller@ec700000 {
                        compatible = "renesas,dmac-r8a7796",
                                     "renesas,rcar-dmac";
index ac9b587..68cbbb3 100644 (file)
                         * clkout       : #clock-cells = <0>;   <&rcar_sound>;
                         * clkout0/1/2/3: #clock-cells = <1>;   <&rcar_sound N>;
                         */
-                       compatible =  "renesas,rcar_sound-r8a77961", "renesas,rcar_sound-gen3";
+                       compatible = "renesas,rcar_sound-r8a77961", "renesas,rcar_sound-gen3";
                        reg = <0 0xec500000 0 0x1000>, /* SCU */
                              <0 0xec5a0000 0 0x100>,  /* ADG */
                              <0 0xec540000 0 0x1000>, /* SSIU */
                                        dma-names = "rx", "tx";
                                };
                                ssiu40: ssiu-32 {
-                                       dmas =  <&audma0 0x71>, <&audma1 0x72>;
+                                       dmas = <&audma0 0x71>, <&audma1 0x72>;
                                        dma-names = "rx", "tx";
                                };
                                ssiu41: ssiu-33 {
                        };
                };
 
+               mlp: mlp@ec520000 {
+                       compatible = "renesas,r8a77961-mlp",
+                                    "renesas,rcar-gen3-mlp";
+                       reg = <0 0xec520000 0 0x800>;
+                       interrupts = <GIC_SPI 384 IRQ_TYPE_LEVEL_HIGH>,
+                               <GIC_SPI 385 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 802>;
+                       power-domains = <&sysc R8A77961_PD_ALWAYS_ON>;
+                       resets = <&cpg 802>;
+                       status = "disabled";
+               };
+
                audma0: dma-controller@ec700000 {
                        compatible = "renesas,dmac-r8a77961",
                                     "renesas,rcar-dmac";
                                port@2 {
                                        reg = <2>;
                                        du_out_lvds0: endpoint {
+                                               remote-endpoint = <&lvds0_in>;
+                                       };
+                               };
+                       };
+               };
+
+               lvds0: lvds@feb90000 {
+                       compatible = "renesas,r8a77961-lvds";
+                       reg = <0 0xfeb90000 0 0x14>;
+                       clocks = <&cpg CPG_MOD 727>;
+                       power-domains = <&sysc R8A77961_PD_ALWAYS_ON>;
+                       resets = <&cpg 727>;
+                       status = "disabled";
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               port@0 {
+                                       reg = <0>;
+                                       lvds0_in: endpoint {
+                                               remote-endpoint = <&du_out_lvds0>;
+                                       };
+                               };
+                               port@1 {
+                                       reg = <1>;
+                                       lvds0_out: endpoint {
                                        };
                                };
                        };
index f898aad..9f858af 100644 (file)
                         * clkout       : #clock-cells = <0>;   <&rcar_sound>;
                         * clkout0/1/2/3: #clock-cells = <1>;   <&rcar_sound N>;
                         */
-                       compatible =  "renesas,rcar_sound-r8a77965", "renesas,rcar_sound-gen3";
-                       reg =   <0 0xec500000 0 0x1000>, /* SCU */
-                               <0 0xec5a0000 0 0x100>,  /* ADG */
-                               <0 0xec540000 0 0x1000>, /* SSIU */
-                               <0 0xec541000 0 0x280>,  /* SSI */
-                               <0 0xec760000 0 0x200>;  /* Audio DMAC peri peri*/
+                       compatible = "renesas,rcar_sound-r8a77965", "renesas,rcar_sound-gen3";
+                       reg = <0 0xec500000 0 0x1000>, /* SCU */
+                             <0 0xec5a0000 0 0x100>,  /* ADG */
+                             <0 0xec540000 0 0x1000>, /* SSIU */
+                             <0 0xec541000 0 0x280>,  /* SSI */
+                             <0 0xec760000 0 0x200>;  /* Audio DMAC peri peri*/
                        reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";
 
                        clocks = <&cpg CPG_MOD 1005>,
                                        dma-names = "rx", "tx";
                                };
                                ssiu40: ssiu-32 {
-                                       dmas =  <&audma0 0x71>, <&audma1 0x72>;
+                                       dmas = <&audma0 0x71>, <&audma1 0x72>;
                                        dma-names = "rx", "tx";
                                };
                                ssiu41: ssiu-33 {
                        };
                };
 
+               mlp: mlp@ec520000 {
+                       compatible = "renesas,r8a77965-mlp",
+                                    "renesas,rcar-gen3-mlp";
+                       reg = <0 0xec520000 0 0x800>;
+                       interrupts = <GIC_SPI 384 IRQ_TYPE_LEVEL_HIGH>,
+                               <GIC_SPI 385 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 802>;
+                       power-domains = <&sysc R8A77965_PD_ALWAYS_ON>;
+                       resets = <&cpg 802>;
+                       status = "disabled";
+               };
+
                audma0: dma-controller@ec700000 {
                        compatible = "renesas,dmac-r8a77965",
                                     "renesas,rcar-dmac";
index b579d31..49d1a92 100644 (file)
        };
 };
 
+&csi40 {
+       status = "okay";
+
+       ports {
+               port@0 {
+                       csi40_in: endpoint {
+                               clock-lanes = <0>;
+                               data-lanes = <1 2 3 4>;
+                               remote-endpoint = <&max9286_out0>;
+                       };
+               };
+       };
+};
+
 &du {
        clocks = <&cpg CPG_MOD 724>, <&x1_clk>;
        clock-names = "du.0", "dclkin.0";
        };
 };
 
+&i2c3 {
+       pinctrl-0 = <&i2c3_pins>;
+       pinctrl-names = "default";
+
+       status = "okay";
+       clock-frequency = <400000>;
+
+       gmsl0: gmsl-deserializer@48 {
+               compatible = "maxim,max9286";
+               reg = <0x48>;
+
+               maxim,gpio-poc = <0 GPIO_ACTIVE_LOW>;
+               enable-gpios = <&io_expander 0 GPIO_ACTIVE_HIGH>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               max9286_out0: endpoint {
+                                       clock-lanes = <0>;
+                                       data-lanes = <1 2 3 4>;
+                                       remote-endpoint = <&csi40_in>;
+                               };
+                       };
+               };
+
+               i2c-mux {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       i2c@0 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               reg = <0>;
+
+                               status = "disabled";
+                       };
+
+                       i2c@1 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               reg = <1>;
+
+                               status = "disabled";
+                       };
+
+                       i2c@2 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               reg = <2>;
+
+                               status = "disabled";
+                       };
+
+                       i2c@3 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               reg = <3>;
+
+                               status = "disabled";
+                       };
+               };
+       };
+};
+
 &lvds0 {
        status = "okay";
 
                function = "i2c0";
        };
 
+       i2c3_pins: i2c3 {
+               groups = "i2c3_a";
+               function = "i2c3";
+       };
+
        qspi0_pins: qspi0 {
                groups = "qspi0_ctrl", "qspi0_data4";
                function = "qspi0";
index 3d6d10c..43ed033 100644 (file)
        };
 };
 
+&csi40 {
+       status = "okay";
+
+       ports {
+               port@0 {
+                       csi40_in: endpoint {
+                               clock-lanes = <0>;
+                               data-lanes = <1 2 3 4>;
+                               remote-endpoint = <&max9286_out0>;
+                       };
+               };
+       };
+};
+
+&csi41 {
+       status = "okay";
+
+       ports {
+               port@0 {
+                       csi41_in: endpoint {
+                               clock-lanes = <0>;
+                               data-lanes = <1 2 3 4>;
+                               remote-endpoint = <&max9286_out1>;
+                       };
+               };
+       };
+};
+
 &du {
        clocks = <&cpg CPG_MOD 724>,
                 <&x1_clk>;
        };
 };
 
+&i2c1 {
+       pinctrl-0 = <&i2c1_pins>;
+       pinctrl-names = "default";
+
+       status = "okay";
+       clock-frequency = <400000>;
+
+       gmsl0: gmsl-deserializer@48 {
+               compatible = "maxim,max9286";
+               reg = <0x48>;
+
+               maxim,gpio-poc = <0 GPIO_ACTIVE_LOW>;
+               enable-gpios = <&io_expander0 0 GPIO_ACTIVE_HIGH>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               max9286_out0: endpoint {
+                                       clock-lanes = <0>;
+                                       data-lanes = <1 2 3 4>;
+                                       remote-endpoint = <&csi40_in>;
+                               };
+                       };
+               };
+
+               i2c-mux {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       i2c@0 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               reg = <0>;
+
+                               status = "disabled";
+                       };
+
+                       i2c@1 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               reg = <1>;
+
+                               status = "disabled";
+                       };
+
+                       i2c@2 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               reg = <2>;
+
+                               status = "disabled";
+                       };
+
+                       i2c@3 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               reg = <3>;
+
+                               status = "disabled";
+                       };
+               };
+       };
+
+       gmsl1: gmsl-deserializer@4a {
+               compatible = "maxim,max9286";
+               reg = <0x4a>;
+
+               maxim,gpio-poc = <0 GPIO_ACTIVE_LOW>;
+               enable-gpios = <&io_expander1 0 GPIO_ACTIVE_HIGH>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               max9286_out1: endpoint {
+                                       clock-lanes = <0>;
+                                       data-lanes = <1 2 3 4>;
+                                       remote-endpoint = <&csi41_in>;
+                               };
+                       };
+               };
+
+               i2c-mux {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       i2c@0 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               reg = <0>;
+
+                               status = "disabled";
+                       };
+
+                       i2c@1 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               reg = <1>;
+
+                               status = "disabled";
+                       };
+
+                       i2c@2 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               reg = <2>;
+
+                               status = "disabled";
+                       };
+
+                       i2c@3 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               reg = <3>;
+
+                               status = "disabled";
+                       };
+               };
+       };
+};
+
 &lvds0 {
        status = "okay";
 
                function = "i2c0";
        };
 
+       i2c1_pins: i2c1 {
+               groups = "i2c1";
+               function = "i2c1";
+       };
+
        mmc_pins: mmc {
                groups = "mmc_data8", "mmc_ctrl", "mmc_ds";
                function = "mmc";
index 14caedd..7e0f1aa 100644 (file)
                         * clkout       : #clock-cells = <0>;   <&rcar_sound>;
                         * clkout0/1/2/3: #clock-cells = <1>;   <&rcar_sound N>;
                         */
-                       compatible =  "renesas,rcar_sound-r8a77990", "renesas,rcar_sound-gen3";
-                       reg =   <0 0xec500000 0 0x1000>, /* SCU */
-                               <0 0xec5a0000 0 0x100>,  /* ADG */
-                               <0 0xec540000 0 0x1000>, /* SSIU */
-                               <0 0xec541000 0 0x280>,  /* SSI */
-                               <0 0xec760000 0 0x200>;  /* Audio DMAC peri peri*/
+                       compatible = "renesas,rcar_sound-r8a77990", "renesas,rcar_sound-gen3";
+                       reg = <0 0xec500000 0 0x1000>, /* SCU */
+                             <0 0xec5a0000 0 0x100>,  /* ADG */
+                             <0 0xec540000 0 0x1000>, /* SSIU */
+                             <0 0xec541000 0 0x280>,  /* SSI */
+                             <0 0xec760000 0 0x200>;  /* Audio DMAC peri peri*/
                        reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";
 
                        clocks = <&cpg CPG_MOD 1005>,
                        };
                };
 
+               mlp: mlp@ec520000 {
+                       compatible = "renesas,r8a77990-mlp",
+                                    "renesas,rcar-gen3-mlp";
+                       reg = <0 0xec520000 0 0x800>;
+                       interrupts = <GIC_SPI 384 IRQ_TYPE_LEVEL_HIGH>,
+                               <GIC_SPI 385 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 802>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 802>;
+                       status = "disabled";
+               };
+
                audma0: dma-controller@ec700000 {
                        compatible = "renesas,dmac-r8a77990",
                                     "renesas,rcar-dmac";
index f29f398..cac1f94 100644 (file)
                         * clkout       : #clock-cells = <0>;   <&rcar_sound>;
                         * clkout0/1/2/3: #clock-cells = <1>;   <&rcar_sound N>;
                         */
-                       compatible =  "renesas,rcar_sound-r8a77995", "renesas,rcar_sound-gen3";
-                       reg =   <0 0xec500000 0 0x1000>, /* SCU */
-                               <0 0xec5a0000 0 0x100>,  /* ADG */
-                               <0 0xec540000 0 0x1000>, /* SSIU */
-                               <0 0xec541000 0 0x280>,  /* SSI */
-                               <0 0xec740000 0 0x200>;  /* Audio DMAC peri peri*/
+                       compatible = "renesas,rcar_sound-r8a77995", "renesas,rcar_sound-gen3";
+                       reg = <0 0xec500000 0 0x1000>, /* SCU */
+                             <0 0xec5a0000 0 0x100>,  /* ADG */
+                             <0 0xec540000 0 0x1000>, /* SSIU */
+                             <0 0xec541000 0 0x280>,  /* SSI */
+                             <0 0xec740000 0 0x200>;  /* Audio DMAC peri peri*/
                        reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";
 
                        clocks = <&cpg CPG_MOD 1005>,
                        };
                };
 
+               mlp: mlp@ec520000 {
+                       compatible = "renesas,r8a77995-mlp",
+                                    "renesas,rcar-gen3-mlp";
+                       reg = <0 0xec520000 0 0x800>;
+                       interrupts = <GIC_SPI 384 IRQ_TYPE_LEVEL_HIGH>,
+                               <GIC_SPI 385 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 802>;
+                       power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
+                       resets = <&cpg 802>;
+                       status = "disabled";
+               };
+
                audma0: dma-controller@ec700000 {
                        compatible = "renesas,dmac-r8a77995",
                                     "renesas,rcar-dmac";
index f791c76..e06b8ed 100644 (file)
@@ -5,6 +5,63 @@
  * Copyright (C) 2021 Glider bv
  */
 
+&csi40 {
+       status = "okay";
+
+       ports {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               port@0 {
+                       reg = <0>;
+
+                       csi40_in: endpoint {
+                               clock-lanes = <0>;
+                               data-lanes = <1 2 3 4>;
+                               remote-endpoint = <&max96712_out0>;
+                       };
+               };
+       };
+};
+
+&csi42 {
+       status = "okay";
+
+       ports {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               port@0 {
+                       reg = <0>;
+
+                       csi42_in: endpoint {
+                               clock-lanes = <0>;
+                               data-lanes = <1 2 3 4>;
+                               remote-endpoint = <&max96712_out1>;
+                       };
+               };
+       };
+};
+
+&csi43 {
+       status = "okay";
+
+       ports {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               port@0 {
+                       reg = <0>;
+
+                       csi43_in: endpoint {
+                               clock-lanes = <0>;
+                               data-lanes = <1 2 3 4>;
+                               remote-endpoint = <&max96712_out2>;
+                       };
+               };
+       };
+};
+
 &i2c0 {
        pca9654_a: gpio@21 {
                compatible = "onnn,pca9654";
                pagesize = <8>;
        };
 };
+
+&i2c1 {
+       gmsl0: gmsl-deserializer@49 {
+               compatible = "maxim,max96712";
+               reg = <0x49>;
+               enable-gpios = <&pca9654_a 0 GPIO_ACTIVE_HIGH>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@4 {
+                               reg = <4>;
+                               max96712_out0: endpoint {
+                                       clock-lanes = <0>;
+                                       data-lanes = <1 2 3 4>;
+                                       remote-endpoint = <&csi40_in>;
+                               };
+                       };
+               };
+       };
+
+       gmsl1: gmsl-deserializer@4b {
+               compatible = "maxim,max96712";
+               reg = <0x4b>;
+               enable-gpios = <&pca9654_b 0 GPIO_ACTIVE_HIGH>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@4 {
+                               reg = <4>;
+                               max96712_out1: endpoint {
+                                       clock-lanes = <0>;
+                                       data-lanes = <1 2 3 4>;
+                                       lane-polarities = <0 0 0 0 1>;
+                                       remote-endpoint = <&csi42_in>;
+                               };
+                       };
+               };
+       };
+
+       gmsl2: gmsl-deserializer@6b {
+               compatible = "maxim,max96712";
+               reg = <0x6b>;
+               enable-gpios = <&pca9654_c 0 GPIO_ACTIVE_HIGH>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@4 {
+                               reg = <4>;
+                               max96712_out2: endpoint {
+                                       clock-lanes = <0>;
+                                       data-lanes = <1 2 3 4>;
+                                       lane-polarities = <0 0 0 0 1>;
+                                       remote-endpoint = <&csi43_in>;
+                               };
+                       };
+               };
+       };
+};
+
+&isp0 {
+       status = "okay";
+};
+
+&isp2 {
+       status = "okay";
+};
+
+&isp3 {
+       status = "okay";
+};
+
+&vin00 {
+       status = "okay";
+};
+
+&vin01 {
+       status = "okay";
+};
+
+&vin02 {
+       status = "okay";
+};
+
+&vin03 {
+       status = "okay";
+};
+
+&vin04 {
+       status = "okay";
+};
+
+&vin05 {
+       status = "okay";
+};
+
+&vin06 {
+       status = "okay";
+};
+
+&vin07 {
+       status = "okay";
+};
+
+&vin16 {
+       status = "okay";
+};
+
+&vin17 {
+       status = "okay";
+};
+
+&vin18 {
+       status = "okay";
+};
+
+&vin19 {
+       status = "okay";
+};
+
+&vin20 {
+       status = "okay";
+};
+
+&vin21 {
+       status = "okay";
+};
+
+&vin22 {
+       status = "okay";
+};
+
+&vin23 {
+       status = "okay";
+};
+
+&vin24 {
+       status = "okay";
+};
+
+&vin25 {
+       status = "okay";
+};
+
+&vin26 {
+       status = "okay";
+};
+
+&vin27 {
+       status = "okay";
+};
+
+&vin28 {
+       status = "okay";
+};
+
+&vin29 {
+       status = "okay";
+};
+
+&vin30 {
+       status = "okay";
+};
+
+&vin31 {
+       status = "okay";
+};
index 1e7ed12..c4be288 100644 (file)
                        interrupts = <GIC_SPI 832 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 916>;
                        power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
-                       resets =  <&cpg 916>;
+                       resets = <&cpg 916>;
                        gpio-controller;
                        #gpio-cells = <2>;
                        gpio-ranges = <&pfc 0 0 28>;
                        interrupts = <GIC_SPI 836 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 915>;
                        power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
-                       resets =  <&cpg 915>;
+                       resets = <&cpg 915>;
                        gpio-controller;
                        #gpio-cells = <2>;
                        gpio-ranges = <&pfc 0 32 31>;
                        interrupts = <GIC_SPI 840 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 915>;
                        power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
-                       resets =  <&cpg 915>;
+                       resets = <&cpg 915>;
                        gpio-controller;
                        #gpio-cells = <2>;
                        gpio-ranges = <&pfc 0 64 25>;
                        interrupts = <GIC_SPI 844 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 916>;
                        power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
-                       resets =  <&cpg 916>;
+                       resets = <&cpg 916>;
                        gpio-controller;
                        #gpio-cells = <2>;
                        gpio-ranges = <&pfc 0 96 17>;
                        interrupts = <GIC_SPI 848 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 917>;
                        power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
-                       resets =  <&cpg 917>;
+                       resets = <&cpg 917>;
                        gpio-controller;
                        #gpio-cells = <2>;
                        gpio-ranges = <&pfc 0 128 27>;
                        interrupts = <GIC_SPI 852 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 917>;
                        power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
-                       resets =  <&cpg 917>;
+                       resets = <&cpg 917>;
                        gpio-controller;
                        #gpio-cells = <2>;
                        gpio-ranges = <&pfc 0 160 21>;
                        interrupts = <GIC_SPI 856 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 918>;
                        power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
-                       resets =  <&cpg 918>;
+                       resets = <&cpg 918>;
                        gpio-controller;
                        #gpio-cells = <2>;
                        gpio-ranges = <&pfc 0 192 21>;
                        interrupts = <GIC_SPI 860 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 918>;
                        power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
-                       resets =  <&cpg 918>;
+                       resets = <&cpg 918>;
                        gpio-controller;
                        #gpio-cells = <2>;
                        gpio-ranges = <&pfc 0 224 21>;
                        interrupts = <GIC_SPI 864 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 918>;
                        power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
-                       resets =  <&cpg 918>;
+                       resets = <&cpg 918>;
                        gpio-controller;
                        #gpio-cells = <2>;
                        gpio-ranges = <&pfc 0 256 21>;
                        interrupts = <GIC_SPI 868 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 918>;
                        power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
-                       resets =  <&cpg 918>;
+                       resets = <&cpg 918>;
                        gpio-controller;
                        #gpio-cells = <2>;
                        gpio-ranges = <&pfc 0 288 21>;
                        #thermal-sensor-cells = <1>;
                };
 
+               intc_ex: interrupt-controller@e61c0000 {
+                       compatible = "renesas,intc-ex-r8a779a0", "renesas,irqc";
+                       #interrupt-cells = <2>;
+                       interrupt-controller;
+                       reg = <0 0xe61c0000 0 0x200>;
+                       interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_CORE R8A779A0_CLK_CP>;
+                       power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
+               };
+
                tmu0: timer@e61e0000 {
                        compatible = "renesas,tmu-r8a779a0", "renesas,tmu";
                        reg = <0 0xe61e0000 0 0x30>;
index 1565865..6e07c54 100644 (file)
        clock-frequency = <32768>;
 };
 
+&pfc {
+       pinctrl-0 = <&scif_clk_pins>;
+       pinctrl-names = "default";
+
+       scif3_pins: scif3 {
+               groups = "scif3_data", "scif3_ctrl";
+               function = "scif3";
+       };
+
+       scif_clk_pins: scif_clk {
+               groups = "scif_clk";
+               function = "scif_clk";
+       };
+};
+
+&rwdt {
+       timeout-sec = <60>;
+       status = "okay";
+};
+
 &scif3 {
+       pinctrl-0 = <&scif3_pins>;
+       pinctrl-names = "default";
+
+       uart-has-rtscts;
        status = "okay";
 };
+
+&scif_clk {
+       clock-frequency = <24000000>;
+};
index eda5977..f4e5498 100644 (file)
                #size-cells = <2>;
                ranges;
 
+               rwdt: watchdog@e6020000 {
+                       compatible = "renesas,r8a779f0-wdt",
+                                    "renesas,rcar-gen4-wdt";
+                       reg = <0 0xe6020000 0 0x0c>;
+                       clocks = <&cpg CPG_MOD 907>;
+                       power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+                       resets = <&cpg 907>;
+                       status = "disabled";
+               };
+
+               pfc: pinctrl@e6050000 {
+                       compatible = "renesas,pfc-r8a779f0";
+                       reg = <0 0xe6050000 0 0x16c>, <0 0xe6050800 0 0x16c>,
+                             <0 0xe6051000 0 0x16c>, <0 0xe6051800 0 0x16c>;
+               };
+
                cpg: clock-controller@e6150000 {
                        compatible = "renesas,r8a779f0-cpg-mssr";
                        reg = <0 0xe6150000 0 0x4000>;
                        status = "disabled";
                };
 
+               dmac0: dma-controller@e7350000 {
+                       compatible = "renesas,dmac-r8a779f0",
+                                    "renesas,rcar-gen4-dmac";
+                       reg = <0 0xe7350000 0 0x1000>,
+                             <0 0xe7300000 0 0x10000>;
+                       interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 111 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "error",
+                                         "ch0", "ch1", "ch2", "ch3", "ch4",
+                                         "ch5", "ch6", "ch7", "ch8", "ch9",
+                                         "ch10", "ch11", "ch12", "ch13",
+                                         "ch14", "ch15";
+                       clocks = <&cpg CPG_MOD 709>;
+                       clock-names = "fck";
+                       power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+                       resets = <&cpg 709>;
+                       #dma-cells = <1>;
+                       dma-channels = <16>;
+               };
+
+               dmac1: dma-controller@e7351000 {
+                       compatible = "renesas,dmac-r8a779f0",
+                                    "renesas,rcar-gen4-dmac";
+                       reg = <0 0xe7351000 0 0x1000>,
+                             <0 0xe7310000 0 0x10000>;
+                       interrupts = <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 151 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "error",
+                                         "ch0", "ch1", "ch2", "ch3", "ch4",
+                                         "ch5", "ch6", "ch7", "ch8", "ch9",
+                                         "ch10", "ch11", "ch12", "ch13",
+                                         "ch14", "ch15";
+                       clocks = <&cpg CPG_MOD 710>;
+                       clock-names = "fck";
+                       power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+                       resets = <&cpg 710>;
+                       #dma-cells = <1>;
+                       dma-channels = <16>;
+               };
+
                gic: interrupt-controller@f1000000 {
                        compatible = "arm,gic-v3";
                        #interrupt-cells = <3>;
diff --git a/arch/arm64/boot/dts/renesas/r9a07g044c1.dtsi b/arch/arm64/boot/dts/renesas/r9a07g044c1.dtsi
new file mode 100644 (file)
index 0000000..1d57df7
--- /dev/null
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+/*
+ * Device Tree Source for the RZ/G2LC R9A07G044C1 SoC specific parts
+ *
+ * Copyright (C) 2021 Renesas Electronics Corp.
+ */
+
+/dts-v1/;
+#include "r9a07g044.dtsi"
+
+/ {
+       compatible = "renesas,r9a07g044c1", "renesas,r9a07g044";
+
+       cpus {
+               /delete-node/ cpu-map;
+               /delete-node/ cpu@100;
+       };
+
+       timer {
+               interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
+                                     <&gic GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
+                                     <&gic GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
+                                     <&gic GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>;
+       };
+};
+
+&soc {
+       /delete-node/ ssi@1004a800;
+       /delete-node/ serial@1004c800;
+       /delete-node/ adc@10059000;
+       /delete-node/ ethernet@11c30000;
+};
diff --git a/arch/arm64/boot/dts/renesas/r9a07g044c2-smarc.dts b/arch/arm64/boot/dts/renesas/r9a07g044c2-smarc.dts
new file mode 100644 (file)
index 0000000..5a5cea8
--- /dev/null
@@ -0,0 +1,91 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+/*
+ * Device Tree Source for the RZ/G2LC SMARC EVK board
+ *
+ * Copyright (C) 2021 Renesas Electronics Corp.
+ */
+
+/dts-v1/;
+#include "r9a07g044c2.dtsi"
+#include "rzg2lc-smarc.dtsi"
+
+/ {
+       model = "Renesas SMARC EVK based on r9a07g044c2";
+       compatible = "renesas,smarc-evk", "renesas,r9a07g044c2", "renesas,r9a07g044";
+};
+
+&ehci0 {
+       /delete-property/ pinctrl-0;
+       /delete-property/ pinctrl-names;
+       status = "disabled";
+};
+
+&ehci1 {
+       /delete-property/ pinctrl-0;
+       /delete-property/ pinctrl-names;
+       status = "disabled";
+};
+
+&hsusb {
+       /delete-property/ pinctrl-0;
+       /delete-property/ pinctrl-names;
+       status = "disabled";
+};
+
+&i2c0 {
+       /delete-property/ pinctrl-0;
+       /delete-property/ pinctrl-names;
+       status = "disabled";
+};
+
+&i2c1 {
+       /delete-property/ pinctrl-0;
+       /delete-property/ pinctrl-names;
+       status = "disabled";
+};
+
+&i2c3 {
+       /delete-property/ pinctrl-0;
+       /delete-property/ pinctrl-names;
+       status = "disabled";
+};
+
+&ohci0 {
+       /delete-property/ pinctrl-0;
+       /delete-property/ pinctrl-names;
+       status = "disabled";
+};
+
+&ohci1 {
+       /delete-property/ pinctrl-0;
+       /delete-property/ pinctrl-names;
+       status = "disabled";
+};
+
+&phyrst {
+       status = "disabled";
+};
+
+&spi1 {
+       /delete-property/ pinctrl-0;
+       /delete-property/ pinctrl-names;
+       status = "disabled";
+};
+
+&ssi0 {
+       /delete-property/ pinctrl-0;
+       /delete-property/ pinctrl-names;
+       status = "disabled";
+};
+
+&usb2_phy0 {
+       /delete-property/ pinctrl-0;
+       /delete-property/ pinctrl-names;
+       status = "disabled";
+};
+
+&usb2_phy1 {
+       /delete-property/ pinctrl-0;
+       /delete-property/ pinctrl-names;
+       status = "disabled";
+};
diff --git a/arch/arm64/boot/dts/renesas/r9a07g044c2.dtsi b/arch/arm64/boot/dts/renesas/r9a07g044c2.dtsi
new file mode 100644 (file)
index 0000000..7bb8917
--- /dev/null
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+/*
+ * Device Tree Source for the RZ/G2LC R9A07G044C2 SoC specific parts
+ *
+ * Copyright (C) 2021 Renesas Electronics Corp.
+ */
+
+/dts-v1/;
+#include "r9a07g044.dtsi"
+
+/ {
+       compatible = "renesas,r9a07g044c2", "renesas,r9a07g044";
+};
+
+&soc {
+       /delete-node/ ssi@1004a800;
+       /delete-node/ serial@1004c800;
+       /delete-node/ adc@10059000;
+       /delete-node/ ethernet@11c30000;
+};
index 247b0b3..bc2af6c 100644 (file)
@@ -8,6 +8,8 @@
 /dts-v1/;
 #include "r9a07g044l2.dtsi"
 #include "rzg2l-smarc-som.dtsi"
+#include "rzg2l-smarc-pinfunction.dtsi"
+#include "rz-smarc-common.dtsi"
 #include "rzg2l-smarc.dtsi"
 
 / {
diff --git a/arch/arm64/boot/dts/renesas/r9a07g054.dtsi b/arch/arm64/boot/dts/renesas/r9a07g054.dtsi
new file mode 100644 (file)
index 0000000..5d39e76
--- /dev/null
@@ -0,0 +1,491 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+/*
+ * Device Tree Source for the RZ/V2L SoC
+ *
+ * Copyright (C) 2021 Renesas Electronics Corp.
+ */
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/clock/r9a07g054-cpg.h>
+
+/ {
+       compatible = "renesas,r9a07g054";
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       audio_clk1: audio_clk1 {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               /* This value must be overridden by boards that provide it */
+               clock-frequency = <0>;
+       };
+
+       audio_clk2: audio_clk2 {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               /* This value must be overridden by boards that provide it */
+               clock-frequency = <0>;
+       };
+
+       /* External CAN clock - to be overridden by boards that provide it */
+       can_clk: can {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <0>;
+       };
+
+       /* clock can be either from exclk or crystal oscillator (XIN/XOUT) */
+       extal_clk: extal {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               /* This value must be overridden by the board */
+               clock-frequency = <0>;
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu-map {
+                       cluster0 {
+                               core0 {
+                                       cpu = <&cpu0>;
+                               };
+                               core1 {
+                                       cpu = <&cpu1>;
+                               };
+                       };
+               };
+
+               cpu0: cpu@0 {
+                       compatible = "arm,cortex-a55";
+                       reg = <0>;
+                       device_type = "cpu";
+                       #cooling-cells = <2>;
+                       next-level-cache = <&L3_CA55>;
+                       enable-method = "psci";
+                       clocks = <&cpg CPG_CORE R9A07G054_CLK_I>;
+               };
+
+               cpu1: cpu@100 {
+                       compatible = "arm,cortex-a55";
+                       reg = <0x100>;
+                       device_type = "cpu";
+                       next-level-cache = <&L3_CA55>;
+                       enable-method = "psci";
+                       clocks = <&cpg CPG_CORE R9A07G054_CLK_I>;
+               };
+
+               L3_CA55: cache-controller-0 {
+                       compatible = "cache";
+                       cache-unified;
+                       cache-size = <0x40000>;
+               };
+       };
+
+       psci {
+               compatible = "arm,psci-1.0", "arm,psci-0.2";
+               method = "smc";
+       };
+
+       soc: soc {
+               compatible = "simple-bus";
+               interrupt-parent = <&gic>;
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               ssi0: ssi@10049c00 {
+                       reg = <0 0x10049c00 0 0x400>;
+                       #sound-dai-cells = <0>;
+                       /* place holder */
+               };
+
+               spi1: spi@1004b000 {
+                       reg = <0 0x1004b000 0 0x400>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       /* place holder */
+               };
+
+               scif0: serial@1004b800 {
+                       compatible = "renesas,scif-r9a07g054",
+                                    "renesas,scif-r9a07g044";
+                       reg = <0 0x1004b800 0 0x400>;
+                       interrupts = <GIC_SPI 380 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 382 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 383 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 381 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 384 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 384 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "eri", "rxi", "txi",
+                                         "bri", "dri", "tei";
+                       clocks = <&cpg CPG_MOD R9A07G054_SCIF0_CLK_PCK>;
+                       clock-names = "fck";
+                       power-domains = <&cpg>;
+                       resets = <&cpg R9A07G054_SCIF0_RST_SYSTEM_N>;
+                       status = "disabled";
+               };
+
+               scif1: serial@1004bc00 {
+                       compatible = "renesas,scif-r9a07g054",
+                                    "renesas,scif-r9a07g044";
+                       reg = <0 0x1004bc00 0 0x400>;
+                       interrupts = <GIC_SPI 385 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 387 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 388 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 386 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 389 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 389 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "eri", "rxi", "txi",
+                                         "bri", "dri", "tei";
+                       clocks = <&cpg CPG_MOD R9A07G054_SCIF1_CLK_PCK>;
+                       clock-names = "fck";
+                       power-domains = <&cpg>;
+                       resets = <&cpg R9A07G054_SCIF1_RST_SYSTEM_N>;
+                       status = "disabled";
+               };
+
+               scif2: serial@1004c000 {
+                       compatible = "renesas,scif-r9a07g054",
+                                    "renesas,scif-r9a07g044";
+                       reg = <0 0x1004c000 0 0x400>;
+                       interrupts = <GIC_SPI 390 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 392 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 393 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 391 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 394 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 394 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "eri", "rxi", "txi",
+                                         "bri", "dri", "tei";
+                       clocks = <&cpg CPG_MOD R9A07G054_SCIF2_CLK_PCK>;
+                       clock-names = "fck";
+                       power-domains = <&cpg>;
+                       resets = <&cpg R9A07G054_SCIF2_RST_SYSTEM_N>;
+                       status = "disabled";
+               };
+
+               scif3: serial@1004c400 {
+                       compatible = "renesas,scif-r9a07g054",
+                                    "renesas,scif-r9a07g044";
+                       reg = <0 0x1004c400 0 0x400>;
+                       interrupts = <GIC_SPI 395 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 397 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 398 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 396 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 399 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 399 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "eri", "rxi", "txi",
+                                         "bri", "dri", "tei";
+                       clocks = <&cpg CPG_MOD R9A07G054_SCIF3_CLK_PCK>;
+                       clock-names = "fck";
+                       power-domains = <&cpg>;
+                       resets = <&cpg R9A07G054_SCIF3_RST_SYSTEM_N>;
+                       status = "disabled";
+               };
+
+               scif4: serial@1004c800 {
+                       compatible = "renesas,scif-r9a07g054",
+                                    "renesas,scif-r9a07g044";
+                       reg = <0 0x1004c800 0 0x400>;
+                       interrupts = <GIC_SPI 400 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 402 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 403 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 401 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 404 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 404 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "eri", "rxi", "txi",
+                                         "bri", "dri", "tei";
+                       clocks = <&cpg CPG_MOD R9A07G054_SCIF4_CLK_PCK>;
+                       clock-names = "fck";
+                       power-domains = <&cpg>;
+                       resets = <&cpg R9A07G054_SCIF4_RST_SYSTEM_N>;
+                       status = "disabled";
+               };
+
+               sci0: serial@1004d000 {
+                       compatible = "renesas,r9a07g054-sci", "renesas,sci";
+                       reg = <0 0x1004d000 0 0x400>;
+                       interrupts = <GIC_SPI 405 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 406 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 407 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 408 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "eri", "rxi", "txi", "tei";
+                       clocks = <&cpg CPG_MOD R9A07G054_SCI0_CLKP>;
+                       clock-names = "fck";
+                       power-domains = <&cpg>;
+                       resets = <&cpg R9A07G054_SCI0_RST>;
+                       status = "disabled";
+               };
+
+               sci1: serial@1004d400 {
+                       compatible = "renesas,r9a07g054-sci", "renesas,sci";
+                       reg = <0 0x1004d400 0 0x400>;
+                       interrupts = <GIC_SPI 409 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 410 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 411 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 412 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "eri", "rxi", "txi", "tei";
+                       clocks = <&cpg CPG_MOD R9A07G054_SCI1_CLKP>;
+                       clock-names = "fck";
+                       power-domains = <&cpg>;
+                       resets = <&cpg R9A07G054_SCI1_RST>;
+                       status = "disabled";
+               };
+
+               canfd: can@10050000 {
+                       reg = <0 0x10050000 0 0x8000>;
+                       /* place holder */
+               };
+
+               i2c0: i2c@10058000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0 0x10058000 0 0x400>;
+                       /* place holder */
+               };
+
+               i2c1: i2c@10058400 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0 0x10058400 0 0x400>;
+                       /* place holder */
+               };
+
+               i2c3: i2c@10058c00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0 0x10058c00 0 0x400>;
+                       /* place holder */
+               };
+
+               adc: adc@10059000 {
+                       reg = <0 0x10059000 0 0x400>;
+                       /* place holder */
+               };
+
+               sbc: spi@10060000 {
+                       reg = <0 0x10060000 0 0x10000>,
+                             <0 0x20000000 0 0x10000000>,
+                             <0 0x10070000 0 0x10000>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       /* place holder */
+               };
+
+               cpg: clock-controller@11010000 {
+                       compatible = "renesas,r9a07g054-cpg";
+                       reg = <0 0x11010000 0 0x10000>;
+                       clocks = <&extal_clk>;
+                       clock-names = "extal";
+                       #clock-cells = <2>;
+                       #reset-cells = <1>;
+                       #power-domain-cells = <0>;
+               };
+
+               sysc: system-controller@11020000 {
+                       compatible = "renesas,r9a07g054-sysc";
+                       reg = <0 0x11020000 0 0x10000>;
+                       interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "lpm_int", "ca55stbydone_int",
+                                         "cm33stbyr_int", "ca55_deny";
+                       status = "disabled";
+               };
+
+               pinctrl: pinctrl@11030000 {
+                       compatible = "renesas,r9a07g054-pinctrl",
+                                    "renesas,r9a07g044-pinctrl";
+                       reg = <0 0x11030000 0 0x10000>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       gpio-ranges = <&pinctrl 0 0 392>;
+                       clocks = <&cpg CPG_MOD R9A07G054_GPIO_HCLK>;
+                       power-domains = <&cpg>;
+                       resets = <&cpg R9A07G054_GPIO_RSTN>,
+                                <&cpg R9A07G054_GPIO_PORT_RESETN>,
+                                <&cpg R9A07G054_GPIO_SPARE_RESETN>;
+               };
+
+               dmac: dma-controller@11820000 {
+                       compatible = "renesas,r9a07g054-dmac",
+                                    "renesas,rz-dmac";
+                       reg = <0 0x11820000 0 0x10000>,
+                             <0 0x11830000 0 0x10000>;
+                       interrupts = <GIC_SPI 141 IRQ_TYPE_EDGE_RISING>,
+                                    <GIC_SPI 125 IRQ_TYPE_EDGE_RISING>,
+                                    <GIC_SPI 126 IRQ_TYPE_EDGE_RISING>,
+                                    <GIC_SPI 127 IRQ_TYPE_EDGE_RISING>,
+                                    <GIC_SPI 128 IRQ_TYPE_EDGE_RISING>,
+                                    <GIC_SPI 129 IRQ_TYPE_EDGE_RISING>,
+                                    <GIC_SPI 130 IRQ_TYPE_EDGE_RISING>,
+                                    <GIC_SPI 131 IRQ_TYPE_EDGE_RISING>,
+                                    <GIC_SPI 132 IRQ_TYPE_EDGE_RISING>,
+                                    <GIC_SPI 133 IRQ_TYPE_EDGE_RISING>,
+                                    <GIC_SPI 134 IRQ_TYPE_EDGE_RISING>,
+                                    <GIC_SPI 135 IRQ_TYPE_EDGE_RISING>,
+                                    <GIC_SPI 136 IRQ_TYPE_EDGE_RISING>,
+                                    <GIC_SPI 137 IRQ_TYPE_EDGE_RISING>,
+                                    <GIC_SPI 138 IRQ_TYPE_EDGE_RISING>,
+                                    <GIC_SPI 139 IRQ_TYPE_EDGE_RISING>,
+                                    <GIC_SPI 140 IRQ_TYPE_EDGE_RISING>;
+                       interrupt-names = "error",
+                                         "ch0", "ch1", "ch2", "ch3",
+                                         "ch4", "ch5", "ch6", "ch7",
+                                         "ch8", "ch9", "ch10", "ch11",
+                                         "ch12", "ch13", "ch14", "ch15";
+                       clocks = <&cpg CPG_MOD R9A07G054_DMAC_ACLK>,
+                                <&cpg CPG_MOD R9A07G054_DMAC_PCLK>;
+                       power-domains = <&cpg>;
+                       resets = <&cpg R9A07G054_DMAC_ARESETN>,
+                                <&cpg R9A07G054_DMAC_RST_ASYNC>;
+                       #dma-cells = <1>;
+                       dma-channels = <16>;
+               };
+
+               gpu: gpu@11840000 {
+                       reg = <0x0 0x11840000 0x0 0x10000>;
+                       /* place holder */
+               };
+
+               gic: interrupt-controller@11900000 {
+                       compatible = "arm,gic-v3";
+                       #interrupt-cells = <3>;
+                       #address-cells = <0>;
+                       interrupt-controller;
+                       reg = <0x0 0x11900000 0 0x40000>,
+                             <0x0 0x11940000 0 0x60000>;
+                       interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_LOW>;
+               };
+
+               sdhi0: mmc@11c00000  {
+                       reg = <0x0 0x11c00000 0 0x10000>;
+                       /* place holder */
+               };
+
+               sdhi1: mmc@11c10000 {
+                       reg = <0x0 0x11c10000 0 0x10000>;
+                       /* place holder */
+               };
+
+               eth0: ethernet@11c20000 {
+                       compatible = "renesas,r9a07g054-gbeth",
+                                    "renesas,rzg2l-gbeth";
+                       reg = <0 0x11c20000 0 0x10000>;
+                       interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "mux", "fil", "arp_ns";
+                       phy-mode = "rgmii";
+                       clocks = <&cpg CPG_MOD R9A07G054_ETH0_CLK_AXI>,
+                                <&cpg CPG_MOD R9A07G054_ETH0_CLK_CHI>,
+                                <&cpg CPG_CORE R9A07G054_CLK_HP>;
+                       clock-names = "axi", "chi", "refclk";
+                       resets = <&cpg R9A07G054_ETH0_RST_HW_N>;
+                       power-domains = <&cpg>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+               };
+
+               eth1: ethernet@11c30000 {
+                       compatible = "renesas,r9a07g054-gbeth",
+                                    "renesas,rzg2l-gbeth";
+                       reg = <0 0x11c30000 0 0x10000>;
+                       interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "mux", "fil", "arp_ns";
+                       phy-mode = "rgmii";
+                       clocks = <&cpg CPG_MOD R9A07G054_ETH1_CLK_AXI>,
+                                <&cpg CPG_MOD R9A07G054_ETH1_CLK_CHI>,
+                                <&cpg CPG_CORE R9A07G054_CLK_HP>;
+                       clock-names = "axi", "chi", "refclk";
+                       resets = <&cpg R9A07G054_ETH1_RST_HW_N>;
+                       power-domains = <&cpg>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+               };
+
+               phyrst: usbphy-ctrl@11c40000 {
+                       reg = <0 0x11c40000 0 0x10000>;
+                       /* place holder */
+               };
+
+               ohci0: usb@11c50000 {
+                       reg = <0 0x11c50000 0 0x100>;
+                       /* place holder */
+               };
+
+               ohci1: usb@11c70000 {
+                       reg = <0 0x11c70000 0 0x100>;
+                       /* place holder */
+               };
+
+               ehci0: usb@11c50100 {
+                       reg = <0 0x11c50100 0 0x100>;
+                       /* place holder */
+               };
+
+               ehci1: usb@11c70100 {
+                       reg = <0 0x11c70100 0 0x100>;
+                       /* place holder */
+               };
+
+               usb2_phy0: usb-phy@11c50200 {
+                       reg = <0 0x11c50200 0 0x700>;
+                       /* place holder */
+               };
+
+               usb2_phy1: usb-phy@11c70200 {
+                       reg = <0 0x11c70200 0 0x700>;
+                       /* place holder */
+               };
+
+               hsusb: usb@11c60000 {
+                       reg = <0 0x11c60000 0 0x10000>;
+                       /* place holder */
+               };
+
+               wdt0: watchdog@12800800 {
+                       reg = <0 0x12800800 0 0x400>;
+                       /* place holder */
+               };
+
+               wdt1: watchdog@12800c00 {
+                       reg = <0 0x12800C00 0 0x400>;
+                       /* place holder */
+               };
+
+               wdt2: watchdog@12800400 {
+                       reg = <0 0x12800400 0 0x400>;
+                       /* place holder */
+               };
+
+               ostm0: timer@12801000 {
+                       reg = <0x0 0x12801000 0x0 0x400>;
+                       /* place holder */
+               };
+
+               ostm1: timer@12801400 {
+                       reg = <0x0 0x12801400 0x0 0x400>;
+                       /* place holder */
+               };
+
+               ostm2: timer@12801800 {
+                       reg = <0x0 0x12801800 0x0 0x400>;
+                       /* place holder */
+               };
+       };
+
+       timer {
+               compatible = "arm,armv8-timer";
+               interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
+                                     <&gic GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
+                                     <&gic GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
+                                     <&gic GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>;
+       };
+};
diff --git a/arch/arm64/boot/dts/renesas/r9a07g054l1.dtsi b/arch/arm64/boot/dts/renesas/r9a07g054l1.dtsi
new file mode 100644 (file)
index 0000000..c448cc6
--- /dev/null
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+/*
+ * Device Tree Source for the RZ/V2L R9A07G054L1 SoC specific parts
+ *
+ * Copyright (C) 2021 Renesas Electronics Corp.
+ */
+
+/dts-v1/;
+#include "r9a07g054.dtsi"
+
+/ {
+       compatible = "renesas,r9a07g054l1", "renesas,r9a07g054";
+
+       cpus {
+               /delete-node/ cpu-map;
+               /delete-node/ cpu@100;
+       };
+
+       timer {
+               interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
+                                     <&gic GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
+                                     <&gic GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
+                                     <&gic GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>;
+       };
+};
diff --git a/arch/arm64/boot/dts/renesas/r9a07g054l2-smarc.dts b/arch/arm64/boot/dts/renesas/r9a07g054l2-smarc.dts
new file mode 100644 (file)
index 0000000..fc334b4
--- /dev/null
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+/*
+ * Device Tree Source for the RZ/G2L SMARC EVK board
+ *
+ * Copyright (C) 2021 Renesas Electronics Corp.
+ */
+
+/dts-v1/;
+#include "r9a07g054l2.dtsi"
+#include "rzg2l-smarc-som.dtsi"
+#include "rzg2l-smarc-pinfunction.dtsi"
+#include "rz-smarc-common.dtsi"
+#include "rzg2l-smarc.dtsi"
+
+/ {
+       model = "Renesas SMARC EVK based on r9a07g054l2";
+       compatible = "renesas,smarc-evk", "renesas,r9a07g054l2", "renesas,r9a07g054";
+};
+
+&pinctrl {
+       /delete-node/ can0-stb-hog;
+       /delete-node/ can1-stb-hog;
+       /delete-node/ gpio-sd0-pwr-en-hog;
+       /delete-node/ sd0-dev-sel-hog;
+       /delete-node/ sd1-pwr-en-hog;
+};
diff --git a/arch/arm64/boot/dts/renesas/r9a07g054l2.dtsi b/arch/arm64/boot/dts/renesas/r9a07g054l2.dtsi
new file mode 100644 (file)
index 0000000..4d5914b
--- /dev/null
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+/*
+ * Device Tree Source for the RZ/V2L R9A07G054L2 SoC specific parts
+ *
+ * Copyright (C) 2021 Renesas Electronics Corp.
+ */
+
+/dts-v1/;
+#include "r9a07g054.dtsi"
+
+/ {
+       compatible = "renesas,r9a07g054l2", "renesas,r9a07g054";
+};
diff --git a/arch/arm64/boot/dts/renesas/rz-smarc-common.dtsi b/arch/arm64/boot/dts/renesas/rz-smarc-common.dtsi
new file mode 100644 (file)
index 0000000..588117a
--- /dev/null
@@ -0,0 +1,207 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+/*
+ * Device Tree Source for the RZ/{G2L,G2LC,V2L} SMARC EVK common parts
+ *
+ * Copyright (C) 2022 Renesas Electronics Corp.
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/rzg2l-pinctrl.h>
+
+/*
+ * SSI-WM8978
+ *
+ * This command is required when Playback/Capture
+ *
+ *     amixer cset name='Left Input Mixer L2 Switch' on
+ *     amixer cset name='Right Input Mixer R2 Switch' on
+ *     amixer cset name='Headphone Playback Volume' 100
+ *     amixer cset name='PCM Volume' 100%
+ *     amixer cset name='Input PGA Volume' 25
+ *
+ */
+
+/ {
+       aliases {
+               serial0 = &scif0;
+               i2c0 = &i2c0;
+               i2c1 = &i2c1;
+               i2c3 = &i2c3;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       audio_mclock: audio_mclock {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <11289600>;
+       };
+
+       snd_rzg2l: sound {
+               compatible = "simple-audio-card";
+               simple-audio-card,format = "i2s";
+               simple-audio-card,bitclock-master = <&cpu_dai>;
+               simple-audio-card,frame-master = <&cpu_dai>;
+               simple-audio-card,mclk-fs = <256>;
+
+               simple-audio-card,widgets = "Microphone", "Microphone Jack";
+               simple-audio-card,routing =
+                           "L2", "Mic Bias",
+                           "R2", "Mic Bias",
+                           "Mic Bias", "Microphone Jack";
+
+               cpu_dai: simple-audio-card,cpu {
+                       sound-dai = <&ssi0>;
+               };
+
+               codec_dai: simple-audio-card,codec {
+                       clocks = <&audio_mclock>;
+                       sound-dai = <&wm8978>;
+               };
+       };
+
+       usb0_vbus_otg: regulator-usb0-vbus-otg {
+               compatible = "regulator-fixed";
+
+               regulator-name = "USB0_VBUS_OTG";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+       };
+
+       vccq_sdhi1: regulator-vccq-sdhi1 {
+               compatible = "regulator-gpio";
+               regulator-name = "SDHI1 VccQ";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <3300000>;
+               gpios = <&pinctrl RZG2L_GPIO(39, 1) GPIO_ACTIVE_HIGH>;
+               gpios-states = <1>;
+               states = <3300000 1>, <1800000 0>;
+       };
+};
+
+&audio_clk1{
+       clock-frequency = <11289600>;
+};
+
+&audio_clk2{
+       clock-frequency = <12288000>;
+};
+
+&canfd {
+       pinctrl-0 = <&can0_pins &can1_pins>;
+       pinctrl-names = "default";
+       status = "okay";
+
+       channel0 {
+               status = "okay";
+       };
+
+       channel1 {
+               status = "okay";
+       };
+};
+
+&ehci0 {
+       dr_mode = "otg";
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&hsusb {
+       dr_mode = "otg";
+       status = "okay";
+};
+
+&i2c0 {
+       pinctrl-0 = <&i2c0_pins>;
+       pinctrl-names = "default";
+
+       status = "okay";
+};
+
+&i2c1 {
+       pinctrl-0 = <&i2c1_pins>;
+       pinctrl-names = "default";
+
+       status = "okay";
+};
+
+&i2c3 {
+       pinctrl-0 = <&i2c3_pins>;
+       pinctrl-names = "default";
+       clock-frequency = <400000>;
+
+       status = "okay";
+
+       wm8978: codec@1a {
+               compatible = "wlf,wm8978";
+               #sound-dai-cells = <0>;
+               reg = <0x1a>;
+       };
+};
+
+&ohci0 {
+       dr_mode = "otg";
+       status = "okay";
+};
+
+&ohci1 {
+       status = "okay";
+};
+
+&phyrst {
+       status = "okay";
+};
+
+&scif0 {
+       pinctrl-0 = <&scif0_pins>;
+       pinctrl-names = "default";
+       status = "okay";
+};
+
+&sdhi1 {
+       pinctrl-0 = <&sdhi1_pins>;
+       pinctrl-1 = <&sdhi1_pins_uhs>;
+       pinctrl-names = "default", "state_uhs";
+
+       vmmc-supply = <&reg_3p3v>;
+       vqmmc-supply = <&vccq_sdhi1>;
+       bus-width = <4>;
+       sd-uhs-sdr50;
+       sd-uhs-sdr104;
+       status = "okay";
+};
+
+&spi1 {
+       pinctrl-0 = <&spi1_pins>;
+       pinctrl-names = "default";
+
+       status = "okay";
+};
+
+&ssi0 {
+       pinctrl-0 = <&ssi0_pins>;
+       pinctrl-names = "default";
+
+       status = "okay";
+};
+
+&usb2_phy0 {
+       pinctrl-0 = <&usb0_pins>;
+       pinctrl-names = "default";
+
+       vbus-supply = <&usb0_vbus_otg>;
+       status = "okay";
+};
+
+&usb2_phy1 {
+       pinctrl-0 = <&usb1_pins>;
+       pinctrl-names = "default";
+
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/renesas/rzg2l-smarc-pinfunction.dtsi b/arch/arm64/boot/dts/renesas/rzg2l-smarc-pinfunction.dtsi
new file mode 100644 (file)
index 0000000..9085d8c
--- /dev/null
@@ -0,0 +1,137 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+/*
+ * Device Tree Source for the RZ/{G2L,V2L} SMARC pincontrol parts
+ *
+ * Copyright (C) 2021 Renesas Electronics Corp.
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/rzg2l-pinctrl.h>
+
+&pinctrl {
+       pinctrl-0 = <&sound_clk_pins>;
+       pinctrl-names = "default";
+
+       can0_pins: can0 {
+               pinmux = <RZG2L_PORT_PINMUX(10, 1, 2)>, /* TX */
+                        <RZG2L_PORT_PINMUX(11, 0, 2)>; /* RX */
+       };
+
+       /* SW7 should be at position 2->3 so that GPIO8_CAN0_STB line is activated */
+       can0-stb-hog {
+               gpio-hog;
+               gpios = <RZG2L_GPIO(42, 2) GPIO_ACTIVE_HIGH>;
+               output-low;
+               line-name = "can0_stb";
+       };
+
+       can1_pins: can1 {
+               pinmux = <RZG2L_PORT_PINMUX(12, 1, 2)>, /* TX */
+                        <RZG2L_PORT_PINMUX(13, 0, 2)>; /* RX */
+       };
+
+       /* SW8 should be at position 2->3 so that GPIO9_CAN1_STB line is activated */
+       can1-stb-hog {
+               gpio-hog;
+               gpios = <RZG2L_GPIO(42, 3) GPIO_ACTIVE_HIGH>;
+               output-low;
+               line-name = "can1_stb";
+       };
+
+       i2c0_pins: i2c0 {
+               pins = "RIIC0_SDA", "RIIC0_SCL";
+               input-enable;
+       };
+
+       i2c1_pins: i2c1 {
+               pins = "RIIC1_SDA", "RIIC1_SCL";
+               input-enable;
+       };
+
+       i2c3_pins: i2c3 {
+               pinmux = <RZG2L_PORT_PINMUX(18, 0, 3)>, /* SDA */
+                        <RZG2L_PORT_PINMUX(18, 1, 3)>; /* SCL */
+       };
+
+       scif0_pins: scif0 {
+               pinmux = <RZG2L_PORT_PINMUX(38, 0, 1)>, /* TxD */
+                        <RZG2L_PORT_PINMUX(38, 1, 1)>; /* RxD */
+       };
+
+       scif2_pins: scif2 {
+               pinmux = <RZG2L_PORT_PINMUX(48, 0, 1)>, /* TxD */
+                        <RZG2L_PORT_PINMUX(48, 1, 1)>, /* RxD */
+                        <RZG2L_PORT_PINMUX(48, 3, 1)>, /* CTS# */
+                        <RZG2L_PORT_PINMUX(48, 4, 1)>; /* RTS# */
+       };
+
+       sd1-pwr-en-hog {
+               gpio-hog;
+               gpios = <RZG2L_GPIO(39, 2) GPIO_ACTIVE_HIGH>;
+               output-high;
+               line-name = "sd1_pwr_en";
+       };
+
+       sdhi1_pins: sd1 {
+               sd1_data {
+                       pins = "SD1_DATA0", "SD1_DATA1", "SD1_DATA2", "SD1_DATA3";
+                       power-source = <3300>;
+               };
+
+               sd1_ctrl {
+                       pins = "SD1_CLK", "SD1_CMD";
+                       power-source = <3300>;
+               };
+
+               sd1_mux {
+                       pinmux = <RZG2L_PORT_PINMUX(19, 0, 1)>; /* SD1_CD */
+               };
+       };
+
+       sdhi1_pins_uhs: sd1_uhs {
+               sd1_data_uhs {
+                       pins = "SD1_DATA0", "SD1_DATA1", "SD1_DATA2", "SD1_DATA3";
+                       power-source = <1800>;
+               };
+
+               sd1_ctrl_uhs {
+                       pins = "SD1_CLK", "SD1_CMD";
+                       power-source = <1800>;
+               };
+
+               sd1_mux_uhs {
+                       pinmux = <RZG2L_PORT_PINMUX(19, 0, 1)>; /* SD1_CD */
+               };
+       };
+
+       sound_clk_pins: sound_clk {
+               pins = "AUDIO_CLK1", "AUDIO_CLK2";
+               input-enable;
+       };
+
+       spi1_pins: spi1 {
+               pinmux = <RZG2L_PORT_PINMUX(44, 0, 1)>, /* CK */
+                        <RZG2L_PORT_PINMUX(44, 1, 1)>, /* MOSI */
+                        <RZG2L_PORT_PINMUX(44, 2, 1)>, /* MISO */
+                        <RZG2L_PORT_PINMUX(44, 3, 1)>; /* SSL */
+       };
+
+       ssi0_pins: ssi0 {
+               pinmux = <RZG2L_PORT_PINMUX(45, 0, 1)>, /* BCK */
+                        <RZG2L_PORT_PINMUX(45, 1, 1)>, /* RCK */
+                        <RZG2L_PORT_PINMUX(45, 2, 1)>, /* TXD */
+                        <RZG2L_PORT_PINMUX(45, 3, 1)>; /* RXD */
+       };
+
+       usb0_pins: usb0 {
+               pinmux = <RZG2L_PORT_PINMUX(4, 0, 1)>, /* VBUS */
+                        <RZG2L_PORT_PINMUX(5, 0, 1)>, /* OVC */
+                        <RZG2L_PORT_PINMUX(5, 1, 1)>; /* OTG_ID */
+       };
+
+       usb1_pins: usb1 {
+               pinmux = <RZG2L_PORT_PINMUX(42, 0, 1)>, /* VBUS */
+                        <RZG2L_PORT_PINMUX(42, 1, 1)>; /* OVC */
+       };
+};
+
index 9112e79..aeacd22 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
 /*
- * Device Tree Source for the RZ/G2L SMARC SOM common parts
+ * Device Tree Source for the RZ/{G2L,V2L} SMARC SOM common parts
  *
  * Copyright (C) 2021 Renesas Electronics Corp.
  */
index 6f2a8bd..33ddfd1 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
 /*
- * Device Tree Source for the RZ/G2L SMARC EVK common parts
+ * Device Tree Source for the RZ/{G2L,V2L} SMARC EVK common parts
  *
  * Copyright (C) 2021 Renesas Electronics Corp.
  */
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/pinctrl/rzg2l-pinctrl.h>
 
-/*
- * SSI-WM8978
- *
- * This command is required when Playback/Capture
- *
- *     amixer cset name='Left Input Mixer L2 Switch' on
- *     amixer cset name='Right Input Mixer R2 Switch' on
- *     amixer cset name='Headphone Playback Volume' 100
- *     amixer cset name='PCM Volume' 100%
- *     amixer cset name='Input PGA Volume' 25
- *
- */
-
 /* comment the #define statement to disable SCIF2 (SER0) on PMOD1 (CN7) */
 #define PMOD1_SER0     1
 
 / {
        aliases {
-               serial0 = &scif0;
                serial1 = &scif2;
-               i2c0 = &i2c0;
-               i2c1 = &i2c1;
-               i2c3 = &i2c3;
-       };
-
-       chosen {
-               stdout-path = "serial0:115200n8";
-       };
-
-       audio_mclock: audio_mclock {
-               compatible = "fixed-clock";
-               #clock-cells = <0>;
-               clock-frequency = <11289600>;
-       };
-
-       snd_rzg2l: sound {
-               compatible = "simple-audio-card";
-               simple-audio-card,format = "i2s";
-               simple-audio-card,bitclock-master = <&cpu_dai>;
-               simple-audio-card,frame-master = <&cpu_dai>;
-               simple-audio-card,mclk-fs = <256>;
-
-               simple-audio-card,widgets = "Microphone", "Microphone Jack";
-               simple-audio-card,routing =
-                           "L2", "Mic Bias",
-                           "R2", "Mic Bias",
-                           "Mic Bias", "Microphone Jack";
-
-               cpu_dai: simple-audio-card,cpu {
-                       sound-dai = <&ssi0>;
-               };
-
-               codec_dai: simple-audio-card,codec {
-                       clocks = <&audio_mclock>;
-                       sound-dai = <&wm8978>;
-               };
-       };
-
-       usb0_vbus_otg: regulator-usb0-vbus-otg {
-               compatible = "regulator-fixed";
-
-               regulator-name = "USB0_VBUS_OTG";
-               regulator-min-microvolt = <5000000>;
-               regulator-max-microvolt = <5000000>;
-       };
-
-       vccq_sdhi1: regulator-vccq-sdhi1 {
-               compatible = "regulator-gpio";
-               regulator-name = "SDHI1 VccQ";
-               regulator-min-microvolt = <1800000>;
-               regulator-max-microvolt = <3300000>;
-               gpios = <&pinctrl RZG2L_GPIO(39, 1) GPIO_ACTIVE_HIGH>;
-               gpios-states = <1>;
-               states = <3300000 1>, <1800000 0>;
-       };
-};
-
-&audio_clk1{
-       clock-frequency = <11289600>;
-};
-
-&audio_clk2{
-       clock-frequency = <12288000>;
-};
-
-&canfd {
-       pinctrl-0 = <&can0_pins &can1_pins>;
-       pinctrl-names = "default";
-       status = "okay";
-
-       channel0 {
-               status = "okay";
-       };
-
-       channel1 {
-               status = "okay";
-       };
-};
-
-&ehci0 {
-       dr_mode = "otg";
-       status = "okay";
-};
-
-&ehci1 {
-       status = "okay";
-};
-
-&hsusb {
-       dr_mode = "otg";
-       status = "okay";
-};
-
-&i2c0 {
-       pinctrl-0 = <&i2c0_pins>;
-       pinctrl-names = "default";
-
-       status = "okay";
-};
-
-&i2c1 {
-       pinctrl-0 = <&i2c1_pins>;
-       pinctrl-names = "default";
-
-       status = "okay";
-};
-
-&i2c3 {
-       pinctrl-0 = <&i2c3_pins>;
-       pinctrl-names = "default";
-       clock-frequency = <400000>;
-
-       status = "okay";
-
-       wm8978: codec@1a {
-               compatible = "wlf,wm8978";
-               #sound-dai-cells = <0>;
-               reg = <0x1a>;
-       };
-};
-
-&ohci0 {
-       dr_mode = "otg";
-       status = "okay";
-};
-
-&ohci1 {
-       status = "okay";
-};
-
-&phyrst {
-       status = "okay";
-};
-
-&pinctrl {
-       pinctrl-0 = <&sound_clk_pins>;
-       pinctrl-names = "default";
-
-       can0_pins: can0 {
-               pinmux = <RZG2L_PORT_PINMUX(10, 1, 2)>, /* TX */
-                        <RZG2L_PORT_PINMUX(11, 0, 2)>; /* RX */
-       };
-
-       /* SW7 should be at position 2->3 so that GPIO8_CAN0_STB line is activated */
-       can0-stb {
-               gpio-hog;
-               gpios = <RZG2L_GPIO(42, 2) GPIO_ACTIVE_HIGH>;
-               output-low;
-               line-name = "can0_stb";
-       };
-
-       can1_pins: can1 {
-               pinmux = <RZG2L_PORT_PINMUX(12, 1, 2)>, /* TX */
-                        <RZG2L_PORT_PINMUX(13, 0, 2)>; /* RX */
-       };
-
-       /* SW8 should be at position 2->3 so that GPIO9_CAN1_STB line is activated */
-       can1-stb {
-               gpio-hog;
-               gpios = <RZG2L_GPIO(42, 3) GPIO_ACTIVE_HIGH>;
-               output-low;
-               line-name = "can1_stb";
-       };
-
-       i2c0_pins: i2c0 {
-               pins = "RIIC0_SDA", "RIIC0_SCL";
-               input-enable;
-       };
-
-       i2c1_pins: i2c1 {
-               pins = "RIIC1_SDA", "RIIC1_SCL";
-               input-enable;
-       };
-
-       i2c3_pins: i2c3 {
-               pinmux = <RZG2L_PORT_PINMUX(18, 0, 3)>, /* SDA */
-                        <RZG2L_PORT_PINMUX(18, 1, 3)>; /* SCL */
-       };
-
-       scif0_pins: scif0 {
-               pinmux = <RZG2L_PORT_PINMUX(38, 0, 1)>, /* TxD */
-                        <RZG2L_PORT_PINMUX(38, 1, 1)>; /* RxD */
-       };
-
-       scif2_pins: scif2 {
-               pinmux = <RZG2L_PORT_PINMUX(48, 0, 1)>, /* TxD */
-                        <RZG2L_PORT_PINMUX(48, 1, 1)>, /* RxD */
-                        <RZG2L_PORT_PINMUX(48, 3, 1)>, /* CTS# */
-                        <RZG2L_PORT_PINMUX(48, 4, 1)>; /* RTS# */
-       };
-
-       sd1-pwr-en-hog {
-               gpio-hog;
-               gpios = <RZG2L_GPIO(39, 2) GPIO_ACTIVE_HIGH>;
-               output-high;
-               line-name = "sd1_pwr_en";
-       };
-
-       sdhi1_pins: sd1 {
-               sd1_data {
-                       pins = "SD1_DATA0", "SD1_DATA1", "SD1_DATA2", "SD1_DATA3";
-                       power-source = <3300>;
-               };
-
-               sd1_ctrl {
-                       pins = "SD1_CLK", "SD1_CMD";
-                       power-source = <3300>;
-               };
-
-               sd1_mux {
-                       pinmux = <RZG2L_PORT_PINMUX(19, 0, 1)>; /* SD1_CD */
-               };
-       };
-
-       sdhi1_pins_uhs: sd1_uhs {
-               sd1_data_uhs {
-                       pins = "SD1_DATA0", "SD1_DATA1", "SD1_DATA2", "SD1_DATA3";
-                       power-source = <1800>;
-               };
-
-               sd1_ctrl_uhs {
-                       pins = "SD1_CLK", "SD1_CMD";
-                       power-source = <1800>;
-               };
-
-               sd1_mux_uhs {
-                       pinmux = <RZG2L_PORT_PINMUX(19, 0, 1)>; /* SD1_CD */
-               };
-       };
-
-       sound_clk_pins: sound_clk {
-               pins = "AUDIO_CLK1", "AUDIO_CLK2";
-               input-enable;
-       };
-
-       spi1_pins: spi1 {
-               pinmux = <RZG2L_PORT_PINMUX(44, 0, 1)>, /* CK */
-                        <RZG2L_PORT_PINMUX(44, 1, 1)>, /* MOSI */
-                        <RZG2L_PORT_PINMUX(44, 2, 1)>, /* MISO */
-                        <RZG2L_PORT_PINMUX(44, 3, 1)>; /* SSL */
-       };
-
-       ssi0_pins: ssi0 {
-               pinmux = <RZG2L_PORT_PINMUX(45, 0, 1)>, /* BCK */
-                        <RZG2L_PORT_PINMUX(45, 1, 1)>, /* RCK */
-                        <RZG2L_PORT_PINMUX(45, 2, 1)>, /* TXD */
-                        <RZG2L_PORT_PINMUX(45, 3, 1)>; /* RXD */
-       };
-
-       usb0_pins: usb0 {
-               pinmux = <RZG2L_PORT_PINMUX(4, 0, 1)>, /* VBUS */
-                        <RZG2L_PORT_PINMUX(5, 0, 1)>, /* OVC */
-                        <RZG2L_PORT_PINMUX(5, 1, 1)>; /* OTG_ID */
-       };
-
-       usb1_pins: usb1 {
-               pinmux = <RZG2L_PORT_PINMUX(42, 0, 1)>, /* VBUS */
-                        <RZG2L_PORT_PINMUX(42, 1, 1)>; /* OVC */
        };
 };
 
-&scif0 {
-       pinctrl-0 = <&scif0_pins>;
-       pinctrl-names = "default";
-       status = "okay";
-};
-
 /*
  * To enable SCIF2 (SER0) on PMOD1 (CN7)
  * SW1 should be at position 2->3 so that SER0_CTS# line is activated
        status = "okay";
 };
 #endif
-
-&sdhi1 {
-       pinctrl-0 = <&sdhi1_pins>;
-       pinctrl-1 = <&sdhi1_pins_uhs>;
-       pinctrl-names = "default", "state_uhs";
-
-       vmmc-supply = <&reg_3p3v>;
-       vqmmc-supply = <&vccq_sdhi1>;
-       bus-width = <4>;
-       sd-uhs-sdr50;
-       sd-uhs-sdr104;
-       status = "okay";
-};
-
-&spi1 {
-       pinctrl-0 = <&spi1_pins>;
-       pinctrl-names = "default";
-
-       status = "okay";
-};
-
-&ssi0 {
-       pinctrl-0 = <&ssi0_pins>;
-       pinctrl-names = "default";
-
-       status = "okay";
-};
-
-&usb2_phy0 {
-       pinctrl-0 = <&usb0_pins>;
-       pinctrl-names = "default";
-
-       vbus-supply = <&usb0_vbus_otg>;
-       status = "okay";
-};
-
-&usb2_phy1 {
-       pinctrl-0 = <&usb1_pins>;
-       pinctrl-names = "default";
-
-       status = "okay";
-};
diff --git a/arch/arm64/boot/dts/renesas/rzg2lc-smarc-pinfunction.dtsi b/arch/arm64/boot/dts/renesas/rzg2lc-smarc-pinfunction.dtsi
new file mode 100644 (file)
index 0000000..37ff209
--- /dev/null
@@ -0,0 +1,94 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+/*
+ * Device Tree Source for the RZ/G2LC SMARC pincontrol parts
+ *
+ * Copyright (C) 2021 Renesas Electronics Corp.
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/rzg2l-pinctrl.h>
+
+&pinctrl {
+       pinctrl-0 = <&sound_clk_pins>;
+       pinctrl-names = "default";
+
+       scif0_pins: scif0 {
+               pinmux = <RZG2L_PORT_PINMUX(38, 0, 1)>, /* TxD */
+                        <RZG2L_PORT_PINMUX(38, 1, 1)>; /* RxD */
+       };
+
+#if SW_SCIF_CAN
+       /* SW8 should be at position 2->1 */
+       can1_pins: can1 {
+               pinmux = <RZG2L_PORT_PINMUX(40, 0, 3)>, /* TxD */
+                        <RZG2L_PORT_PINMUX(40, 1, 3)>; /* RxD */
+       };
+#endif
+
+       scif1_pins: scif1 {
+               pinmux = <RZG2L_PORT_PINMUX(40, 0, 1)>, /* TxD */
+                        <RZG2L_PORT_PINMUX(40, 1, 1)>, /* RxD */
+                        <RZG2L_PORT_PINMUX(41, 0, 1)>, /* CTS# */
+                        <RZG2L_PORT_PINMUX(41, 1, 1)>; /* RTS# */
+       };
+
+#if SW_RSPI_CAN
+       /* SW8 should be at position 2->3 so that GPIO9_CAN1_STB line is activated */
+       can1-stb-hog {
+               gpio-hog;
+               gpios = <RZG2L_GPIO(44, 3) GPIO_ACTIVE_HIGH>;
+               output-low;
+               line-name = "can1_stb";
+       };
+
+       can1_pins: can1 {
+               pinmux = <RZG2L_PORT_PINMUX(44, 0, 3)>, /* TxD */
+                        <RZG2L_PORT_PINMUX(44, 1, 3)>; /* RxD */
+       };
+#endif
+
+       sd1-pwr-en-hog {
+               gpio-hog;
+               gpios = <RZG2L_GPIO(39, 2) GPIO_ACTIVE_HIGH>;
+               output-high;
+               line-name = "sd1_pwr_en";
+       };
+
+       sdhi1_pins: sd1 {
+               sd1_data {
+                       pins = "SD1_DATA0", "SD1_DATA1", "SD1_DATA2", "SD1_DATA3";
+                       power-source = <3300>;
+               };
+
+               sd1_ctrl {
+                       pins = "SD1_CLK", "SD1_CMD";
+                       power-source = <3300>;
+               };
+
+               sd1_mux {
+                       pinmux = <RZG2L_PORT_PINMUX(19, 0, 1)>; /* SD1_CD */
+               };
+       };
+
+       sdhi1_pins_uhs: sd1_uhs {
+               sd1_data_uhs {
+                       pins = "SD1_DATA0", "SD1_DATA1", "SD1_DATA2", "SD1_DATA3";
+                       power-source = <1800>;
+               };
+
+               sd1_ctrl_uhs {
+                       pins = "SD1_CLK", "SD1_CMD";
+                       power-source = <1800>;
+               };
+
+               sd1_mux_uhs {
+                       pinmux = <RZG2L_PORT_PINMUX(19, 0, 1)>; /* SD1_CD */
+               };
+       };
+
+       sound_clk_pins: sound_clk {
+               pins = "AUDIO_CLK1", "AUDIO_CLK2";
+               input-enable;
+       };
+};
+
diff --git a/arch/arm64/boot/dts/renesas/rzg2lc-smarc-som.dtsi b/arch/arm64/boot/dts/renesas/rzg2lc-smarc-som.dtsi
new file mode 100644 (file)
index 0000000..88a7938
--- /dev/null
@@ -0,0 +1,222 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+/*
+ * Device Tree Source for the RZ/G2LC SMARC SOM common parts
+ *
+ * Copyright (C) 2021 Renesas Electronics Corp.
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/rzg2l-pinctrl.h>
+
+/ {
+       aliases {
+               ethernet0 = &eth0;
+       };
+
+       chosen {
+               bootargs = "ignore_loglevel rw root=/dev/nfs ip=on";
+       };
+
+       memory@48000000 {
+               device_type = "memory";
+               /* first 128MB is reserved for secure area. */
+               reg = <0x0 0x48000000 0x0 0x38000000>;
+       };
+
+       reg_1p8v: regulator0 {
+               compatible = "regulator-fixed";
+               regulator-name = "fixed-1.8V";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               regulator-boot-on;
+               regulator-always-on;
+       };
+
+       reg_3p3v: regulator1 {
+               compatible = "regulator-fixed";
+               regulator-name = "fixed-3.3V";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               regulator-boot-on;
+               regulator-always-on;
+       };
+
+       vccq_sdhi0: regulator-vccq-sdhi0 {
+               compatible = "regulator-gpio";
+
+               regulator-name = "SDHI0 VccQ";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <3300000>;
+               states = <3300000 1>, <1800000 0>;
+               regulator-boot-on;
+               gpios = <&pinctrl RZG2L_GPIO(39, 0) GPIO_ACTIVE_HIGH>;
+               regulator-always-on;
+       };
+};
+
+&eth0 {
+       pinctrl-0 = <&eth0_pins>;
+       pinctrl-names = "default";
+       phy-handle = <&phy0>;
+       phy-mode = "rgmii-id";
+       status = "okay";
+
+       phy0: ethernet-phy@7 {
+               compatible = "ethernet-phy-id0022.1640",
+                            "ethernet-phy-ieee802.3-c22";
+               reg = <7>;
+               rxc-skew-psec = <2400>;
+               txc-skew-psec = <2400>;
+               rxdv-skew-psec = <0>;
+               txdv-skew-psec = <0>;
+               rxd0-skew-psec = <0>;
+               rxd1-skew-psec = <0>;
+               rxd2-skew-psec = <0>;
+               rxd3-skew-psec = <0>;
+               txd0-skew-psec = <0>;
+               txd1-skew-psec = <0>;
+               txd2-skew-psec = <0>;
+               txd3-skew-psec = <0>;
+       };
+};
+
+&extal_clk {
+       clock-frequency = <24000000>;
+};
+
+&pinctrl {
+       eth0_pins: eth0 {
+               pinmux = <RZG2L_PORT_PINMUX(28, 1, 1)>, /* ET0_LINKSTA */
+                        <RZG2L_PORT_PINMUX(27, 1, 1)>, /* ET0_MDC */
+                        <RZG2L_PORT_PINMUX(28, 0, 1)>, /* ET0_MDIO */
+                        <RZG2L_PORT_PINMUX(20, 0, 1)>, /* ET0_TXC */
+                        <RZG2L_PORT_PINMUX(20, 1, 1)>, /* ET0_TX_CTL */
+                        <RZG2L_PORT_PINMUX(20, 2, 1)>, /* ET0_TXD0 */
+                        <RZG2L_PORT_PINMUX(21, 0, 1)>, /* ET0_TXD1 */
+                        <RZG2L_PORT_PINMUX(21, 1, 1)>, /* ET0_TXD2 */
+                        <RZG2L_PORT_PINMUX(22, 0, 1)>, /* ET0_TXD3 */
+                        <RZG2L_PORT_PINMUX(24, 0, 1)>, /* ET0_RXC */
+                        <RZG2L_PORT_PINMUX(24, 1, 1)>, /* ET0_RX_CTL */
+                        <RZG2L_PORT_PINMUX(25, 0, 1)>, /* ET0_RXD0 */
+                        <RZG2L_PORT_PINMUX(25, 1, 1)>, /* ET0_RXD1 */
+                        <RZG2L_PORT_PINMUX(26, 0, 1)>, /* ET0_RXD2 */
+                        <RZG2L_PORT_PINMUX(26, 1, 1)>; /* ET0_RXD3 */
+       };
+
+       gpio-sd0-pwr-en-hog {
+               gpio-hog;
+               gpios = <RZG2L_GPIO(18, 1) GPIO_ACTIVE_HIGH>;
+               output-high;
+               line-name = "gpio_sd0_pwr_en";
+       };
+
+       /*
+        * SD0 device selection is XOR between GPIO_SD0_DEV_SEL and SW1[2]
+        * The below switch logic can be used to select the device between
+        * eMMC and microSD, after setting GPIO_SD0_DEV_SEL to high in DT.
+        * SW1[2] should be at OFF position to enable 64 GB eMMC
+        * SW1[2] should be at position ON to enable uSD card CN3
+        */
+       gpio-sd0-dev-sel-hog {
+               gpio-hog;
+               gpios = <RZG2L_GPIO(40, 2) GPIO_ACTIVE_HIGH>;
+               output-high;
+               line-name = "gpio_sd0_dev_sel";
+       };
+
+       sdhi0_emmc_pins: sd0emmc {
+               sd0_emmc_data {
+                       pins = "SD0_DATA0", "SD0_DATA1", "SD0_DATA2", "SD0_DATA3",
+                              "SD0_DATA4", "SD0_DATA5", "SD0_DATA6", "SD0_DATA7";
+                       power-source = <1800>;
+               };
+
+               sd0_emmc_ctrl {
+                       pins = "SD0_CLK", "SD0_CMD";
+                       power-source = <1800>;
+               };
+
+               sd0_emmc_rst {
+                       pins = "SD0_RST#";
+                       power-source = <1800>;
+               };
+       };
+
+       sdhi0_pins: sd0 {
+               sd0_data {
+                       pins = "SD0_DATA0", "SD0_DATA1", "SD0_DATA2", "SD0_DATA3";
+                       power-source = <3300>;
+               };
+
+               sd0_ctrl {
+                       pins = "SD0_CLK", "SD0_CMD";
+                       power-source = <3300>;
+               };
+
+               sd0_mux {
+                       pinmux = <RZG2L_PORT_PINMUX(18, 0, 1)>; /* SD0_CD */
+               };
+       };
+
+       sdhi0_pins_uhs: sd0_uhs {
+               sd0_data_uhs {
+                       pins = "SD0_DATA0", "SD0_DATA1", "SD0_DATA2", "SD0_DATA3";
+                       power-source = <1800>;
+               };
+
+               sd0_ctrl_uhs {
+                       pins = "SD0_CLK", "SD0_CMD";
+                       power-source = <1800>;
+               };
+
+               sd0_mux_uhs {
+                       pinmux = <RZG2L_PORT_PINMUX(18, 0, 1)>; /* SD0_CD */
+               };
+       };
+};
+
+#if (!SW_SD0_DEV_SEL)
+&sdhi0 {
+       pinctrl-0 = <&sdhi0_pins>;
+       pinctrl-1 = <&sdhi0_pins_uhs>;
+       pinctrl-names = "default", "state_uhs";
+
+       vmmc-supply = <&reg_3p3v>;
+       vqmmc-supply = <&vccq_sdhi0>;
+       bus-width = <4>;
+       sd-uhs-sdr50;
+       sd-uhs-sdr104;
+       status = "okay";
+};
+#endif
+
+#if SW_SD0_DEV_SEL
+&sdhi0 {
+       pinctrl-0 = <&sdhi0_emmc_pins>;
+       pinctrl-1 = <&sdhi0_emmc_pins>;
+       pinctrl-names = "default", "state_uhs";
+
+       vmmc-supply = <&reg_3p3v>;
+       vqmmc-supply = <&reg_1p8v>;
+       bus-width = <8>;
+       mmc-hs200-1_8v;
+       non-removable;
+       fixed-emmc-driver-type = <1>;
+       status = "okay";
+};
+#endif
+
+&wdt0 {
+       status = "okay";
+       timeout-sec = <60>;
+};
+
+&wdt1 {
+       status = "okay";
+       timeout-sec = <60>;
+};
+
+&wdt2 {
+       status = "okay";
+       timeout-sec = <60>;
+};
diff --git a/arch/arm64/boot/dts/renesas/rzg2lc-smarc.dtsi b/arch/arm64/boot/dts/renesas/rzg2lc-smarc.dtsi
new file mode 100644 (file)
index 0000000..df7631f
--- /dev/null
@@ -0,0 +1,77 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+/*
+ * Device Tree Source for the RZ/G2LC SMARC EVK parts
+ *
+ * Copyright (C) 2022 Renesas Electronics Corp.
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/rzg2l-pinctrl.h>
+
+/*
+ * DIP-Switch SW1 setting on SoM
+ * 1 : High; 0: Low
+ * SW1-2 : SW_SD0_DEV_SEL      (1: eMMC; 0: uSD)
+ * SW1-3 : SW_SCIF_CAN         (1: CAN1; 0: SCIF1)
+ * SW1-4 : SW_RSPI_CAN         (1: CAN1; 0: RSPI1)
+ * SW1-5 : SW_I2S0_I2S1                (1: I2S2 (HDMI audio); 0: I2S0)
+ * Please change below macros according to SW1 setting
+ */
+
+#define SW_SD0_DEV_SEL 1
+
+#define SW_SCIF_CAN    0
+#if (SW_SCIF_CAN)
+/* Due to HW routing, SW_RSPI_CAN is always 0 when SW_SCIF_CAN is set to 1 */
+#define SW_RSPI_CAN    0
+#else
+/* Please set SW_RSPI_CAN. Default value is 1 */
+#define SW_RSPI_CAN    1
+#endif
+
+#if (SW_SCIF_CAN & SW_RSPI_CAN)
+#error "Can not set 1 to both SW_SCIF_CAN and SW_RSPI_CAN due to HW routing"
+#endif
+
+#include "rzg2lc-smarc-som.dtsi"
+#include "rzg2lc-smarc-pinfunction.dtsi"
+#include "rz-smarc-common.dtsi"
+
+/* comment the #define statement to disable SCIF1 (SER0) on PMOD1 (CN7) */
+#define PMOD1_SER0     1
+
+/ {
+       aliases {
+               serial1 = &scif1;
+       };
+};
+
+#if (SW_SCIF_CAN || SW_RSPI_CAN)
+&canfd {
+       pinctrl-0 = <&can1_pins>;
+       /delete-node/ channel@0;
+};
+#else
+&canfd {
+       /delete-property/ pinctrl-0;
+       /delete-property/ pinctrl-names;
+       status = "disabled";
+};
+#endif
+
+/*
+ * To enable SCIF1 (SER0) on PMOD1 (CN7), On connector board
+ * SW1 should be at position 2->3 so that SER0_CTS# line is activated
+ * SW2 should be at position 2->3 so that SER0_TX line is activated
+ * SW3 should be at position 2->3 so that SER0_RX line is activated
+ * SW4 should be at position 2->3 so that SER0_RTS# line is activated
+ */
+#if (!SW_SCIF_CAN && PMOD1_SER0)
+&scif1 {
+       pinctrl-0 = <&scif1_pins>;
+       pinctrl-names = "default";
+
+       uart-has-rtscts;
+       status = "okay";
+};
+#endif
index 61bd4df..ae532cd 100644 (file)
                select-gpios = <&gpio_exp_75 13 GPIO_ACTIVE_HIGH>;
        };
 
+       hdmi1-out {
+               compatible = "hdmi-connector";
+               type = "a";
+
+               port {
+                       hdmi1_con: endpoint {
+                               remote-endpoint = <&adv7513_out>;
+                       };
+               };
+       };
+
+       accel_3v3: regulator-acc-3v3 {
+               compatible = "regulator-fixed";
+               regulator-name = "accel-3v3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+       };
+
+       hdmi_1v8: regulator-hdmi-1v8 {
+               compatible = "regulator-fixed";
+               regulator-name = "hdmi-1v8";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+       };
+
+       hdmi_3v3: regulator-hdmi-3v3 {
+               compatible = "regulator-fixed";
+               regulator-name = "hdmi-3v3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+       };
+
        snd_3p3v: regulator-snd_3p3v {
                compatible = "regulator-fixed";
                regulator-name = "snd-3.3v";
        status = "okay";
 };
 
+&du_out_rgb {
+       remote-endpoint = <&adv7513_in>;
+};
+
 &ehci0 {
        dr_mode = "otg";
        status = "okay";
                reg = <0x71>;
                reset-gpios = <&gpio5 3 GPIO_ACTIVE_LOW>;
 
+               /* HDMIoSDA, HDMIoSCL */
+               i2c@4 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <4>;
+
+                       hdmi@3d {
+                               compatible = "adi,adv7513";
+                               reg = <0x3d>;
+
+                               pinctrl-0 = <&hdmi1_pins>;
+                               pinctrl-names = "default";
+
+                               interrupt-parent = <&gpio2>;
+                               interrupts = <14 IRQ_TYPE_LEVEL_LOW>;
+
+                               clocks = <&cs2000>;
+                               clock-names = "cec";
+
+                               pd-gpios = <&gpio_exp_75 5 GPIO_ACTIVE_LOW>;
+
+                               avdd-supply = <&hdmi_1v8>;
+                               dvdd-supply = <&hdmi_1v8>;
+                               pvdd-supply = <&hdmi_1v8>;
+                               dvdd-3v-supply = <&hdmi_3v3>;
+                               bgvdd-supply = <&hdmi_1v8>;
+
+                               adi,input-depth = <8>;
+                               adi,input-colorspace = "rgb";
+                               adi,input-clock = "1x";
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       port@0 {
+                                               reg = <0>;
+                                               adv7513_in: endpoint {
+                                                       remote-endpoint = <&du_out_rgb>;
+                                               };
+                                       };
+
+                                       port@1 {
+                                               reg = <1>;
+                                               adv7513_out: endpoint {
+                                                       remote-endpoint = <&hdmi1_con>;
+                                               };
+                                       };
+                               };
+                       };
+               };
+
                /* Audio_SDA, Audio_SCL */
                i2c@7 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        reg = <7>;
 
+                       accelerometer@1d {
+                               compatible = "st,lsm9ds0-imu";
+                               reg = <0x1d>;
+
+                               vdd-supply = <&accel_3v3>;
+                               vddio-supply = <&accel_3v3>;
+                       };
+
                        pcm3168a: audio-codec@44 {
                                #sound-dai-cells = <0>;
                                compatible = "ti,pcm3168a";
                                        };
                                };
                        };
+
+                       gyroscope@6b {
+                               compatible = "st,lsm9ds0-gyro";
+                               reg = <0x6b>;
+
+                               vdd-supply = <&accel_3v3>;
+                               vddio-supply = <&accel_3v3>;
+                       };
                };
        };
 
                function = "can1";
        };
 
+       hdmi1_pins: hdmi1 {
+               adv7513-interrupt {
+                       pins = "GP_2_14";
+                       bias-pull-up;
+               };
+
+               du {
+                       groups = "du_rgb888", "du_sync", "du_clk_out_0",
+                                "du_disp";
+                       function = "du";
+               };
+       };
+
        hscif0_pins: hscif0 {
                groups = "hscif0_data", "hscif0_ctrl";
                function = "hscif0";
                     &sound_pcm_pins>;
 
        ports {
-               /* rsnd_port0/1 are on salvator-common */
+               /* rsnd_port0/1 are defined in ulcb.dtsi */
                rsnd_port2: port@2 {
                        reg = <2>;
                        rsnd_for_pcm3168a_play: endpoint {
                                remote-endpoint = <&pcm3168a_endpoint_p>;
-
-                               dai-format = "i2s";
-                               bitclock-master = <&rsnd_for_pcm3168a_play>;
-                               frame-master = <&rsnd_for_pcm3168a_play>;
+                               bitclock-master;
+                               frame-master;
                                dai-tdm-slot-num = <8>;
-
                                playback = <&ssi3>;
                        };
                };
                        reg = <3>;
                        rsnd_for_pcm3168a_capture: endpoint {
                                remote-endpoint = <&pcm3168a_endpoint_c>;
-
-                               dai-format = "i2s";
-                               bitclock-master = <&rsnd_for_pcm3168a_capture>;
-                               frame-master = <&rsnd_for_pcm3168a_capture>;
+                               bitclock-master;
+                               frame-master;
                                dai-tdm-slot-num = <6>;
-
                                capture  = <&ssi4>;
                        };
                };
 };
 
 &sound_card {
-       dais = <&rsnd_port0     /* ak4613 */
-               &rsnd_port1     /* HDMI0  */
-               &rsnd_port2     /* pcm3168a playback */
-               &rsnd_port3     /* pcm3168a capture  */
+       links = <&rsnd_port0    /* ak4613 */
+                &rsnd_port1    /* HDMI0  */
+                &rsnd_port2    /* pcm3168a playback */
+                &rsnd_port3    /* pcm3168a capture  */
                >;
 };
 
index a7e93df..b4bdb2d 100644 (file)
        };
 
        sound_card: sound {
-               compatible = "audio-graph-card";
+               compatible = "audio-graph-card2";
                label = "rcar-sound";
 
-               dais = <&rsnd_port0     /* ak4613 */
-                       &rsnd_port1     /* HDMI0  */
+               links = <&rsnd_port0    /* ak4613 */
+                        &rsnd_port1    /* HDMI0  */
                        >;
        };
 
                        reg = <0>;
                        rsnd_for_ak4613: endpoint {
                                remote-endpoint = <&ak4613_endpoint>;
-
-                               dai-format = "left_j";
-                               bitclock-master = <&rsnd_for_ak4613>;
-                               frame-master = <&rsnd_for_ak4613>;
-
+                               bitclock-master;
+                               frame-master;
                                playback = <&ssi0>, <&src0>, <&dvc0>;
                                capture  = <&ssi1>, <&src1>, <&dvc1>;
                        };
                        reg = <1>;
                        rsnd_for_hdmi: endpoint {
                                remote-endpoint = <&dw_hdmi0_snd_in>;
-
-                               dai-format = "i2s";
-                               bitclock-master = <&rsnd_for_hdmi>;
-                               frame-master = <&rsnd_for_hdmi>;
-
+                               bitclock-master;
+                               frame-master;
                                playback = <&ssi2>;
                        };
                };
index 479906f..4ae9f35 100644 (file)
@@ -56,5 +56,8 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rockpro64.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-sapphire.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-sapphire-excavator.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399pro-rock-pi-n10.dtb
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-pinenote-v1.1.dtb
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-pinenote-v1.2.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-quartz64-a.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-evb1-v10.dtb
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-bpi-r2-pro.dtb
index c4dd2a6..19683f1 100644 (file)
        vdd_log: vdd-log {
                compatible = "pwm-regulator";
                pwms = <&pwm2 0 25000 1>;
+               pwm-supply = <&vcc_sys>;
                regulator-name = "vdd_log";
                regulator-always-on;
                regulator-boot-on;
                regulator-min-microvolt = <430000>;
                regulator-max-microvolt = <1400000>;
-               vin-supply = <&vcc_sys>;
        };
 };
 
        status = "okay";
 };
 
+&gpu {
+       mali-supply = <&vdd_gpu>;
+       status = "okay";
+};
+
 &hdmi {
        ddc-i2c-bus = <&i2c3>;
        pinctrl-names = "default";
index 9b2c679..3355fb9 100644 (file)
@@ -462,7 +462,7 @@ ap_i2c_tp: &i2c5 {
 };
 
 &cros_ec {
-       cros_ec_pwm: ec-pwm {
+       cros_ec_pwm: pwm {
                compatible = "google,cros-ec-pwm";
                #pwm-cells = <1>;
        };
index f1fcc6b..7ba3ed2 100644 (file)
        vdd_log: vdd-log {
                compatible = "pwm-regulator";
                pwms = <&pwm2 0 25000 1>;
+               pwm-supply = <&vsys_3v3>;
                regulator-name = "vdd_log";
                regulator-always-on;
                regulator-boot-on;
                regulator-min-microvolt = <800000>;
                regulator-max-microvolt = <1400000>;
-               vin-supply = <&vsys_3v3>;
        };
 
        vsys: vsys {
index e890166..5bbe74b 100644 (file)
        vdd_log: vdd-log {
                compatible = "pwm-regulator";
                pwms = <&pwm2 0 25000 1>;
+               pwm-supply = <&vcc5v0_sys>;
                regulator-name = "vdd_log";
                regulator-always-on;
                regulator-boot-on;
                regulator-min-microvolt = <800000>;
                regulator-max-microvolt = <1400000>;
-               vin-supply = <&vcc5v0_sys>;
        };
 };
 
index 04b54ab..9d3a718 100644 (file)
        vdd_log: vdd-log {
                compatible = "pwm-regulator";
                pwms = <&pwm2 0 25000 1>;
+               pwm-supply = <&vcc_sys>;
                regulator-name = "vdd_log";
                regulator-always-on;
                regulator-boot-on;
                regulator-min-microvolt = <800000>;
                regulator-max-microvolt = <1400000>;
-               vin-supply = <&vcc_sys>;
        };
 };
 
index c2f021a..8a048dd 100644 (file)
        vdd_log: vdd-log {
                compatible = "pwm-regulator";
                pwms = <&pwm2 0 25000 1>;
+               pwm-supply = <&vcc_sysin>;
                regulator-name = "vdd_log";
                regulator-always-on;
                regulator-boot-on;
                regulator-min-microvolt = <800000>;
                regulator-max-microvolt = <1400000>;
-               vin-supply = <&vcc_sysin>;
 
                regulator-state-mem {
                        regulator-on-in-suspend;
index fb67db4..b91fb0b 100644 (file)
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
        };
+
+       vdd_log: vdd-log {
+               compatible = "pwm-regulator";
+               pwms = <&pwm2 0 25000 1>;
+               pwm-supply = <&vcc5v0_sys>;
+               regulator-name = "vdd_log";
+               regulator-min-microvolt = <800000>;
+               regulator-max-microvolt = <1400000>;
+               regulator-always-on;
+               regulator-boot-on;
+       };
 };
 
 &cpu_b0 {
index 92acf6e..401e1ae 100644 (file)
        vdd_log: vdd-log {
                compatible = "pwm-regulator";
                pwms = <&pwm2 0 25000 1>;
+               pwm-supply = <&vcc5v0_sys>;
                regulator-name = "vdd_log";
                regulator-always-on;
                regulator-boot-on;
                regulator-min-microvolt = <800000>;
                regulator-max-microvolt = <1400000>;
-               vin-supply = <&vcc5v0_sys>;
        };
 };
 
index 83db4ca..45e77f8 100644 (file)
        vdd_log: vdd-log {
                compatible = "pwm-regulator";
                pwms = <&pwm2 0 25000 1>;
+               pwm-supply = <&vcc5v0_sys>;
                regulator-name = "vdd_log";
                regulator-always-on;
                regulator-boot-on;
                regulator-min-microvolt = <800000>;
                regulator-max-microvolt = <1700000>;
-               vin-supply = <&vcc5v0_sys>;
        };
 };
 
index 46b0f97..2aa0fad 100644 (file)
        vdd_log: vdd-log {
                compatible = "pwm-regulator";
                pwms = <&pwm2 0 25000 1>;
+               pwm-supply = <&vcc_sys>;
                regulator-name = "vdd_log";
                regulator-always-on;
                regulator-boot-on;
                regulator-min-microvolt = <800000>;
                regulator-max-microvolt = <1400000>;
-               vin-supply = <&vcc_sys>;
        };
 };
 
diff --git a/arch/arm64/boot/dts/rockchip/rk3566-pinenote-v1.1.dts b/arch/arm64/boot/dts/rockchip/rk3566-pinenote-v1.1.dts
new file mode 100644 (file)
index 0000000..5b0b7eb
--- /dev/null
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+/dts-v1/;
+
+#include "rk3566-pinenote.dtsi"
+
+/ {
+       model = "Pine64 PineNote v1.1";
+       compatible = "pine64,pinenote-v1.1", "pine64,pinenote", "rockchip,rk3566";
+};
+
+&pmu_io_domains {
+       vccio7-supply = <&vcc_1v8>;
+};
+
+&spk_amp {
+       VCC-supply = <&dcdc_boost>;
+};
diff --git a/arch/arm64/boot/dts/rockchip/rk3566-pinenote-v1.2.dts b/arch/arm64/boot/dts/rockchip/rk3566-pinenote-v1.2.dts
new file mode 100644 (file)
index 0000000..6bbc4c6
--- /dev/null
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+/dts-v1/;
+
+#include "rk3566-pinenote.dtsi"
+
+/ {
+       model = "Pine64 PineNote v1.2";
+       compatible = "pine64,pinenote-v1.2", "pine64,pinenote", "rockchip,rk3566";
+};
+
+&pmu_io_domains {
+       vccio7-supply = <&vcc_3v3>;
+};
+
+&spk_amp {
+       VCC-supply = <&vcc_bat>;
+};
diff --git a/arch/arm64/boot/dts/rockchip/rk3566-pinenote.dtsi b/arch/arm64/boot/dts/rockchip/rk3566-pinenote.dtsi
new file mode 100644 (file)
index 0000000..fea748a
--- /dev/null
@@ -0,0 +1,639 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/gpio-keys.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/pinctrl/rockchip.h>
+
+#include "rk3566.dtsi"
+
+/ {
+       aliases {
+               mmc0 = &sdhci;
+       };
+
+       chosen {
+               stdout-path = "serial2:1500000n8";
+       };
+
+       adc-keys {
+               compatible = "adc-keys";
+               io-channels = <&saradc 0>;
+               io-channel-names = "buttons";
+               keyup-threshold-microvolt = <1750000>;
+
+               recovery {
+                       label = "recovery";
+                       linux,code = <KEY_VENDOR>;
+                       press-threshold-microvolt = <0>;
+               };
+       };
+
+       spk_amp: audio-amplifier {
+               compatible = "simple-audio-amplifier";
+               enable-gpios = <&gpio3 RK_PC4 GPIO_ACTIVE_HIGH>;
+               pinctrl-0 = <&spk_amp_enable_h>;
+               pinctrl-names = "default";
+               sound-name-prefix = "Speaker Amp";
+       };
+
+       dmic_codec: dmic-codec {
+               compatible = "dmic-codec";
+               num-channels = <6>;
+               #sound-dai-cells = <0>;
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               pinctrl-0 = <&hall_int_l>;
+               pinctrl-names = "default";
+
+               cover {
+                       label = "cover";
+                       gpios = <&gpio0 RK_PC7 GPIO_ACTIVE_LOW>;
+                       linux,input-type = <EV_SW>;
+                       linux,code = <SW_MACHINE_COVER>;
+                       linux,can-disable;
+                       wakeup-event-action = <EV_ACT_DEASSERTED>;
+                       wakeup-source;
+               };
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+               pinctrl-0 = <&led_pin>;
+               pinctrl-names = "default";
+
+               led-0 {
+                       color = <LED_COLOR_ID_WHITE>;
+                       function = LED_FUNCTION_CHARGING;
+                       gpios = <&gpio3 RK_PC5 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       sdio_pwrseq: sdio-pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               clocks = <&rk817 1>;
+               clock-names = "ext_clock";
+               pinctrl-0 = <&wifi_enable_h>;
+               pinctrl-names = "default";
+               reset-gpios = <&gpio0 RK_PC6 GPIO_ACTIVE_LOW>;
+       };
+
+       sound {
+               compatible = "simple-audio-card";
+               simple-audio-card,name = "PineNote";
+               simple-audio-card,aux-devs = <&spk_amp>;
+               simple-audio-card,widgets = "Headphone", "Headphones",
+                                           "Speaker", "Internal Speakers";
+               simple-audio-card,routing = "Headphones", "HPOL",
+                                           "Headphones", "HPOR",
+                                           "Internal Speakers", "Speaker Amp OUTL",
+                                           "Internal Speakers", "Speaker Amp OUTR",
+                                           "Speaker Amp INL", "HPOL",
+                                           "Speaker Amp INR", "HPOR";
+               simple-audio-card,pin-switches = "Internal Speakers";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               simple-audio-card,dai-link@0 {
+                       reg = <0>;
+                       bitclock-master = <&link0_cpu>;
+                       format = "i2s";
+                       frame-master = <&link0_cpu>;
+                       mclk-fs = <256>;
+
+                       link0_cpu: cpu {
+                               sound-dai = <&i2s1_8ch>;
+                       };
+
+                       link0_codec: codec {
+                               sound-dai = <&rk817>;
+                       };
+               };
+
+               simple-audio-card,dai-link@1 {
+                       reg = <1>;
+                       bitclock-master = <&link1_cpu>;
+                       format = "pdm";
+                       frame-master = <&link1_cpu>;
+
+                       link1_cpu: cpu {
+                               sound-dai = <&pdm>;
+                       };
+
+                       link1_codec: codec {
+                               sound-dai = <&dmic_codec>;
+                       };
+               };
+       };
+
+       vbat_4g: vbat-4g {
+               compatible = "regulator-fixed";
+               regulator-name = "vbat_4g";
+               regulator-min-microvolt = <3800000>;
+               regulator-max-microvolt = <3800000>;
+               /* powered by vcc_bat, enabled by vbat_4g_en */
+               vin-supply = <&vbat_4g_en>;
+       };
+
+       vcc_1v8: vcc-1v8 {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc_1v8";
+               regulator-always-on;
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               /* powered by vcc_sys, enabled by vcc_1v8_en */
+               vin-supply = <&vcc_1v8_en>;
+       };
+
+       vcc_bat: vcc-bat {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc_bat";
+               regulator-always-on;
+               regulator-min-microvolt = <3800000>;
+               regulator-max-microvolt = <3800000>;
+       };
+
+       vcc_hall_3v3: vcc-hall-3v3 {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc_hall_3v3";
+               regulator-always-on;
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&vcc_sys>;
+       };
+
+       vcc_sys: vcc-sys {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc_sys";
+               regulator-always-on;
+               regulator-min-microvolt = <3800000>;
+               regulator-max-microvolt = <3800000>;
+               vin-supply = <&vcc_bat>;
+       };
+
+       vcc_wl: vcc-wl {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>;
+               pinctrl-0 = <&vcc_wl_pin>;
+               pinctrl-names = "default";
+               regulator-name = "vcc_wl";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&vcc_bat>;
+       };
+
+       vdda_0v9: vdda-0v9 {
+               compatible = "regulator-fixed";
+               regulator-name = "vdda_0v9";
+               regulator-always-on;
+               regulator-min-microvolt = <900000>;
+               regulator-max-microvolt = <900000>;
+               /* powered by vcc_sys, enabled by vcc_1v8_en */
+               vin-supply = <&vcc_1v8_en>;
+       };
+};
+
+&cpu0 {
+       cpu-supply = <&vdd_cpu>;
+};
+
+&cpu1 {
+       cpu-supply = <&vdd_cpu>;
+};
+
+&cpu2 {
+       cpu-supply = <&vdd_cpu>;
+};
+
+&cpu3 {
+       cpu-supply = <&vdd_cpu>;
+};
+
+&i2c0 {
+       status = "okay";
+
+       vdd_cpu: regulator@1c {
+               compatible = "tcs,tcs4525";
+               reg = <0x1c>;
+               fcs,suspend-voltage-selector = <0>;
+               regulator-name = "vdd_cpu";
+               regulator-min-microvolt = <712500>;
+               regulator-max-microvolt = <1390000>;
+               regulator-ramp-delay = <2300>;
+               regulator-always-on;
+               vin-supply = <&vcc_sys>;
+
+               regulator-state-mem {
+                       regulator-on-in-suspend;
+               };
+       };
+
+       rk817: pmic@20 {
+               compatible = "rockchip,rk817";
+               reg = <0x20>;
+               interrupt-parent = <&gpio0>;
+               interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>;
+               assigned-clocks = <&cru I2S1_MCLKOUT_TX>;
+               assigned-clock-parents = <&cru CLK_I2S1_8CH_TX>;
+               clocks = <&cru I2S1_MCLKOUT_TX>;
+               clock-names = "mclk";
+               #clock-cells = <1>;
+               pinctrl-0 = <&i2s1m0_mclk>, <&pmic_int_l>, <&pmic_sleep>;
+               pinctrl-names = "default";
+               rockchip,system-power-controller;
+               #sound-dai-cells = <0>;
+               wakeup-source;
+
+               vcc1-supply = <&vcc_sys>;
+               vcc2-supply = <&vcc_sys>;
+               vcc3-supply = <&vcc_sys>;
+               vcc4-supply = <&vcc_sys>;
+               vcc5-supply = <&vcc_sys>;
+               vcc6-supply = <&vcc_sys>;
+               vcc7-supply = <&vcc_sys>;
+               vcc8-supply = <&vcc_sys>;
+               vcc9-supply = <&dcdc_boost>;
+
+               regulators {
+                       vdd_logic: DCDC_REG1 {
+                               regulator-name = "vdd_logic";
+                               regulator-always-on;
+                               regulator-min-microvolt = <500000>;
+                               regulator-max-microvolt = <1350000>;
+                               regulator-init-microvolt = <900000>;
+                               regulator-ramp-delay = <6001>;
+                               regulator-initial-mode = <0x2>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                                       regulator-suspend-microvolt = <900000>;
+                               };
+                       };
+
+                       vdd_gpu_npu: DCDC_REG2 {
+                               regulator-name = "vdd_gpu_npu";
+                               regulator-min-microvolt = <500000>;
+                               regulator-max-microvolt = <1350000>;
+                               regulator-init-microvolt = <900000>;
+                               regulator-ramp-delay = <6001>;
+                               regulator-initial-mode = <0x2>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vcc_ddr: DCDC_REG3 {
+                               regulator-name = "vcc_ddr";
+                               regulator-always-on;
+                               regulator-initial-mode = <0x2>;
+
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       vcc_3v3: DCDC_REG4 {
+                               regulator-name = "vcc_3v3";
+                               regulator-always-on;
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-initial-mode = <0x2>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vcca_1v8_pmu: LDO_REG1 {
+                               regulator-name = "vcca_1v8_pmu";
+                               regulator-always-on;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       /* unused */
+                       vdda_0v9_ldo: LDO_REG2 {
+                               regulator-name = "vdda_0v9_ldo";
+                               regulator-min-microvolt = <900000>;
+                               regulator-max-microvolt = <900000>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vdda_0v9_pmu: LDO_REG3 {
+                               regulator-name = "vdda_0v9_pmu";
+                               regulator-always-on;
+                               regulator-min-microvolt = <900000>;
+                               regulator-max-microvolt = <900000>;
+
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       vccio_acodec: LDO_REG4 {
+                               regulator-name = "vccio_acodec";
+                               regulator-always-on;
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       /* unused */
+                       vccio_sd: LDO_REG5 {
+                               regulator-name = "vccio_sd";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <3300000>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vcc_3v3_pmu: LDO_REG6 {
+                               regulator-name = "vcc_3v3_pmu";
+                               regulator-always-on;
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       vcc_1v8_en: LDO_REG7 {
+                               regulator-name = "vcc_1v8_en";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vbat_4g_en: LDO_REG8 {
+                               regulator-name = "vbat_4g_en";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       sleep_sta_ctl: LDO_REG9 {
+                               regulator-name = "sleep_sta_ctl";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       dcdc_boost: BOOST {
+                               regulator-name = "boost";
+                               regulator-min-microvolt = <5000000>;
+                               regulator-max-microvolt = <5000000>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       otg_switch: OTG_SWITCH {
+                               regulator-name = "otg_switch";
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+               };
+       };
+};
+
+&i2c1 {
+       status = "okay";
+
+       digitizer@9 {
+               compatible = "wacom,w9013", "hid-over-i2c";
+               reg = <0x09>;
+               interrupt-parent = <&gpio0>;
+               interrupts = <RK_PB6 IRQ_TYPE_LEVEL_LOW>;
+               hid-descr-addr = <0x1>;
+               pinctrl-0 = <&pen_fwe>, <&pen_irq_l>, <&pen_rst_l>;
+               pinctrl-names = "default";
+               vdd-supply = <&vcc_3v3_pmu>;
+       };
+};
+
+&i2c3 {
+       pinctrl-0 = <&i2c3m1_xfer>;
+       status = "okay";
+
+       led-controller@36 {
+               compatible = "ti,lm3630a";
+               reg = <0x36>;
+               enable-gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>;
+               pinctrl-0 = <&backlight_hwen_h>;
+               pinctrl-names = "default";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               led@0 {
+                       reg = <0>;
+                       label = "backlight_cool";
+                       default-brightness = <0>;
+               };
+
+               led@1 {
+                       reg = <1>;
+                       label = "backlight_warm";
+                       default-brightness = <0>;
+               };
+       };
+};
+
+&i2s1_8ch {
+       pinctrl-0 = <&i2s1m0_lrcktx>, <&i2s1m0_sclktx>, <&i2s1m0_sdi0>, <&i2s1m0_sdo0>;
+       rockchip,trcm-sync-tx-only;
+       status = "okay";
+};
+
+&pdm {
+       pinctrl-0 = <&pdmm0_clk1>, <&pdmm0_sdi1>, <&pdmm0_sdi2>;
+       /* microphones are on channels 1 and 2 */
+       rockchip,path-map = <1>, <2>, <0>, <3>;
+       status = "okay";
+};
+
+&pinctrl {
+       audio-amplifier {
+               spk_amp_enable_h: spk-amp-enable-h {
+                       rockchip,pins = <3 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       backlight {
+               backlight_hwen_h: backlight-hwen-h {
+                       rockchip,pins = <0 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       bt {
+               bt_enable_h: bt-enable-h {
+                       rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
+               bt_host_wake_l: bt-host-wake-l {
+                       rockchip,pins = <0 RK_PC3 RK_FUNC_GPIO &pcfg_pull_up>;
+               };
+
+               bt_wake_h: bt-wake-h {
+                       rockchip,pins = <0 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       led {
+               led_pin: led-pin {
+                       rockchip,pins = <3 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       hall {
+               hall_int_l: hall-int-l {
+                       rockchip,pins = <0 RK_PC7 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       pen {
+               pen_fwe: pen-fwe {
+                       rockchip,pins = <3 RK_PB7 RK_FUNC_GPIO &pcfg_pull_down>;
+               };
+
+               pen_irq_l: pen-irq-l {
+                       rockchip,pins = <0 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
+               pen_rst_l: pen-rst-l {
+                       rockchip,pins = <0 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       pmic {
+               pmic_int_l: pmic-int-l {
+                       rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
+               pmic_sleep: pmic-sleep {
+                       rockchip,pins = <0 RK_PA2 1 &pcfg_pull_none>;
+               };
+       };
+
+       sdio-pwrseq {
+               wifi_enable_h: wifi-enable-h {
+                       rockchip,pins = <0 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       vcc-wl {
+               vcc_wl_pin: vcc-wl-pin {
+                       rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       wifi {
+               wifi_host_wake_l: wifi-host-wake-l {
+                       rockchip,pins = <0 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
+               };
+       };
+};
+
+&pmu_io_domains {
+       pmuio1-supply = <&vcc_3v3_pmu>;
+       pmuio2-supply = <&vcc_3v3_pmu>;
+       vccio1-supply = <&vccio_acodec>;
+       vccio2-supply = <&vcc_1v8>;
+       vccio3-supply = <&vcc_3v3>;
+       vccio4-supply = <&vcca_1v8_pmu>;
+       vccio5-supply = <&vcc_3v3>;
+       vccio6-supply = <&vcc_3v3>;
+       status = "okay";
+};
+
+&saradc {
+       vref-supply = <&vcc_1v8>;
+       status = "okay";
+};
+
+&sdhci {
+       bus-width = <8>;
+       mmc-hs200-1_8v;
+       non-removable;
+       pinctrl-0 = <&emmc_bus8>, <&emmc_clk>, <&emmc_cmd>, <&emmc_datastrobe>, <&emmc_rstnout>;
+       pinctrl-names = "default";
+       vmmc-supply = <&vcc_3v3>;
+       vqmmc-supply = <&vcc_1v8>;
+       status = "okay";
+};
+
+&sdmmc1 {
+       bus-width = <4>;
+       cap-sd-highspeed;
+       cap-sdio-irq;
+       keep-power-in-suspend;
+       mmc-pwrseq = <&sdio_pwrseq>;
+       non-removable;
+       pinctrl-0 = <&sdmmc1_bus4>, <&sdmmc1_clk>, <&sdmmc1_cmd>;
+       pinctrl-names = "default";
+       sd-uhs-sdr104;
+       vmmc-supply = <&vcc_wl>;
+       vqmmc-supply = <&vcca_1v8_pmu>;
+       status = "okay";
+};
+
+&tsadc {
+       /* tshut mode 0:CRU 1:GPIO */
+       rockchip,hw-tshut-mode = <1>;
+       /* tshut polarity 0:LOW 1:HIGH */
+       rockchip,hw-tshut-polarity = <0>;
+       status = "okay";
+};
+
+&uart1 {
+       pinctrl-0 = <&uart1m0_ctsn>, <&uart1m0_rtsn>, <&uart1m0_xfer>;
+       pinctrl-names = "default";
+       uart-has-rtscts;
+       status = "okay";
+
+       bluetooth {
+               compatible = "brcm,bcm43438-bt";
+               clocks = <&rk817 1>;
+               clock-names = "lpo";
+               device-wake-gpios = <&gpio0 RK_PC2 GPIO_ACTIVE_HIGH>;
+               host-wake-gpios = <&gpio0 RK_PC3 GPIO_ACTIVE_HIGH>;
+               reset-gpios = <&gpio0 RK_PC4 GPIO_ACTIVE_LOW>;
+               pinctrl-0 = <&bt_enable_h>, <&bt_host_wake_l>, <&bt_wake_h>;
+               pinctrl-names = "default";
+               vbat-supply = <&vcc_wl>;
+               vddio-supply = <&vcca_1v8_pmu>;
+       };
+};
+
+&uart2 {
+       status = "okay";
+};
index 166399b..6af09d2 100644 (file)
                };
        };
 
+       sdio_pwrseq: sdio-pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               clocks = <&rk817 1>;
+               clock-names = "ext_clock";
+               pinctrl-names = "default";
+               pinctrl-0 = <&wifi_enable_h>;
+               post-power-on-delay-ms = <100>;
+               power-off-delay-us = <5000000>;
+               reset-gpios = <&gpio2 RK_PC2 GPIO_ACTIVE_LOW>;
+       };
+
        spdif_dit: spdif-dit {
                compatible = "linux,spdif-dit";
                #sound-dai-cells = <0>;
                vin-supply = <&vcc12v_dcin>;
        };
 
+       /* all four ports are controlled by one gpio
+        * the host ports are sourced from vcc5v0_usb
+        * the otg port is sourced from vcc5v0_midu
+        */
+       vcc5v0_usb20_host: vcc5v0_usb20_host {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio4 RK_PB5 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&vcc5v0_usb20_host_en>;
+               regulator-name = "vcc5v0_usb20_host";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               vin-supply = <&vcc5v0_usb>;
+       };
+
        vcc3v3_sd: vcc3v3_sd {
                compatible = "regulator-fixed";
                enable-active-low;
                regulator-max-microvolt = <4400000>;
                vin-supply = <&vbus>;
        };
+
+       /* sourced from vcc_sys, sdio module operates internally at 3.3v */
+       vcc_wl: vcc_wl {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc_wl";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&vcc_sys>;
+       };
 };
 
 &cpu0 {
        status = "okay";
 };
 
+&gpu {
+       mali-supply = <&vdd_gpu>;
+       status = "okay";
+};
+
 &i2c0 {
        status = "okay";
 
        };
 };
 
+/* i2c3 is exposed on con40
+ * pin 3 - i2c3_sda_m0, pullup to vcc_3v3
+ * pin 5 - i2c3_scl_m0, pullup to vcc_3v3
+ */
+&i2c3 {
+       status = "okay";
+};
+
 &i2s1_8ch {
        pinctrl-names = "default";
        pinctrl-0 = <&i2s1m0_sclktx
                };
        };
 
+       usb2 {
+               vcc5v0_usb20_host_en: vcc5v0-usb20-host-en {
+                       rockchip,pins = <4 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       sdio-pwrseq {
+               wifi_enable_h: wifi-enable-h {
+                       rockchip,pins = <2 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
        vcc_sd {
                vcc_sd_h: vcc-sd-h {
                        rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
        };
 };
 
+&pmu_io_domains {
+       pmuio1-supply = <&vcc3v3_pmu>;
+       pmuio2-supply = <&vcc3v3_pmu>;
+       vccio1-supply = <&vccio_acodec>;
+       vccio2-supply = <&vcc_1v8>;
+       vccio3-supply = <&vccio_sd>;
+       vccio4-supply = <&vcc_1v8>;
+       vccio5-supply = <&vcc_3v3>;
+       vccio6-supply = <&vcc1v8_dvp>;
+       vccio7-supply = <&vcc_3v3>;
+       status = "okay";
+};
+
 &sdhci {
        bus-width = <8>;
        mmc-hs200-1_8v;
        status = "okay";
 };
 
+&sdmmc1 {
+       bus-width = <4>;
+       cap-sd-highspeed;
+       cap-sdio-irq;
+       keep-power-in-suspend;
+       mmc-pwrseq = <&sdio_pwrseq>;
+       non-removable;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sdmmc1_bus4 &sdmmc1_cmd &sdmmc1_clk>;
+       sd-uhs-sdr104;
+       vmmc-supply = <&vcc_wl>;
+       vqmmc-supply = <&vcc_1v8>;
+       status = "okay";
+};
+
+/* spdif is exposed on con40 pin 18 */
 &spdif {
        status = "okay";
 };
 
+/* spi1 is exposed on con40
+ * pin 11 - spi1_mosi_m1
+ * pin 13 - spi1_miso_m1
+ * pin 15 - spi1_clk_m1
+ * pin 17 - spi1_cs0_m1
+ */
 &spi1 {
        pinctrl-names = "default";
        pinctrl-0 = <&spi1m1_cs0 &spi1m1_pins>;
        status = "okay";
 };
 
+/* uart0 is exposed on con40
+ * pin 12 - uart0_tx
+ * pin 14 - uart0_rx
+ */
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_xfer>;
        };
 };
 
+/* uart2 is exposed on con40
+ * pin 8 - uart2_tx_m0_debug
+ * pin 10 - uart2_rx_m0_debug
+ */
 &uart2 {
        status = "okay";
 };
+
+&usb_host0_ehci {
+       status = "okay";
+};
+
+&usb_host0_ohci {
+       status = "okay";
+};
+
+&usb_host1_ehci {
+       status = "okay";
+};
+
+&usb_host1_ohci {
+       status = "okay";
+};
+
+&usb2phy1 {
+       status = "okay";
+};
+
+&usb2phy1_host {
+       phy-supply = <&vcc5v0_usb20_host>;
+       status = "okay";
+};
+
+&usb2phy1_otg {
+       phy-supply = <&vcc5v0_usb20_host>;
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/rockchip/rk3568-bpi-r2-pro.dts b/arch/arm64/boot/dts/rockchip/rk3568-bpi-r2-pro.dts
new file mode 100644 (file)
index 0000000..a01886b
--- /dev/null
@@ -0,0 +1,457 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Author: Frank Wunderlich <frank-w@public-files.de>
+ *
+ */
+
+/dts-v1/;
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/pinctrl/rockchip.h>
+#include "rk3568.dtsi"
+
+/ {
+       model = "Bananapi-R2 Pro (RK3568) DDR4 Board";
+       compatible = "rockchip,rk3568-bpi-r2pro", "rockchip,rk3568";
+
+       aliases {
+               ethernet0 = &gmac0;
+               mmc0 = &sdmmc0;
+               mmc1 = &sdhci;
+       };
+
+       chosen: chosen {
+               stdout-path = "serial2:1500000n8";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&blue_led_pin &green_led_pin>;
+
+               blue_led: led-0 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       default-state = "off";
+                       function = LED_FUNCTION_STATUS;
+                       gpios = <&gpio0 RK_PD6 GPIO_ACTIVE_HIGH>;
+               };
+
+               green_led: led-1 {
+                       color = <LED_COLOR_ID_GREEN>;
+                       default-state = "on";
+                       function = LED_FUNCTION_POWER;
+                       gpios = <&gpio0 RK_PD5 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       dc_12v: dc-12v {
+               compatible = "regulator-fixed";
+               regulator-name = "dc_12v";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <12000000>;
+               regulator-max-microvolt = <12000000>;
+       };
+
+       vcc3v3_sys: vcc3v3-sys {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc3v3_sys";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&dc_12v>;
+       };
+
+       vcc5v0_sys: vcc5v0-sys {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc5v0_sys";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               vin-supply = <&dc_12v>;
+       };
+};
+
+&gmac0 {
+       assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>;
+       assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>, <&cru CLK_MAC0_2TOP>;
+       clock_in_out = "input";
+       phy-handle = <&rgmii_phy0>;
+       phy-mode = "rgmii";
+       pinctrl-names = "default";
+       pinctrl-0 = <&gmac0_miim
+                    &gmac0_tx_bus2
+                    &gmac0_rx_bus2
+                    &gmac0_rgmii_clk
+                    &gmac0_rgmii_bus>;
+       snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
+       snps,reset-active-low;
+       /* Reset time is 20ms, 100ms for rtl8211f */
+       snps,reset-delays-us = <0 20000 100000>;
+       tx_delay = <0x3c>;
+       rx_delay = <0x2f>;
+       status = "okay";
+};
+
+&i2c0 {
+       status = "okay";
+
+       rk809: pmic@20 {
+               compatible = "rockchip,rk809";
+               reg = <0x20>;
+               interrupt-parent = <&gpio0>;
+               interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>;
+               #clock-cells = <1>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pmic_int>;
+               rockchip,system-power-controller;
+               vcc1-supply = <&vcc3v3_sys>;
+               vcc2-supply = <&vcc3v3_sys>;
+               vcc3-supply = <&vcc3v3_sys>;
+               vcc4-supply = <&vcc3v3_sys>;
+               vcc5-supply = <&vcc3v3_sys>;
+               vcc6-supply = <&vcc3v3_sys>;
+               vcc7-supply = <&vcc3v3_sys>;
+               vcc8-supply = <&vcc3v3_sys>;
+               vcc9-supply = <&vcc3v3_sys>;
+               wakeup-source;
+
+               regulators {
+                       vdd_logic: DCDC_REG1 {
+                               regulator-name = "vdd_logic";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-init-microvolt = <900000>;
+                               regulator-initial-mode = <0x2>;
+                               regulator-min-microvolt = <500000>;
+                               regulator-max-microvolt = <1350000>;
+                               regulator-ramp-delay = <6001>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vdd_gpu: DCDC_REG2 {
+                               regulator-name = "vdd_gpu";
+                               regulator-init-microvolt = <900000>;
+                               regulator-initial-mode = <0x2>;
+                               regulator-min-microvolt = <500000>;
+                               regulator-max-microvolt = <1350000>;
+                               regulator-ramp-delay = <6001>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vcc_ddr: DCDC_REG3 {
+                               regulator-name = "vcc_ddr";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-initial-mode = <0x2>;
+
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       vdd_npu: DCDC_REG4 {
+                               regulator-name = "vdd_npu";
+                               regulator-init-microvolt = <900000>;
+                               regulator-initial-mode = <0x2>;
+                               regulator-min-microvolt = <500000>;
+                               regulator-max-microvolt = <1350000>;
+                               regulator-ramp-delay = <6001>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vcc_1v8: DCDC_REG5 {
+                               regulator-name = "vcc_1v8";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vdda0v9_image: LDO_REG1 {
+                               regulator-name = "vdda0v9_image";
+                               regulator-min-microvolt = <900000>;
+                               regulator-max-microvolt = <900000>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vdda_0v9: LDO_REG2 {
+                               regulator-name = "vdda_0v9";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <900000>;
+                               regulator-max-microvolt = <900000>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vdda0v9_pmu: LDO_REG3 {
+                               regulator-name = "vdda0v9_pmu";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <900000>;
+                               regulator-max-microvolt = <900000>;
+
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <900000>;
+                               };
+                       };
+
+                       vccio_acodec: LDO_REG4 {
+                               regulator-name = "vccio_acodec";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vccio_sd: LDO_REG5 {
+                               regulator-name = "vccio_sd";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <3300000>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vcc3v3_pmu: LDO_REG6 {
+                               regulator-name = "vcc3v3_pmu";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <3300000>;
+                               };
+                       };
+
+                       vcca_1v8: LDO_REG7 {
+                               regulator-name = "vcca_1v8";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vcca1v8_pmu: LDO_REG8 {
+                               regulator-name = "vcca1v8_pmu";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <1800000>;
+                               };
+                       };
+
+                       vcca1v8_image: LDO_REG9 {
+                               regulator-name = "vcca1v8_image";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vcc_3v3: SWITCH_REG1 {
+                               regulator-name = "vcc_3v3";
+                               regulator-always-on;
+                               regulator-boot-on;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vcc3v3_sd: SWITCH_REG2 {
+                               regulator-name = "vcc3v3_sd";
+                               regulator-always-on;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+               };
+       };
+};
+
+&i2c5 {
+       /* pin 3 (SDA) + 4 (SCL) of header con2 */
+       status = "disabled";
+};
+
+&mdio0 {
+       rgmii_phy0: ethernet-phy@0 {
+               compatible = "ethernet-phy-ieee802.3-c22";
+               reg = <0x0>;
+       };
+};
+
+&pinctrl {
+       leds {
+               blue_led_pin: blue-led-pin {
+                       rockchip,pins = <0 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+               green_led_pin: green-led-pin {
+                       rockchip,pins = <0 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       pmic {
+               pmic_int: pmic_int {
+                       rockchip,pins =
+                               <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
+               };
+       };
+};
+
+&pmu_io_domains {
+       pmuio1-supply = <&vcc3v3_pmu>;
+       pmuio2-supply = <&vcc3v3_pmu>;
+       vccio1-supply = <&vccio_acodec>;
+       vccio3-supply = <&vccio_sd>;
+       vccio4-supply = <&vcc_1v8>;
+       vccio5-supply = <&vcc_3v3>;
+       vccio6-supply = <&vcc_3v3>;
+       vccio7-supply = <&vcc_3v3>;
+       status = "okay";
+};
+
+&pwm8 {
+       /* fan 5v - gnd - pwm */
+       status = "okay";
+};
+
+&pwm10 {
+       /* pin 7 of header con2 */
+       status = "disabled";
+};
+
+&pwm11 {
+       /* pin 15 of header con2 */
+       status = "disabled";
+};
+
+&pwm12 {
+       /* pin 21 of header con2 */
+       /* shared with uart9 + spi3 */
+       pinctrl-0 = <&pwm12m1_pins>;
+       status = "disabled";
+};
+
+&pwm13 {
+       /* pin 24 of header con2 */
+       /* shared with uart9 */
+       pinctrl-0 = <&pwm13m1_pins>;
+       status = "disabled";
+};
+
+&pwm14 {
+       /* pin 23 of header con2 */
+       /* shared with spi3 */
+       pinctrl-0 = <&pwm14m1_pins>;
+       status = "disabled";
+};
+
+&pwm15 {
+       /* pin 19 of header con2 */
+       /* shared with spi3 */
+       pinctrl-0 = <&pwm15m1_pins>;
+       status = "disabled";
+};
+
+&saradc {
+       vref-supply = <&vcca_1v8>;
+       status = "okay";
+};
+
+&sdhci {
+       bus-width = <8>;
+       max-frequency = <200000000>;
+       non-removable;
+       pinctrl-names = "default";
+       pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>;
+       status = "okay";
+};
+
+&sdmmc0 {
+       bus-width = <4>;
+       cap-sd-highspeed;
+       cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
+       disable-wp;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>;
+       sd-uhs-sdr104;
+       vmmc-supply = <&vcc3v3_sd>;
+       vqmmc-supply = <&vccio_sd>;
+       status = "okay";
+};
+
+&spi3 {
+       /* pin 19 (MO) + 21 (MI) + 23 (CK) of header con2 */
+       /* shared with pwm12/14/15 and uart9 */
+       pinctrl-0 = <&spi3m1_pins>;
+       status = "disabled";
+};
+
+&tsadc {
+       status = "okay";
+};
+
+&uart0 {
+       /* pin 8 (TX) + 10 (RX) (RTS:16, CTS:18) of header con2 */
+       status = "disabled";
+};
+
+&uart2 {
+       /* debug-uart */
+       status = "okay";
+};
+
+&uart7 {
+       /* pin 11 (TX) + 13 (RX) of header con2 */
+       pinctrl-0 = <&uart7m1_xfer>;
+       status = "disabled";
+};
+
+&uart9 {
+       /* pin 21 (TX) + 24 (RX) of header con2 */
+       /* shared with pwm13 and pwm12/spi3 */
+       pinctrl-0 = <&uart9m1_xfer>;
+       status = "disabled";
+};
index 184e2aa..a794a0e 100644 (file)
@@ -6,6 +6,7 @@
 
 /dts-v1/;
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/pinctrl/rockchip.h>
 #include "rk3568.dtsi"
 
                regulator-max-microvolt = <12000000>;
        };
 
+       leds {
+               compatible = "gpio-leds";
+
+               led_work: led-0 {
+                       gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>;
+                       function = LED_FUNCTION_HEARTBEAT;
+                       color = <LED_COLOR_ID_BLUE>;
+                       linux,default-trigger = "heartbeat";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&led_work_en>;
+               };
+       };
+
+       rk809-sound {
+               compatible = "simple-audio-card";
+               simple-audio-card,format = "i2s";
+               simple-audio-card,name = "Analog RK809";
+               simple-audio-card,mclk-fs = <256>;
+
+               simple-audio-card,cpu {
+                       sound-dai = <&i2s1_8ch>;
+               };
+               simple-audio-card,codec {
+                       sound-dai = <&rk809>;
+               };
+       };
+
        vcc3v3_sys: vcc3v3-sys {
                compatible = "regulator-fixed";
                regulator-name = "vcc3v3_sys";
                vin-supply = <&dc_12v>;
        };
 
+       vcc5v0_usb: vcc5v0-usb {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc5v0_usb";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               vin-supply = <&dc_12v>;
+       };
+
+       vcc5v0_usb_host: vcc5v0-usb-host {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&vcc5v0_usb_host_en>;
+               regulator-name = "vcc5v0_usb_host";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               vin-supply = <&vcc5v0_usb>;
+       };
+
        vcc3v3_lcd0_n: vcc3v3-lcd0-n {
                compatible = "regulator-fixed";
                regulator-name = "vcc3v3_lcd0_n";
-               regulator-boot-on;
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               enable-active-high;
+               gpio = <&gpio0 RK_PC7 GPIO_ACTIVE_HIGH>;
+               vin-supply = <&vcc3v3_sys>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&vcc3v3_lcd0_n_en>;
 
                regulator-state-mem {
                        regulator-off-in-suspend;
        vcc3v3_lcd1_n: vcc3v3-lcd1-n {
                compatible = "regulator-fixed";
                regulator-name = "vcc3v3_lcd1_n";
-               regulator-boot-on;
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               enable-active-high;
+               gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
+               vin-supply = <&vcc3v3_sys>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&vcc3v3_lcd1_n_en>;
 
                regulator-state-mem {
                        regulator-off-in-suspend;
        };
 };
 
+&cpu0 {
+       cpu-supply = <&vdd_cpu>;
+};
+
+&cpu1 {
+       cpu-supply = <&vdd_cpu>;
+};
+
+&cpu2 {
+       cpu-supply = <&vdd_cpu>;
+};
+
+&cpu3 {
+       cpu-supply = <&vdd_cpu>;
+};
+
 &gmac0 {
        assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>;
        assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>;
        status = "okay";
 };
 
+&gpu {
+       mali-supply = <&vdd_gpu>;
+       status = "okay";
+};
+
 &i2c0 {
        status = "okay";
 
+       vdd_cpu: regulator@1c {
+               compatible = "tcs,tcs4525";
+               reg = <0x1c>;
+               fcs,suspend-voltage-selector = <1>;
+               regulator-name = "vdd_cpu";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <800000>;
+               regulator-max-microvolt = <1150000>;
+               regulator-ramp-delay = <2300>;
+               vin-supply = <&vcc5v0_sys>;
+
+               regulator-state-mem {
+                       regulator-off-in-suspend;
+               };
+       };
+
        rk809: pmic@20 {
                compatible = "rockchip,rk809";
                reg = <0x20>;
                interrupt-parent = <&gpio0>;
                interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>;
+               assigned-clocks = <&cru I2S1_MCLKOUT_TX>;
+               assigned-clock-parents = <&cru CLK_I2S1_8CH_TX>;
                #clock-cells = <1>;
+               clock-names = "mclk";
+               clocks = <&cru I2S1_MCLKOUT_TX>;
                pinctrl-names = "default";
-               pinctrl-0 = <&pmic_int>;
+               pinctrl-0 = <&pmic_int>, <&i2s1m0_mclk>;
                rockchip,system-power-controller;
+               #sound-dai-cells = <0>;
                vcc1-supply = <&vcc3v3_sys>;
                vcc2-supply = <&vcc3v3_sys>;
                vcc3-supply = <&vcc3v3_sys>;
 
                        vdd_gpu: DCDC_REG2 {
                                regulator-name = "vdd_gpu";
+                               regulator-always-on;
                                regulator-init-microvolt = <900000>;
                                regulator-initial-mode = <0x2>;
                                regulator-min-microvolt = <500000>;
 
                        vccio_acodec: LDO_REG4 {
                                regulator-name = "vccio_acodec";
+                               regulator-always-on;
                                regulator-min-microvolt = <3300000>;
                                regulator-max-microvolt = <3300000>;
 
                                };
                        };
                };
+
+               codec {
+                       mic-in-differential;
+               };
        };
 };
 
+&i2c1 {
+       status = "okay";
+
+       touchscreen0: goodix@14 {
+               compatible = "goodix,gt1151";
+               reg = <0x14>;
+               interrupt-parent = <&gpio0>;
+               interrupts = <RK_PB5 IRQ_TYPE_EDGE_FALLING>;
+               AVDD28-supply = <&vcc3v3_lcd0_n>;
+               irq-gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&touch_int &touch_rst>;
+               reset-gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>;
+               VDDIO-supply = <&vcc3v3_lcd0_n>;
+       };
+};
+
+&i2s1_8ch {
+       rockchip,trcm-sync-tx-only;
+       status = "okay";
+};
+
 &mdio0 {
        rgmii_phy0: ethernet-phy@0 {
                compatible = "ethernet-phy-ieee802.3-c22";
 };
 
 &pinctrl {
+       display {
+               vcc3v3_lcd0_n_en: vcc3v3_lcd0_n_en {
+                       rockchip,pins = <0 RK_PC7 0 &pcfg_pull_none>;
+               };
+               vcc3v3_lcd1_n_en: vcc3v3_lcd1_n_en {
+                       rockchip,pins = <0 RK_PC5 0 &pcfg_pull_none>;
+               };
+       };
+
+       leds {
+               led_work_en: led_work_en {
+                       rockchip,pins = <0 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
        pmic {
                pmic_int: pmic_int {
                        rockchip,pins =
                                <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
                };
        };
+
+       touchscreen {
+               touch_int: touch_int {
+                       rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>;
+               };
+               touch_rst: touch_rst {
+                       rockchip,pins = <0 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       usb {
+               vcc5v0_usb_host_en: vcc5v0_usb_host_en {
+                       rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
 };
 
 &pmu_io_domains {
        status = "okay";
 };
 
+&tsadc {
+       rockchip,hw-tshut-mode = <1>;
+       rockchip,hw-tshut-polarity = <0>;
+       status = "okay";
+};
+
 &uart2 {
        status = "okay";
 };
+
+&usb_host0_ehci {
+       status = "okay";
+};
+
+&usb_host0_ohci {
+       status = "okay";
+};
+
+&usb_host1_ehci {
+       status = "okay";
+};
+
+&usb_host1_ohci {
+       status = "okay";
+};
+
+&usb2phy1 {
+       status = "okay";
+};
+
+&usb2phy1_host {
+       phy-supply = <&vcc5v0_usb_host>;
+       status = "okay";
+};
+
+&usb2phy1_otg {
+       phy-supply = <&vcc5v0_usb_host>;
+       status = "okay";
+};
index a68033a..e20ee39 100644 (file)
                };
        };
 
+       gpu_opp_table: opp-table-1 {
+               compatible = "operating-points-v2";
+
+               opp-200000000 {
+                       opp-hz = /bits/ 64 <200000000>;
+                       opp-microvolt = <825000>;
+               };
+
+               opp-300000000 {
+                       opp-hz = /bits/ 64 <300000000>;
+                       opp-microvolt = <825000>;
+               };
+
+               opp-400000000 {
+                       opp-hz = /bits/ 64 <400000000>;
+                       opp-microvolt = <825000>;
+               };
+
+               opp-600000000 {
+                       opp-hz = /bits/ 64 <600000000>;
+                       opp-microvolt = <825000>;
+               };
+
+               opp-700000000 {
+                       opp-hz = /bits/ 64 <700000000>;
+                       opp-microvolt = <900000>;
+               };
+
+               opp-800000000 {
+                       opp-hz = /bits/ 64 <800000000>;
+                       opp-microvolt = <1000000>;
+               };
+       };
+
        pmu {
                compatible = "arm,cortex-a55-pmu";
                interrupts = <GIC_SPI 228 IRQ_TYPE_LEVEL_HIGH>,
                msi-controller;
        };
 
+       usb_host0_ehci: usb@fd800000 {
+               compatible = "generic-ehci";
+               reg = <0x0 0xfd800000 0x0 0x40000>;
+               interrupts = <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&cru HCLK_USB2HOST0>, <&cru HCLK_USB2HOST0_ARB>,
+                        <&cru PCLK_USB>;
+               phys = <&usb2phy1_otg>;
+               phy-names = "usb";
+               status = "disabled";
+       };
+
+       usb_host0_ohci: usb@fd840000 {
+               compatible = "generic-ohci";
+               reg = <0x0 0xfd840000 0x0 0x40000>;
+               interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&cru HCLK_USB2HOST0>, <&cru HCLK_USB2HOST0_ARB>,
+                        <&cru PCLK_USB>;
+               phys = <&usb2phy1_otg>;
+               phy-names = "usb";
+               status = "disabled";
+       };
+
+       usb_host1_ehci: usb@fd880000 {
+               compatible = "generic-ehci";
+               reg = <0x0 0xfd880000 0x0 0x40000>;
+               interrupts = <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&cru HCLK_USB2HOST1>, <&cru HCLK_USB2HOST1_ARB>,
+                        <&cru PCLK_USB>;
+               phys = <&usb2phy1_host>;
+               phy-names = "usb";
+               status = "disabled";
+       };
+
+       usb_host1_ohci: usb@fd8c0000 {
+               compatible = "generic-ohci";
+               reg = <0x0 0xfd8c0000 0x0 0x40000>;
+               interrupts = <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&cru HCLK_USB2HOST1>, <&cru HCLK_USB2HOST1_ARB>,
+                        <&cru PCLK_USB>;
+               phys = <&usb2phy1_host>;
+               phy-names = "usb";
+               status = "disabled";
+       };
+
        pmugrf: syscon@fdc20000 {
                compatible = "rockchip,rk3568-pmugrf", "syscon", "simple-mfd";
                reg = <0x0 0xfdc20000 0x0 0x10000>;
                reg = <0x0 0xfdc60000 0x0 0x10000>;
        };
 
+       usb2phy0_grf: syscon@fdca0000 {
+               compatible = "rockchip,rk3568-usb2phy-grf", "syscon";
+               reg = <0x0 0xfdca0000 0x0 0x8000>;
+       };
+
+       usb2phy1_grf: syscon@fdca8000 {
+               compatible = "rockchip,rk3568-usb2phy-grf", "syscon";
+               reg = <0x0 0xfdca8000 0x0 0x8000>;
+       };
+
        pmucru: clock-controller@fdd00000 {
                compatible = "rockchip,rk3568-pmucru";
                reg = <0x0 0xfdd00000 0x0 0x1000>;
                };
        };
 
+       gpu: gpu@fde60000 {
+               compatible = "rockchip,rk3568-mali", "arm,mali-bifrost";
+               reg = <0x0 0xfde60000 0x0 0x4000>;
+               interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "job", "mmu", "gpu";
+               clocks = <&scmi_clk 1>, <&cru CLK_GPU>;
+               clock-names = "gpu", "bus";
+               #cooling-cells = <2>;
+               operating-points-v2 = <&gpu_opp_table>;
+               power-domains = <&power RK3568_PD_GPU>;
+               status = "disabled";
+       };
+
        sdmmc2: mmc@fe000000 {
                compatible = "rockchip,rk3568-dw-mshc", "rockchip,rk3288-dw-mshc";
                reg = <0x0 0xfe000000 0x0 0x4000>;
                status = "disabled";
        };
 
+       i2s3_2ch: i2s@fe430000 {
+               compatible = "rockchip,rk3568-i2s-tdm";
+               reg = <0x0 0xfe430000 0x0 0x1000>;
+               interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&cru MCLK_I2S3_2CH_TX>, <&cru MCLK_I2S3_2CH_RX>,
+                        <&cru HCLK_I2S3_2CH>;
+               clock-names = "mclk_tx", "mclk_rx", "hclk";
+               dmas = <&dmac1 6>, <&dmac1 7>;
+               dma-names = "tx", "rx";
+               resets = <&cru SRST_M_I2S3_2CH_TX>, <&cru SRST_M_I2S3_2CH_RX>;
+               reset-names = "tx-m", "rx-m";
+               rockchip,grf = <&grf>;
+               #sound-dai-cells = <0>;
+               status = "disabled";
+       };
+
+       pdm: pdm@fe440000 {
+               compatible = "rockchip,rk3568-pdm";
+               reg = <0x0 0xfe440000 0x0 0x1000>;
+               interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&cru MCLK_PDM>, <&cru HCLK_PDM>;
+               clock-names = "pdm_clk", "pdm_hclk";
+               dmas = <&dmac1 9>;
+               dma-names = "rx";
+               pinctrl-0 = <&pdmm0_clk
+                            &pdmm0_clk1
+                            &pdmm0_sdi0
+                            &pdmm0_sdi1
+                            &pdmm0_sdi2
+                            &pdmm0_sdi3>;
+               pinctrl-names = "default";
+               resets = <&cru SRST_M_PDM>;
+               reset-names = "pdm-m";
+               #sound-dai-cells = <0>;
+               status = "disabled";
+       };
+
        dmac0: dmac@fe530000 {
                compatible = "arm,pl330", "arm,primecell";
                reg = <0x0 0xfe530000 0x0 0x4000>;
                        polling-delay = <1000>; /* milliseconds */
 
                        thermal-sensors = <&tsadc 1>;
+
+                       trips {
+                               gpu_threshold: gpu-threshold {
+                                       temperature = <70000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+                               gpu_target: gpu-target {
+                                       temperature = <75000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+                               gpu_crit: gpu-crit {
+                                       temperature = <95000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
+
+                       cooling-maps {
+                               map0 {
+                                       trip = <&gpu_target>;
+                                       cooling-device =
+                                               <&gpu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
                };
        };
 
                status = "disabled";
        };
 
+       usb2phy0: usb2phy@fe8a0000 {
+               compatible = "rockchip,rk3568-usb2phy";
+               reg = <0x0 0xfe8a0000 0x0 0x10000>;
+               clocks = <&pmucru CLK_USBPHY0_REF>;
+               clock-names = "phyclk";
+               clock-output-names = "clk_usbphy0_480m";
+               interrupts = <GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>;
+               rockchip,usbgrf = <&usb2phy0_grf>;
+               #clock-cells = <0>;
+               status = "disabled";
+
+               usb2phy0_host: host-port {
+                       #phy-cells = <0>;
+                       status = "disabled";
+               };
+
+               usb2phy0_otg: otg-port {
+                       #phy-cells = <0>;
+                       status = "disabled";
+               };
+       };
+
+       usb2phy1: usb2phy@fe8b0000 {
+               compatible = "rockchip,rk3568-usb2phy";
+               reg = <0x0 0xfe8b0000 0x0 0x10000>;
+               clocks = <&pmucru CLK_USBPHY1_REF>;
+               clock-names = "phyclk";
+               clock-output-names = "clk_usbphy1_480m";
+               interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>;
+               rockchip,usbgrf = <&usb2phy1_grf>;
+               #clock-cells = <0>;
+               status = "disabled";
+
+               usb2phy1_host: host-port {
+                       #phy-cells = <0>;
+                       status = "disabled";
+               };
+
+               usb2phy1_otg: otg-port {
+                       #phy-cells = <0>;
+                       status = "disabled";
+               };
+       };
+
        pinctrl: pinctrl {
                compatible = "rockchip,rk3568-pinctrl";
                rockchip,grf = <&grf>;
diff --git a/arch/arm64/boot/dts/tesla/Makefile b/arch/arm64/boot/dts/tesla/Makefile
new file mode 100644 (file)
index 0000000..a1ee50e
--- /dev/null
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0
+dtb-$(CONFIG_ARCH_TESLA_FSD) += \
+       fsd-evb.dtb
diff --git a/arch/arm64/boot/dts/tesla/fsd-evb.dts b/arch/arm64/boot/dts/tesla/fsd-evb.dts
new file mode 100644 (file)
index 0000000..5af560c
--- /dev/null
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+/*
+ * Tesla FSD board device tree source
+ *
+ * Copyright (c) 2017-2021 Samsung Electronics Co., Ltd.
+ *             https://www.samsung.com
+ * Copyright (c) 2017-2021 Tesla, Inc.
+ *             https://www.tesla.com
+ */
+
+/dts-v1/;
+#include "fsd.dtsi"
+
+/ {
+       model = "Tesla Full Self-Driving (FSD) Evaluation board";
+       compatible = "tesla,fsd-evb", "tesla,fsd";
+
+       aliases {
+               serial0 = &serial_0;
+               serial1 = &serial_1;
+       };
+
+       chosen {
+               stdout-path = &serial_0;
+       };
+
+       memory@80000000 {
+               device_type = "memory";
+               reg = <0x0 0x80000000 0x2 0x00000000>;
+       };
+};
+
+&fin_pll {
+       clock-frequency = <24000000>;
+};
+
+&serial_0 {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/tesla/fsd-pinctrl.dtsi b/arch/arm64/boot/dts/tesla/fsd-pinctrl.dtsi
new file mode 100644 (file)
index 0000000..d4d0cb0
--- /dev/null
@@ -0,0 +1,335 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Tesla Full Self-Driving SoC device tree source
+ *
+ * Copyright (c) 2017-2021 Samsung Electronics Co., Ltd.
+ *             https://www.samsung.com
+ * Copyright (c) 2017-2021 Tesla, Inc.
+ *             https://www.tesla.com
+ */
+
+#include <dt-bindings/pinctrl/samsung.h>
+
+&pinctrl_fsys0 {
+       gpf0: gpf0-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpf1: gpf1-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpf6: gpf6-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpf4: gpf4-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpf5: gpf5-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+};
+
+&pinctrl_peric {
+       gpc8: gpc8-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpf2: gpf2-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpf3: gpf3-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpd0: gpd0-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpb0: gpb0-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpb1: gpb1-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpb4: gpb4-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpb5: gpb5-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpb6: gpb6-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpb7: gpb7-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpd1: gpd1-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpd2: gpd2-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpd3: gpd3-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpg0: gpg0-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpg1: gpg1-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpg2: gpg2-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpg3: gpg3-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpg4: gpg4-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpg5: gpg5-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpg6: gpg6-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpg7: gpg7-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       pwm0_out: pwm0-out-pins {
+               samsung,pins = "gpb6-1";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV2>;
+       };
+
+       pwm1_out: pwm1-out-pins {
+               samsung,pins = "gpb6-5";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV2>;
+       };
+
+       hs_i2c0_bus: hs-i2c0-bus-pins {
+               samsung,pins = "gpb0-0", "gpb0-1";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+       };
+
+       hs_i2c1_bus: hs-i2c1-bus-pins {
+               samsung,pins = "gpb0-2", "gpb0-3";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+       };
+
+       hs_i2c2_bus: hs-i2c2-bus-pins {
+               samsung,pins = "gpb0-4", "gpb0-5";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+       };
+
+       hs_i2c3_bus: hs-i2c3-bus-pins {
+               samsung,pins = "gpb0-6", "gpb0-7";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+       };
+
+       hs_i2c4_bus: hs-i2c4-bus-pins {
+               samsung,pins = "gpb1-0", "gpb1-1";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+       };
+
+       hs_i2c5_bus: hs-i2c5-bus-pins {
+               samsung,pins = "gpb1-2", "gpb1-3";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+       };
+
+       hs_i2c6_bus: hs-i2c6-bus-pins {
+               samsung,pins = "gpb1-4", "gpb1-5";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+       };
+
+       hs_i2c7_bus: hs-i2c7-bus-pins {
+               samsung,pins = "gpb1-6", "gpb1-7";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+       };
+
+       uart0_data: uart0-data-pins {
+               samsung,pins = "gpb7-0", "gpb7-1";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+       };
+
+       uart1_data: uart1-data-pins {
+               samsung,pins = "gpb7-4", "gpb7-5";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+       };
+
+       spi0_bus: spi0-bus-pins {
+               samsung,pins = "gpb4-0", "gpb4-2", "gpb4-3";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+       };
+
+       spi1_bus: spi1-bus-pins {
+               samsung,pins = "gpb4-4", "gpb4-6", "gpb4-7";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+       };
+
+       spi2_bus: spi2-bus-pins {
+               samsung,pins = "gpb5-0", "gpb5-2", "gpb5-3";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+       };
+};
+
+&pinctrl_pmu {
+       gpq0: gpq0-gpio-bank {
+               gpio-controller;
+               #gpio-cells = <2>;
+       };
+};
diff --git a/arch/arm64/boot/dts/tesla/fsd.dtsi b/arch/arm64/boot/dts/tesla/fsd.dtsi
new file mode 100644 (file)
index 0000000..da4acd6
--- /dev/null
@@ -0,0 +1,731 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Tesla Full Self-Driving SoC device tree source
+ *
+ * Copyright (c) 2017-2022 Samsung Electronics Co., Ltd.
+ *             https://www.samsung.com
+ * Copyright (c) 2017-2022 Tesla, Inc.
+ *             https://www.tesla.com
+ */
+
+#include <dt-bindings/clock/fsd-clk.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+       compatible = "tesla,fsd";
+       interrupt-parent = <&gic>;
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       aliases {
+               i2c0 = &hsi2c_0;
+               i2c1 = &hsi2c_1;
+               i2c2 = &hsi2c_2;
+               i2c3 = &hsi2c_3;
+               i2c4 = &hsi2c_4;
+               i2c5 = &hsi2c_5;
+               i2c6 = &hsi2c_6;
+               i2c7 = &hsi2c_7;
+               pinctrl0 = &pinctrl_fsys0;
+               pinctrl1 = &pinctrl_peric;
+               pinctrl2 = &pinctrl_pmu;
+               spi0 = &spi_0;
+               spi1 = &spi_1;
+               spi2 = &spi_2;
+       };
+
+       cpus {
+               #address-cells = <2>;
+               #size-cells = <0>;
+
+               cpu-map {
+                       cluster0 {
+                               core0 {
+                                       cpu = <&cpucl0_0>;
+                               };
+                               core1 {
+                                       cpu = <&cpucl0_1>;
+                               };
+                               core2 {
+                                       cpu = <&cpucl0_2>;
+                               };
+                               core3 {
+                                       cpu = <&cpucl0_3>;
+                               };
+                       };
+
+                       cluster1 {
+                               core0 {
+                                       cpu = <&cpucl1_0>;
+                               };
+                               core1 {
+                                       cpu = <&cpucl1_1>;
+                               };
+                               core2 {
+                                       cpu = <&cpucl1_2>;
+                               };
+                               core3 {
+                                       cpu = <&cpucl1_3>;
+                               };
+                       };
+
+                       cluster2 {
+                               core0 {
+                                       cpu = <&cpucl2_0>;
+                               };
+                               core1 {
+                                       cpu = <&cpucl2_1>;
+                               };
+                               core2 {
+                                       cpu = <&cpucl2_2>;
+                               };
+                               core3 {
+                                       cpu = <&cpucl2_3>;
+                               };
+                       };
+               };
+
+               /* Cluster 0 */
+               cpucl0_0: cpu@0 {
+                               device_type = "cpu";
+                               compatible = "arm,cortex-a72";
+                               reg = <0x0 0x000>;
+                               enable-method = "psci";
+                               clock-frequency = <2400000000>;
+                               cpu-idle-states = <&CPU_SLEEP>;
+               };
+
+               cpucl0_1: cpu@1 {
+                               device_type = "cpu";
+                               compatible = "arm,cortex-a72";
+                               reg = <0x0 0x001>;
+                               enable-method = "psci";
+                               clock-frequency = <2400000000>;
+                               cpu-idle-states = <&CPU_SLEEP>;
+               };
+
+               cpucl0_2: cpu@2 {
+                               device_type = "cpu";
+                               compatible = "arm,cortex-a72";
+                               reg = <0x0 0x002>;
+                               enable-method = "psci";
+                               clock-frequency = <2400000000>;
+                               cpu-idle-states = <&CPU_SLEEP>;
+               };
+
+               cpucl0_3: cpu@3 {
+                               device_type = "cpu";
+                               compatible = "arm,cortex-a72";
+                               reg = <0x0 0x003>;
+                               enable-method = "psci";
+                               cpu-idle-states = <&CPU_SLEEP>;
+               };
+
+               /* Cluster 1 */
+               cpucl1_0: cpu@100 {
+                               device_type = "cpu";
+                               compatible = "arm,cortex-a72";
+                               reg = <0x0 0x100>;
+                               enable-method = "psci";
+                               clock-frequency = <2400000000>;
+                               cpu-idle-states = <&CPU_SLEEP>;
+               };
+
+               cpucl1_1: cpu@101 {
+                               device_type = "cpu";
+                               compatible = "arm,cortex-a72";
+                               reg = <0x0 0x101>;
+                               enable-method = "psci";
+                               clock-frequency = <2400000000>;
+                               cpu-idle-states = <&CPU_SLEEP>;
+               };
+
+               cpucl1_2: cpu@102 {
+                               device_type = "cpu";
+                               compatible = "arm,cortex-a72";
+                               reg = <0x0 0x102>;
+                               enable-method = "psci";
+                               clock-frequency = <2400000000>;
+                               cpu-idle-states = <&CPU_SLEEP>;
+               };
+
+               cpucl1_3: cpu@103 {
+                               device_type = "cpu";
+                               compatible = "arm,cortex-a72";
+                               reg = <0x0 0x103>;
+                               enable-method = "psci";
+                               clock-frequency = <2400000000>;
+                               cpu-idle-states = <&CPU_SLEEP>;
+               };
+
+               /* Cluster 2 */
+               cpucl2_0: cpu@200 {
+                               device_type = "cpu";
+                               compatible = "arm,cortex-a72";
+                               reg = <0x0 0x200>;
+                               enable-method = "psci";
+                               clock-frequency = <2400000000>;
+                               cpu-idle-states = <&CPU_SLEEP>;
+               };
+
+               cpucl2_1: cpu@201 {
+                               device_type = "cpu";
+                               compatible = "arm,cortex-a72";
+                               reg = <0x0 0x201>;
+                               enable-method = "psci";
+                               clock-frequency = <2400000000>;
+                               cpu-idle-states = <&CPU_SLEEP>;
+               };
+
+               cpucl2_2: cpu@202 {
+                               device_type = "cpu";
+                               compatible = "arm,cortex-a72";
+                               reg = <0x0 0x202>;
+                               enable-method = "psci";
+                               clock-frequency = <2400000000>;
+                               cpu-idle-states = <&CPU_SLEEP>;
+               };
+
+               cpucl2_3: cpu@203 {
+                               device_type = "cpu";
+                               compatible = "arm,cortex-a72";
+                               reg = <0x0 0x203>;
+                               enable-method = "psci";
+                               clock-frequency = <2400000000>;
+                               cpu-idle-states = <&CPU_SLEEP>;
+               };
+
+               idle-states {
+                       entry-method = "psci";
+
+                       CPU_SLEEP: cpu-sleep {
+                               idle-state-name = "c2";
+                               compatible = "arm,idle-state";
+                               local-timer-stop;
+                               arm,psci-suspend-param = <0x0010000>;
+                               entry-latency-us = <30>;
+                               exit-latency-us = <75>;
+                               min-residency-us = <300>;
+                       };
+               };
+       };
+
+       arm-pmu {
+               compatible = "arm,armv8-pmuv3";
+               interrupts = <GIC_SPI 356 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 357 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 358 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 359 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 370 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 371 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 372 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 373 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 384 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 385 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 386 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 387 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-affinity = <&cpucl0_0>, <&cpucl0_1>, <&cpucl0_2>,
+                                    <&cpucl0_3>, <&cpucl1_0>, <&cpucl1_1>,
+                                    <&cpucl1_2>, <&cpucl1_3>, <&cpucl2_0>,
+                                    <&cpucl2_1>, <&cpucl2_2>, <&cpucl2_3>;
+       };
+
+       psci {
+               compatible = "arm,psci-1.0";
+               method = "smc";
+       };
+
+       timer {
+               compatible = "arm,armv8-timer";
+               interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
+                            <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
+                            <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
+                            <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+       };
+
+       fin_pll: clock {
+               compatible = "fixed-clock";
+               clock-output-names = "fin_pll";
+               #clock-cells = <0>;
+       };
+
+       soc: soc@0 {
+               compatible = "simple-bus";
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges = <0x0 0x0 0x0 0x0 0x0 0x18000000>;
+               dma-ranges = <0x0 0x0 0x0 0x0 0x10 0x0>;
+
+               gic: interrupt-controller@10400000 {
+                       compatible = "arm,gic-v3";
+                       #interrupt-cells = <3>;
+                       interrupt-controller;
+                       reg =   <0x0 0x10400000 0x0 0x10000>, /* GICD */
+                               <0x0 0x10600000 0x0 0x200000>; /* GICR_RD+GICR_SGI */
+                       interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;
+               };
+
+               smmu_imem: iommu@10200000 {
+                       compatible = "arm,mmu-500";
+                       reg = <0x0 0x10200000 0x0 0x10000>;
+                       #iommu-cells = <2>;
+                       #global-interrupts = <7>;
+                       interrupts = <GIC_SPI 438 IRQ_TYPE_LEVEL_HIGH>, /* Global secure fault */
+                                    <GIC_SPI 439 IRQ_TYPE_LEVEL_HIGH>, /* Global non-secure fault */
+                                    <GIC_SPI 451 IRQ_TYPE_LEVEL_HIGH>, /* Combined secure interrupt */
+                                    <GIC_SPI 450 IRQ_TYPE_LEVEL_HIGH>, /* Combined non-secure interrupt */
+                                    /* Performance counter interrupts */
+                                    <GIC_SPI 441 IRQ_TYPE_LEVEL_HIGH>, /* for FSYS1_0 */
+                                    <GIC_SPI 442 IRQ_TYPE_LEVEL_HIGH>, /* for FSYS1_1 */
+                                    <GIC_SPI 443 IRQ_TYPE_LEVEL_HIGH>, /* for IMEM_0  */
+                                    /* Per context non-secure context interrupts, 0-3 interrupts */
+                                    <GIC_SPI 446 IRQ_TYPE_LEVEL_HIGH>, /* for CONTEXT_0 */
+                                    <GIC_SPI 447 IRQ_TYPE_LEVEL_HIGH>, /* for CONTEXT_1 */
+                                    <GIC_SPI 448 IRQ_TYPE_LEVEL_HIGH>, /* for CONTEXT_2 */
+                                    <GIC_SPI 449 IRQ_TYPE_LEVEL_HIGH>; /* for CONTEXT_3 */
+               };
+
+               smmu_isp: iommu@12100000 {
+                       compatible = "arm,mmu-500";
+                       reg = <0x0 0x12100000 0x0 0x10000>;
+                       #iommu-cells = <2>;
+                       #global-interrupts = <11>;
+                       interrupts = <GIC_SPI 321 IRQ_TYPE_LEVEL_HIGH>, /* Global secure fault */
+                                    <GIC_SPI 322 IRQ_TYPE_LEVEL_HIGH>, /* Global non-secure fault */
+                                    <GIC_SPI 346 IRQ_TYPE_LEVEL_HIGH>, /* Combined secure interrupt */
+                                    <GIC_SPI 345 IRQ_TYPE_LEVEL_HIGH>, /* Combined non-secure interrupt */
+                                    /* Performance counter interrupts */
+                                    <GIC_SPI 323 IRQ_TYPE_LEVEL_HIGH>, /* for CAM_CSI   */
+                                    <GIC_SPI 324 IRQ_TYPE_LEVEL_HIGH>, /* for CAM_DP_0  */
+                                    <GIC_SPI 325 IRQ_TYPE_LEVEL_HIGH>, /* for CAM_DP_1  */
+                                    <GIC_SPI 326 IRQ_TYPE_LEVEL_HIGH>, /* for CAM_ISP_0 */
+                                    <GIC_SPI 327 IRQ_TYPE_LEVEL_HIGH>, /* for CAM_ISP_1 */
+                                    <GIC_SPI 328 IRQ_TYPE_LEVEL_HIGH>, /* for CAM_MFC_0 */
+                                    <GIC_SPI 329 IRQ_TYPE_LEVEL_HIGH>, /* for CAM_MFC_1 */
+                                    /* Per context non-secure context interrupts, 0-7 interrupts */
+                                    <GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH>, /* for CONTEXT_0 */
+                                    <GIC_SPI 331 IRQ_TYPE_LEVEL_HIGH>, /* for CONTEXT_1 */
+                                    <GIC_SPI 332 IRQ_TYPE_LEVEL_HIGH>, /* for CONTEXT_2 */
+                                    <GIC_SPI 333 IRQ_TYPE_LEVEL_HIGH>, /* for CONTEXT_3 */
+                                    <GIC_SPI 334 IRQ_TYPE_LEVEL_HIGH>, /* for CONTEXT_4 */
+                                    <GIC_SPI 335 IRQ_TYPE_LEVEL_HIGH>, /* for CONTEXT_5 */
+                                    <GIC_SPI 336 IRQ_TYPE_LEVEL_HIGH>, /* for CONTEXT_6 */
+                                    <GIC_SPI 337 IRQ_TYPE_LEVEL_HIGH>; /* for CONTEXT_7 */
+               };
+
+               smmu_peric: iommu@14900000 {
+                       compatible = "arm,mmu-500";
+                       reg = <0x0 0x14900000 0x0 0x10000>;
+                       #iommu-cells = <2>;
+                       #global-interrupts = <5>;
+                       interrupts = <GIC_SPI 197 IRQ_TYPE_LEVEL_HIGH>, /* Global secure fault */
+                                    <GIC_SPI 196 IRQ_TYPE_LEVEL_HIGH>, /* Global non-secure fault */
+                                    <GIC_SPI 193 IRQ_TYPE_LEVEL_HIGH>, /* Combined secure interrupt */
+                                    <GIC_SPI 192 IRQ_TYPE_LEVEL_HIGH>, /* Combined non-secure interrupt */
+                                    /* Performance counter interrupts */
+                                    <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>, /* for PERIC */
+                                    /* Per context non-secure context interrupts, 0-1 interrupts */
+                                    <GIC_SPI 194 IRQ_TYPE_LEVEL_HIGH>, /* for CONTEXT_0 */
+                                    <GIC_SPI 195 IRQ_TYPE_LEVEL_HIGH>; /* for CONTEXT_1 */
+               };
+
+               smmu_fsys0: iommu@15450000 {
+                       compatible = "arm,mmu-500";
+                       reg = <0x0 0x15450000 0x0 0x10000>;
+                       #iommu-cells = <2>;
+                       #global-interrupts = <5>;
+                       interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>, /* Global secure fault */
+                                    <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>, /* Global non-secure fault */
+                                    <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>, /* Combined secure interrupt */
+                                    <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>, /* Combined non-secure interrupt */
+                                    /* Performance counter interrupts */
+                                    <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>, /* for FSYS0   */
+                                    /* Per context non-secure context interrupts, 0-1 interrupts */
+                                    <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>, /* for CONTEXT_0 */
+                                    <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>; /* for CONTEXT_1 */
+               };
+
+               clock_imem: clock-controller@10010000 {
+                       compatible = "tesla,fsd-clock-imem";
+                       reg = <0x0 0x10010000 0x0 0x3000>;
+                       #clock-cells = <1>;
+                       clocks = <&fin_pll>,
+                               <&clock_cmu DOUT_CMU_IMEM_TCUCLK>,
+                               <&clock_cmu DOUT_CMU_IMEM_ACLK>,
+                               <&clock_cmu DOUT_CMU_IMEM_DMACLK>;
+                       clock-names = "fin_pll",
+                               "dout_cmu_imem_tcuclk",
+                               "dout_cmu_imem_aclk",
+                               "dout_cmu_imem_dmaclk";
+               };
+
+               clock_cmu: clock-controller@11c10000 {
+                       compatible = "tesla,fsd-clock-cmu";
+                       reg = <0x0 0x11c10000 0x0 0x3000>;
+                       #clock-cells = <1>;
+                       clocks = <&fin_pll>;
+                       clock-names = "fin_pll";
+               };
+
+               clock_csi: clock-controller@12610000 {
+                       compatible = "tesla,fsd-clock-cam_csi";
+                       reg = <0x0 0x12610000 0x0 0x3000>;
+                       #clock-cells = <1>;
+                       clocks = <&fin_pll>;
+                       clock-names = "fin_pll";
+               };
+
+               clock_mfc: clock-controller@12810000 {
+                       compatible = "tesla,fsd-clock-mfc";
+                       reg = <0x0 0x12810000 0x0 0x3000>;
+                       #clock-cells = <1>;
+                       clocks = <&fin_pll>;
+                       clock-names = "fin_pll";
+               };
+
+               clock_peric: clock-controller@14010000 {
+                       compatible = "tesla,fsd-clock-peric";
+                       reg = <0x0 0x14010000 0x0 0x3000>;
+                       #clock-cells = <1>;
+                       clocks = <&fin_pll>,
+                               <&clock_cmu DOUT_CMU_PLL_SHARED0_DIV4>,
+                               <&clock_cmu DOUT_CMU_PERIC_SHARED1DIV36>,
+                               <&clock_cmu DOUT_CMU_PERIC_SHARED0DIV3_TBUCLK>,
+                               <&clock_cmu DOUT_CMU_PERIC_SHARED0DIV20>,
+                               <&clock_cmu DOUT_CMU_PERIC_SHARED1DIV4_DMACLK>;
+                       clock-names = "fin_pll",
+                               "dout_cmu_pll_shared0_div4",
+                               "dout_cmu_peric_shared1div36",
+                               "dout_cmu_peric_shared0div3_tbuclk",
+                               "dout_cmu_peric_shared0div20",
+                               "dout_cmu_peric_shared1div4_dmaclk";
+               };
+
+               clock_fsys0: clock-controller@15010000 {
+                       compatible = "tesla,fsd-clock-fsys0";
+                       reg = <0x0 0x15010000 0x0 0x3000>;
+                       #clock-cells = <1>;
+                       clocks = <&fin_pll>,
+                               <&clock_cmu DOUT_CMU_PLL_SHARED0_DIV6>,
+                               <&clock_cmu DOUT_CMU_FSYS0_SHARED1DIV4>,
+                               <&clock_cmu DOUT_CMU_FSYS0_SHARED0DIV4>;
+                       clock-names = "fin_pll",
+                               "dout_cmu_pll_shared0_div6",
+                               "dout_cmu_fsys0_shared1div4",
+                               "dout_cmu_fsys0_shared0div4";
+               };
+
+               clock_fsys1: clock-controller@16810000 {
+                       compatible = "tesla,fsd-clock-fsys1";
+                       reg = <0x0 0x16810000 0x0 0x3000>;
+                       #clock-cells = <1>;
+                       clocks = <&fin_pll>,
+                               <&clock_cmu DOUT_CMU_FSYS1_SHARED0DIV8>,
+                               <&clock_cmu DOUT_CMU_FSYS1_SHARED0DIV4>;
+                       clock-names = "fin_pll",
+                               "dout_cmu_fsys1_shared0div8",
+                               "dout_cmu_fsys1_shared0div4";
+               };
+
+               mdma0: dma-controller@10100000 {
+                       compatible = "arm,pl330", "arm,primecell";
+                       reg = <0x0 0x10100000 0x0 0x1000>;
+                       interrupts = <GIC_SPI 424 IRQ_TYPE_LEVEL_HIGH>;
+                       #dma-cells = <1>;
+                       #dma-channels = <8>;
+                       #dma-requests = <32>;
+                       clocks = <&clock_imem IMEM_DMA0_IPCLKPORT_ACLK>;
+                       clock-names = "apb_pclk";
+                       iommus = <&smmu_imem 0x800 0x0>;
+               };
+
+               mdma1: dma-controller@10110000 {
+                       compatible = "arm,pl330", "arm,primecell";
+                       reg = <0x0 0x10110000 0x0 0x1000>;
+                       interrupts = <GIC_SPI 425 IRQ_TYPE_LEVEL_HIGH>;
+                       #dma-cells = <1>;
+                       #dma-channels = <8>;
+                       #dma-requests = <32>;
+                       clocks = <&clock_imem IMEM_DMA1_IPCLKPORT_ACLK>;
+                       clock-names = "apb_pclk";
+                       iommus = <&smmu_imem 0x801 0x0>;
+               };
+
+               pdma0: dma-controller@14280000 {
+                       compatible = "arm,pl330", "arm,primecell";
+                       reg = <0x0 0x14280000 0x0 0x1000>;
+                       interrupts = <GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>;
+                       #dma-cells = <1>;
+                       #dma-channels = <8>;
+                       #dma-requests = <32>;
+                       clocks = <&clock_peric PERIC_DMA0_IPCLKPORT_ACLK>;
+                       clock-names = "apb_pclk";
+                       iommus = <&smmu_peric 0x2 0x0>;
+               };
+
+               pdma1: dma-controller@14290000 {
+                       compatible = "arm,pl330", "arm,primecell";
+                       reg = <0x0 0x14290000 0x0 0x1000>;
+                       interrupts = <GIC_SPI 191 IRQ_TYPE_LEVEL_HIGH>;
+                       #dma-cells = <1>;
+                       #dma-channels = <8>;
+                       #dma-requests = <32>;
+                       clocks = <&clock_peric PERIC_DMA1_IPCLKPORT_ACLK>;
+                       clock-names = "apb_pclk";
+                       iommus = <&smmu_peric 0x1 0x0>;
+               };
+
+               serial_0: serial@14180000 {
+                       compatible = "samsung,exynos4210-uart";
+                       reg = <0x0 0x14180000 0x0 0x100>;
+                       interrupts = <GIC_SPI 171 IRQ_TYPE_LEVEL_HIGH>;
+                       dmas = <&pdma1 1>, <&pdma1 0>;
+                       dma-names = "rx", "tx";
+                       clocks = <&clock_peric PERIC_PCLK_UART0>,
+                                <&clock_peric PERIC_SCLK_UART0>;
+                       clock-names = "uart", "clk_uart_baud0";
+                       status = "disabled";
+               };
+
+               serial_1: serial@14190000 {
+                       compatible = "samsung,exynos4210-uart";
+                       reg = <0x0 0x14190000 0x0 0x100>;
+                       interrupts = <GIC_SPI 172 IRQ_TYPE_LEVEL_HIGH>;
+                       dmas = <&pdma1 3>, <&pdma1 2>;
+                       dma-names = "rx", "tx";
+                       clocks = <&clock_peric PERIC_PCLK_UART1>,
+                                <&clock_peric PERIC_SCLK_UART1>;
+                       clock-names = "uart", "clk_uart_baud0";
+                       status = "disabled";
+               };
+
+               pmu_system_controller: system-controller@11400000 {
+                       compatible = "samsung,exynos7-pmu", "syscon";
+                       reg = <0x0 0x11400000 0x0 0x5000>;
+               };
+
+               watchdog_0: watchdog@100a0000 {
+                       compatible = "samsung,exynos7-wdt";
+                       reg = <0x0 0x100a0000 0x0 0x100>;
+                       interrupts = <GIC_SPI 471 IRQ_TYPE_LEVEL_HIGH>;
+                       samsung,syscon-phandle = <&pmu_system_controller>;
+                       clocks = <&fin_pll>;
+                       clock-names = "watchdog";
+               };
+
+               watchdog_1: watchdog@100b0000 {
+                       compatible = "samsung,exynos7-wdt";
+                       reg = <0x0 0x100b0000 0x0 0x100>;
+                       interrupts = <GIC_SPI 472 IRQ_TYPE_LEVEL_HIGH>;
+                       samsung,syscon-phandle = <&pmu_system_controller>;
+                       clocks = <&fin_pll>;
+                       clock-names = "watchdog";
+               };
+
+               watchdog_2: watchdog@100c0000 {
+                       compatible = "samsung,exynos7-wdt";
+                       reg = <0x0 0x100c0000 0x0 0x100>;
+                       interrupts = <GIC_SPI 473 IRQ_TYPE_LEVEL_HIGH>;
+                       samsung,syscon-phandle = <&pmu_system_controller>;
+                       clocks = <&fin_pll>;
+                       clock-names = "watchdog";
+               };
+
+               pwm_0: pwm@14100000 {
+                       compatible = "samsung,exynos4210-pwm";
+                       reg = <0x0 0x14100000 0x0 0x100>;
+                       samsung,pwm-outputs = <0>, <1>, <2>, <3>;
+                       #pwm-cells = <3>;
+                       clocks = <&clock_peric PERIC_PWM0_IPCLKPORT_I_PCLK_S0>;
+                       clock-names = "timers";
+                       status = "disabled";
+               };
+
+               pwm_1: pwm@14110000 {
+                       compatible = "samsung,exynos4210-pwm";
+                       reg = <0x0 0x14110000 0x0 0x100>;
+                       samsung,pwm-outputs = <0>, <1>, <2>, <3>;
+                       #pwm-cells = <3>;
+                       clocks = <&clock_peric PERIC_PWM1_IPCLKPORT_I_PCLK_S0>;
+                       clock-names = "timers";
+                       status = "disabled";
+               };
+
+               hsi2c_0: i2c@14200000 {
+                       compatible = "samsung,exynos7-hsi2c";
+                       reg = <0x0 0x14200000 0x0 0x1000>;
+                       interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&hs_i2c0_bus>;
+                       clocks = <&clock_peric PERIC_PCLK_HSI2C0>;
+                       clock-names = "hsi2c";
+                       status = "disabled";
+               };
+
+               hsi2c_1: i2c@14210000 {
+                       compatible = "samsung,exynos7-hsi2c";
+                       reg = <0x0 0x14210000 0x0 0x1000>;
+                       interrupts = <GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&hs_i2c1_bus>;
+                       clocks = <&clock_peric PERIC_PCLK_HSI2C1>;
+                       clock-names = "hsi2c";
+                       status = "disabled";
+               };
+
+               hsi2c_2: i2c@14220000 {
+                       compatible = "samsung,exynos7-hsi2c";
+                       reg = <0x0 0x14220000 0x0 0x1000>;
+                       interrupts = <GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&hs_i2c2_bus>;
+                       clocks = <&clock_peric PERIC_PCLK_HSI2C2>;
+                       clock-names = "hsi2c";
+                       status = "disabled";
+               };
+
+               hsi2c_3: i2c@14230000 {
+                       compatible = "samsung,exynos7-hsi2c";
+                       reg = <0x0 0x14230000 0x0 0x1000>;
+                       interrupts = <GIC_SPI 151 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&hs_i2c3_bus>;
+                       clocks = <&clock_peric PERIC_PCLK_HSI2C3>;
+                       clock-names = "hsi2c";
+                       status = "disabled";
+               };
+
+               hsi2c_4: i2c@14240000 {
+                       compatible = "samsung,exynos7-hsi2c";
+                       reg = <0x0 0x14240000 0x0 0x1000>;
+                       interrupts = <GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&hs_i2c4_bus>;
+                       clocks = <&clock_peric PERIC_PCLK_HSI2C4>;
+                       clock-names = "hsi2c";
+                       status = "disabled";
+               };
+
+               hsi2c_5: i2c@14250000 {
+                       compatible = "samsung,exynos7-hsi2c";
+                       reg = <0x0 0x14250000 0x0 0x1000>;
+                       interrupts = <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&hs_i2c5_bus>;
+                       clocks = <&clock_peric PERIC_PCLK_HSI2C5>;
+                       clock-names = "hsi2c";
+                       status = "disabled";
+               };
+
+               hsi2c_6: i2c@14260000 {
+                       compatible = "samsung,exynos7-hsi2c";
+                       reg = <0x0 0x14260000 0x0 0x1000>;
+                       interrupts = <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&hs_i2c6_bus>;
+                       clocks = <&clock_peric PERIC_PCLK_HSI2C6>;
+                       clock-names = "hsi2c";
+                       status = "disabled";
+               };
+
+               hsi2c_7: i2c@14270000 {
+                       compatible = "samsung,exynos7-hsi2c";
+                       reg = <0x0 0x14270000 0x0 0x1000>;
+                       interrupts = <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&hs_i2c7_bus>;
+                       clocks = <&clock_peric PERIC_PCLK_HSI2C7>;
+                       clock-names = "hsi2c";
+                       status = "disabled";
+               };
+
+               pinctrl_pmu: pinctrl@114f0000 {
+                       compatible = "tesla,fsd-pinctrl";
+                       reg = <0x0 0x114f0000 0x0 0x1000>;
+               };
+
+               pinctrl_peric: pinctrl@141f0000 {
+                       compatible = "tesla,fsd-pinctrl";
+                       reg = <0x0 0x141f0000 0x0 0x1000>;
+                       interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>;
+               };
+
+               pinctrl_fsys0: pinctrl@15020000 {
+                       compatible = "tesla,fsd-pinctrl";
+                       reg = <0x0 0x15020000 0x0 0x1000>;
+                       interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
+               };
+
+               spi_0: spi@14140000 {
+                       compatible = "tesla,fsd-spi";
+                       reg = <0x0 0x14140000 0x0 0x100>;
+                       interrupts = <GIC_SPI 156 IRQ_TYPE_LEVEL_HIGH>;
+                       dmas = <&pdma1 4>, <&pdma1 5>;
+                       dma-names = "tx", "rx";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       clocks = <&clock_peric PERIC_PCLK_SPI0>,
+                               <&clock_peric PERIC_SCLK_SPI0>;
+                       clock-names = "spi", "spi_busclk0";
+                       samsung,spi-src-clk = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&spi0_bus>;
+                       num-cs = <1>;
+                       status = "disabled";
+               };
+
+               spi_1: spi@14150000 {
+                       compatible = "tesla,fsd-spi";
+                       reg = <0x0 0x14150000 0x0 0x100>;
+                       interrupts = <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>;
+                       dmas = <&pdma1 6>, <&pdma1 7>;
+                       dma-names = "tx", "rx";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       clocks = <&clock_peric PERIC_PCLK_SPI1>,
+                               <&clock_peric PERIC_SCLK_SPI1>;
+                       clock-names = "spi", "spi_busclk0";
+                       samsung,spi-src-clk = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&spi1_bus>;
+                       num-cs = <1>;
+                       status = "disabled";
+               };
+
+               spi_2: spi@14160000 {
+                       compatible = "tesla,fsd-spi";
+                       reg = <0x0 0x14160000 0x0 0x100>;
+                       interrupts = <GIC_SPI 158 IRQ_TYPE_LEVEL_HIGH>;
+                       dmas = <&pdma1 8>, <&pdma1 9>;
+                       dma-names = "tx", "rx";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       clocks = <&clock_peric PERIC_PCLK_SPI2>,
+                               <&clock_peric PERIC_SCLK_SPI2>;
+                       clock-names = "spi", "spi_busclk0";
+                       samsung,spi-src-clk = <0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&spi2_bus>;
+                       num-cs = <1>;
+                       status = "disabled";
+               };
+       };
+};
+
+#include "fsd-pinctrl.dtsi"
index 90be511..02e5d80 100644 (file)
@@ -21,3 +21,5 @@ dtb-$(CONFIG_ARCH_K3) += k3-j721s2-common-proc-board.dtb
 
 dtb-$(CONFIG_ARCH_K3) += k3-am642-evm.dtb
 dtb-$(CONFIG_ARCH_K3) += k3-am642-sk.dtb
+
+dtb-$(CONFIG_ARCH_K3) += k3-am625-sk.dtb
diff --git a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
new file mode 100644 (file)
index 0000000..c68472c
--- /dev/null
@@ -0,0 +1,267 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for AM625 SoC Family Main Domain peripherals
+ *
+ * Copyright (C) 2020-2022 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+&cbass_main {
+       gic500: interrupt-controller@1800000 {
+               compatible = "arm,gic-v3";
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+               #interrupt-cells = <3>;
+               interrupt-controller;
+               reg = <0x00 0x01800000 0x00 0x10000>,   /* GICD */
+                     <0x00 0x01880000 0x00 0xc0000>,   /* GICR */
+                     <0x00 0x01880000 0x00 0xc0000>,   /* GICR */
+                     <0x01 0x00000000 0x00 0x2000>,    /* GICC */
+                     <0x01 0x00010000 0x00 0x1000>,    /* GICH */
+                     <0x01 0x00020000 0x00 0x2000>;    /* GICV */
+               /*
+                * vcpumntirq:
+                * virtual CPU interface maintenance interrupt
+                */
+               interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;
+
+               gic_its: msi-controller@1820000 {
+                       compatible = "arm,gic-v3-its";
+                       reg = <0x00 0x01820000 0x00 0x10000>;
+                       socionext,synquacer-pre-its = <0x1000000 0x400000>;
+                       msi-controller;
+                       #msi-cells = <1>;
+               };
+       };
+
+       main_conf: syscon@100000 {
+               compatible = "syscon", "simple-mfd";
+               reg = <0x00 0x00100000 0x00 0x20000>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0x0 0x00 0x00100000 0x20000>;
+       };
+
+       dmss: bus@48000000 {
+               compatible = "simple-mfd";
+               #address-cells = <2>;
+               #size-cells = <2>;
+               dma-ranges;
+               ranges = <0x00 0x48000000 0x00 0x48000000 0x00 0x06400000>;
+
+               ti,sci-dev-id = <25>;
+
+               secure_proxy_main: mailbox@4d000000 {
+                       compatible = "ti,am654-secure-proxy";
+                       #mbox-cells = <1>;
+                       reg-names = "target_data", "rt", "scfg";
+                       reg = <0x00 0x4d000000 0x00 0x80000>,
+                             <0x00 0x4a600000 0x00 0x80000>,
+                             <0x00 0x4a400000 0x00 0x80000>;
+                       interrupt-names = "rx_012";
+                       interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
+               };
+       };
+
+       dmsc: system-controller@44043000 {
+               compatible = "ti,k2g-sci";
+               ti,host-id = <12>;
+               mbox-names = "rx", "tx";
+               mboxes= <&secure_proxy_main 12>,
+                       <&secure_proxy_main 13>;
+               reg-names = "debug_messages";
+               reg = <0x00 0x44043000 0x00 0xfe0>;
+
+               k3_pds: power-controller {
+                       compatible = "ti,sci-pm-domain";
+                       #power-domain-cells = <2>;
+               };
+
+               k3_clks: clock-controller {
+                       compatible = "ti,k2g-sci-clk";
+                       #clock-cells = <2>;
+               };
+
+               k3_reset: reset-controller {
+                       compatible = "ti,sci-reset";
+                       #reset-cells = <2>;
+               };
+       };
+
+       main_pmx0: pinctrl@f4000 {
+               compatible = "pinctrl-single";
+               reg = <0x00 0xf4000 0x00 0x2ac>;
+               #pinctrl-cells = <1>;
+               pinctrl-single,register-width = <32>;
+               pinctrl-single,function-mask = <0xffffffff>;
+       };
+
+       main_uart0: serial@2800000 {
+               compatible = "ti,am64-uart", "ti,am654-uart";
+               reg = <0x00 0x02800000 0x00 0x100>;
+               interrupts = <GIC_SPI 178 IRQ_TYPE_LEVEL_HIGH>;
+               power-domains = <&k3_pds 146 TI_SCI_PD_EXCLUSIVE>;
+               clocks = <&k3_clks 146 0>;
+               clock-names = "fclk";
+       };
+
+       main_uart1: serial@2810000 {
+               compatible = "ti,am64-uart", "ti,am654-uart";
+               reg = <0x00 0x02810000 0x00 0x100>;
+               interrupts = <GIC_SPI 179 IRQ_TYPE_LEVEL_HIGH>;
+               power-domains = <&k3_pds 152 TI_SCI_PD_EXCLUSIVE>;
+               clocks = <&k3_clks 152 0>;
+               clock-names = "fclk";
+       };
+
+       main_uart2: serial@2820000 {
+               compatible = "ti,am64-uart", "ti,am654-uart";
+               reg = <0x00 0x02820000 0x00 0x100>;
+               interrupts = <GIC_SPI 180 IRQ_TYPE_LEVEL_HIGH>;
+               power-domains = <&k3_pds 153 TI_SCI_PD_EXCLUSIVE>;
+               clocks = <&k3_clks 153 0>;
+               clock-names = "fclk";
+       };
+
+       main_uart3: serial@2830000 {
+               compatible = "ti,am64-uart", "ti,am654-uart";
+               reg = <0x00 0x02830000 0x00 0x100>;
+               interrupts = <GIC_SPI 181 IRQ_TYPE_LEVEL_HIGH>;
+               power-domains = <&k3_pds 154 TI_SCI_PD_EXCLUSIVE>;
+               clocks = <&k3_clks 154 0>;
+               clock-names = "fclk";
+       };
+
+       main_uart4: serial@2840000 {
+               compatible = "ti,am64-uart", "ti,am654-uart";
+               reg = <0x00 0x02840000 0x00 0x100>;
+               interrupts = <GIC_SPI 182 IRQ_TYPE_LEVEL_HIGH>;
+               power-domains = <&k3_pds 155 TI_SCI_PD_EXCLUSIVE>;
+               clocks = <&k3_clks 155 0>;
+               clock-names = "fclk";
+       };
+
+       main_uart5: serial@2850000 {
+               compatible = "ti,am64-uart", "ti,am654-uart";
+               reg = <0x00 0x02850000 0x00 0x100>;
+               interrupts = <GIC_SPI 183 IRQ_TYPE_LEVEL_HIGH>;
+               power-domains = <&k3_pds 156 TI_SCI_PD_EXCLUSIVE>;
+               clocks = <&k3_clks 156 0>;
+               clock-names = "fclk";
+       };
+
+       main_uart6: serial@2860000 {
+               compatible = "ti,am64-uart", "ti,am654-uart";
+               reg = <0x00 0x02860000 0x00 0x100>;
+               interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
+               power-domains = <&k3_pds 158 TI_SCI_PD_EXCLUSIVE>;
+               clocks = <&k3_clks 158 0>;
+               clock-names = "fclk";
+       };
+
+       main_i2c0: i2c@20000000 {
+               compatible = "ti,am64-i2c", "ti,omap4-i2c";
+               reg = <0x00 0x20000000 0x00 0x100>;
+               interrupts = <GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               power-domains = <&k3_pds 102 TI_SCI_PD_EXCLUSIVE>;
+               clocks = <&k3_clks 102 2>;
+               clock-names = "fck";
+       };
+
+       main_i2c1: i2c@20010000 {
+               compatible = "ti,am64-i2c", "ti,omap4-i2c";
+               reg = <0x00 0x20010000 0x00 0x100>;
+               interrupts = <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               power-domains = <&k3_pds 103 TI_SCI_PD_EXCLUSIVE>;
+               clocks = <&k3_clks 103 2>;
+               clock-names = "fck";
+       };
+
+       main_i2c2: i2c@20020000 {
+               compatible = "ti,am64-i2c", "ti,omap4-i2c";
+               reg = <0x00 0x20020000 0x00 0x100>;
+               interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               power-domains = <&k3_pds 104 TI_SCI_PD_EXCLUSIVE>;
+               clocks = <&k3_clks 104 2>;
+               clock-names = "fck";
+       };
+
+       main_i2c3: i2c@20030000 {
+               compatible = "ti,am64-i2c", "ti,omap4-i2c";
+               reg = <0x00 0x20030000 0x00 0x100>;
+               interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               power-domains = <&k3_pds 105 TI_SCI_PD_EXCLUSIVE>;
+               clocks = <&k3_clks 105 2>;
+               clock-names = "fck";
+       };
+
+       main_gpio_intr: interrupt-controller@a00000 {
+               compatible = "ti,sci-intr";
+               reg = <0x00 0x00a00000 0x00 0x800>;
+               ti,intr-trigger-type = <1>;
+               interrupt-controller;
+               interrupt-parent = <&gic500>;
+               #interrupt-cells = <1>;
+               ti,sci = <&dmsc>;
+               ti,sci-dev-id = <3>;
+               ti,interrupt-ranges = <0 32 16>;
+       };
+
+       main_gpio0: gpio@600000 {
+               compatible = "ti,am64-gpio", "ti,keystone-gpio";
+               reg = <0x0 0x00600000 0x0 0x100>;
+               gpio-controller;
+               #gpio-cells = <2>;
+               interrupt-parent = <&main_gpio_intr>;
+               interrupts = <190>, <191>, <192>,
+                            <193>, <194>, <195>;
+               interrupt-controller;
+               #interrupt-cells = <2>;
+               ti,ngpio = <87>;
+               ti,davinci-gpio-unbanked = <0>;
+               power-domains = <&k3_pds 77 TI_SCI_PD_EXCLUSIVE>;
+               clocks = <&k3_clks 77 0>;
+               clock-names = "gpio";
+       };
+
+       main_gpio1: gpio@601000 {
+               compatible = "ti,am64-gpio", "ti,keystone-gpio";
+               reg = <0x0 0x00601000 0x0 0x100>;
+               gpio-controller;
+               #gpio-cells = <2>;
+               interrupt-parent = <&main_gpio_intr>;
+               interrupts = <180>, <181>, <182>,
+                            <183>, <184>, <185>;
+               interrupt-controller;
+               #interrupt-cells = <2>;
+               ti,ngpio = <88>;
+               ti,davinci-gpio-unbanked = <0>;
+               power-domains = <&k3_pds 78 TI_SCI_PD_EXCLUSIVE>;
+               clocks = <&k3_clks 78 0>;
+               clock-names = "gpio";
+       };
+
+       hwspinlock: spinlock@2a000000 {
+               compatible = "ti,am64-hwspinlock";
+               reg = <0x00 0x2a000000 0x00 0x1000>;
+               #hwlock-cells = <1>;
+       };
+
+       mailbox0_cluster0: mailbox@29000000 {
+               compatible = "ti,am64-mailbox";
+               reg = <0x00 0x29000000 0x00 0x200>;
+               interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
+               #mbox-cells = <1>;
+               ti,mbox-num-users = <4>;
+               ti,mbox-num-fifos = <16>;
+       };
+};
diff --git a/arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi b/arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi
new file mode 100644 (file)
index 0000000..9d210d5
--- /dev/null
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for AM625 SoC Family MCU Domain peripherals
+ *
+ * Copyright (C) 2020-2022 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+&cbass_mcu {
+       mcu_pmx0: pinctrl@4084000 {
+               compatible = "pinctrl-single";
+               reg = <0x00 0x04084000 0x00 0x88>;
+               #pinctrl-cells = <1>;
+               pinctrl-single,register-width = <32>;
+               pinctrl-single,function-mask = <0xffffffff>;
+       };
+
+       mcu_uart0: serial@4a00000 {
+               compatible = "ti,am64-uart", "ti,am654-uart";
+               reg = <0x00 0x04a00000 0x00 0x100>;
+               interrupts = <GIC_SPI 185 IRQ_TYPE_LEVEL_HIGH>;
+               power-domains = <&k3_pds 149 TI_SCI_PD_EXCLUSIVE>;
+               clocks = <&k3_clks 149 0>;
+               clock-names = "fclk";
+       };
+
+       mcu_i2c0: i2c@4900000 {
+               compatible = "ti,am64-i2c", "ti,omap4-i2c";
+               reg = <0x00 0x04900000 0x00 0x100>;
+               interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               power-domains = <&k3_pds 106 TI_SCI_PD_EXCLUSIVE>;
+               clocks = <&k3_clks 106 2>;
+               clock-names = "fck";
+       };
+};
diff --git a/arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi b/arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi
new file mode 100644 (file)
index 0000000..4090134
--- /dev/null
@@ -0,0 +1,41 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for AM625 SoC Family Wakeup Domain peripherals
+ *
+ * Copyright (C) 2020-2022 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+&cbass_wakeup {
+       wkup_conf: syscon@43000000 {
+               compatible = "syscon", "simple-mfd";
+               reg = <0x00 0x43000000 0x00 0x20000>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0x0 0x00 0x43000000 0x20000>;
+
+               chipid: chipid@14 {
+                       compatible = "ti,am654-chipid";
+                       reg = <0x14 0x4>;
+               };
+       };
+
+       wkup_uart0: serial@2b300000 {
+               compatible = "ti,am64-uart", "ti,am654-uart";
+               reg = <0x00 0x2b300000 0x00 0x100>;
+               interrupts = <GIC_SPI 186 IRQ_TYPE_LEVEL_HIGH>;
+               power-domains = <&k3_pds 114 TI_SCI_PD_EXCLUSIVE>;
+               clocks = <&k3_clks 114 0>;
+               clock-names = "fclk";
+       };
+
+       wkup_i2c0: i2c@2b200000 {
+               compatible = "ti,am64-i2c", "ti,omap4-i2c";
+               reg = <0x00 0x02b200000 0x00 0x100>;
+               interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               power-domains = <&k3_pds 107 TI_SCI_PD_EXCLUSIVE>;
+               clocks = <&k3_clks 107 4>;
+               clock-names = "fck";
+       };
+};
diff --git a/arch/arm64/boot/dts/ti/k3-am62.dtsi b/arch/arm64/boot/dts/ti/k3-am62.dtsi
new file mode 100644 (file)
index 0000000..bc2997b
--- /dev/null
@@ -0,0 +1,105 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for AM62 SoC Family
+ *
+ * Copyright (C) 2020-2022 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/pinctrl/k3.h>
+#include <dt-bindings/soc/ti,sci_pm_domain.h>
+
+/ {
+       model = "Texas Instruments K3 AM625 SoC";
+       compatible = "ti,am625";
+       interrupt-parent = <&gic500>;
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       chosen { };
+
+       firmware {
+               optee {
+                       compatible = "linaro,optee-tz";
+                       method = "smc";
+               };
+
+               psci: psci {
+                       compatible = "arm,psci-1.0";
+                       method = "smc";
+               };
+       };
+
+       a53_timer0: timer-cl0-cpu0 {
+               compatible = "arm,armv8-timer";
+               interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>, /* cntpsirq */
+                            <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>, /* cntpnsirq */
+                            <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>, /* cntvirq */
+                            <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>; /* cnthpirq */
+       };
+
+       pmu: pmu {
+               compatible = "arm,cortex-a53-pmu";
+               interrupts = <GIC_PPI 7 IRQ_TYPE_LEVEL_HIGH>;
+       };
+
+       cbass_main: bus@f0000 {
+               compatible = "simple-bus";
+               #address-cells = <2>;
+               #size-cells = <2>;
+
+               ranges = <0x00 0x000f0000 0x00 0x000f0000 0x00 0x00030000>, /* Main MMRs */
+                        <0x00 0x00420000 0x00 0x00420000 0x00 0x00001000>, /* ESM0 */
+                        <0x00 0x00600000 0x00 0x00600000 0x00 0x00001100>, /* GPIO */
+                        <0x00 0x00703000 0x00 0x00703000 0x00 0x00000200>, /* USB0 debug trace */
+                        <0x00 0x0070c000 0x00 0x0070c000 0x00 0x00000200>, /* USB1 debug trace */
+                        <0x00 0x00a40000 0x00 0x00a40000 0x00 0x00000800>, /* Timesync router */
+                        <0x00 0x01000000 0x00 0x01000000 0x00 0x01b28400>, /* First peripheral window */
+                        <0x00 0x08000000 0x00 0x08000000 0x00 0x00200000>, /* Main CPSW */
+                        <0x00 0x0e000000 0x00 0x0e000000 0x00 0x01d20000>, /* Second peripheral window */
+                        <0x00 0x0fd00000 0x00 0x0fd00000 0x00 0x00020000>, /* GPU */
+                        <0x00 0x20000000 0x00 0x20000000 0x00 0x0a008000>, /* Third peripheral window */
+                        <0x00 0x30040000 0x00 0x30040000 0x00 0x00080000>, /* PRUSS-M */
+                        <0x00 0x30101000 0x00 0x30101000 0x00 0x00010100>, /* CSI window */
+                        <0x00 0x30200000 0x00 0x30200000 0x00 0x00010000>, /* DSS */
+                        <0x00 0x31000000 0x00 0x31000000 0x00 0x00050000>, /* USB0 DWC3 Core window */
+                        <0x00 0x31100000 0x00 0x31100000 0x00 0x00050000>, /* USB1 DWC3 Core window */
+                        <0x00 0x43600000 0x00 0x43600000 0x00 0x00010000>, /* SA3 sproxy data */
+                        <0x00 0x44043000 0x00 0x44043000 0x00 0x00000fe0>, /* TI SCI DEBUG */
+                        <0x00 0x44860000 0x00 0x44860000 0x00 0x00040000>, /* SA3 sproxy config */
+                        <0x00 0x48000000 0x00 0x48000000 0x00 0x06400000>, /* DMSS */
+                        <0x00 0x60000000 0x00 0x60000000 0x00 0x08000000>, /* FSS0 DAT1 */
+                        <0x00 0x70000000 0x00 0x70000000 0x00 0x00010000>, /* OCSRAM */
+                        <0x01 0x00000000 0x01 0x00000000 0x00 0x00310000>, /* A53 PERIPHBASE */
+                        <0x05 0x00000000 0x05 0x00000000 0x01 0x00000000>, /* FSS0 DAT3 */
+
+                        /* MCU Domain Range */
+                        <0x00 0x04000000 0x00 0x04000000 0x00 0x01ff1400>,
+
+                        /* Wakeup Domain Range */
+                        <0x00 0x2b000000 0x00 0x2b000000 0x00 0x00300400>,
+                        <0x00 0x43000000 0x00 0x43000000 0x00 0x00020000>;
+
+               cbass_mcu: bus@4000000 {
+                       compatible = "simple-bus";
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges = <0x00 0x04000000 0x00 0x04000000 0x00 0x01ff1400>; /* Peripheral window */
+               };
+
+               cbass_wakeup: bus@2b000000 {
+                       compatible = "simple-bus";
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges = <0x00 0x2b000000 0x00 0x2b000000 0x00 0x00300400>, /* Peripheral Window */
+                                <0x00 0x43000000 0x00 0x43000000 0x00 0x00020000>;
+               };
+       };
+};
+
+/* Now include the peripherals for each bus segments */
+#include "k3-am62-main.dtsi"
+#include "k3-am62-mcu.dtsi"
+#include "k3-am62-wakeup.dtsi"
diff --git a/arch/arm64/boot/dts/ti/k3-am625-sk.dts b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
new file mode 100644 (file)
index 0000000..0de4113
--- /dev/null
@@ -0,0 +1,206 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * AM625 SK: https://www.ti.com/lit/zip/sprr448
+ *
+ * Copyright (C) 2021-2022 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/gpio/gpio.h>
+#include "k3-am625.dtsi"
+
+/ {
+       compatible =  "ti,am625-sk", "ti,am625";
+       model = "Texas Instruments AM625 SK";
+
+       aliases {
+               serial2 = &main_uart0;
+       };
+
+       chosen {
+               stdout-path = "serial2:115200n8";
+               bootargs = "console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000";
+       };
+
+       memory@80000000 {
+               device_type = "memory";
+               /* 2G RAM */
+               reg = <0x00000000 0x80000000 0x00000000 0x80000000>;
+
+       };
+
+       reserved-memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               secure_tfa_ddr: tfa@9e780000 {
+                       reg = <0x00 0x9e780000 0x00 0x80000>;
+                       alignment = <0x1000>;
+                       no-map;
+               };
+
+               secure_ddr: optee@9e800000 {
+                       reg = <0x00 0x9e800000 0x00 0x01800000>; /* for OP-TEE */
+                       alignment = <0x1000>;
+                       no-map;
+               };
+
+               wkup_r5fss0_core0_dma_memory_region: r5f-dma-memory@9db00000 {
+                       compatible = "shared-dma-pool";
+                       reg = <0x00 0x9db00000 0x00 0xc00000>;
+                       no-map;
+               };
+       };
+
+       vmain_pd: regulator-0 {
+               /* TPS65988 PD CONTROLLER OUTPUT */
+               compatible = "regulator-fixed";
+               regulator-name = "vmain_pd";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               regulator-always-on;
+               regulator-boot-on;
+       };
+
+       vcc_5v0: regulator-1 {
+               /* Output of LM34936 */
+               compatible = "regulator-fixed";
+               regulator-name = "vcc_5v0";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               vin-supply = <&vmain_pd>;
+               regulator-always-on;
+               regulator-boot-on;
+       };
+
+       vcc_3v3_sys: regulator-2 {
+               /* output of LM61460-Q1 */
+               compatible = "regulator-fixed";
+               regulator-name = "vcc_3v3_sys";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&vmain_pd>;
+               regulator-always-on;
+               regulator-boot-on;
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&usr_led_pins_default>;
+
+               led-0 {
+                       label = "am62-sk:green:heartbeat";
+                       gpios = <&main_gpio1 49 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "heartbeat";
+                       function = LED_FUNCTION_HEARTBEAT;
+                       default-state = "off";
+               };
+       };
+};
+
+&main_pmx0 {
+       main_uart0_pins_default: main-uart0-pins-default {
+               pinctrl-single,pins = <
+                       AM62X_IOPAD(0x1c8, PIN_INPUT, 0) /* (D14) UART0_RXD */
+                       AM62X_IOPAD(0x1cc, PIN_OUTPUT, 0) /* (E14) UART0_TXD */
+               >;
+       };
+
+       main_i2c0_pins_default: main-i2c0-pins-default {
+               pinctrl-single,pins = <
+                       AM62X_IOPAD(0x1e0, PIN_INPUT_PULLUP, 0) /* (B16) I2C0_SCL */
+                       AM62X_IOPAD(0x1e4, PIN_INPUT_PULLUP, 0) /* (A16) I2C0_SDA */
+               >;
+       };
+
+       main_i2c1_pins_default: main-i2c1-pins-default {
+               pinctrl-single,pins = <
+                       AM62X_IOPAD(0x1e8, PIN_INPUT_PULLUP, 0) /* (B17) I2C1_SCL */
+                       AM62X_IOPAD(0x1ec, PIN_INPUT_PULLUP, 0) /* (A17) I2C1_SDA */
+               >;
+       };
+
+       usr_led_pins_default: usr-led-pins-default {
+               pinctrl-single,pins = <
+                       AM62X_IOPAD(0x244, PIN_OUTPUT, 7) /* (C17) MMC1_SDWP.GPIO1_49 */
+               >;
+       };
+};
+
+&wkup_uart0 {
+       /* WKUP UART0 is used by DM firmware */
+       status = "reserved";
+};
+
+&mcu_uart0 {
+       status = "disabled";
+};
+
+&main_uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&main_uart0_pins_default>;
+};
+
+&main_uart1 {
+       /* Main UART1 is used by TIFS firmware */
+       status = "reserved";
+};
+
+&main_uart2 {
+       status = "disabled";
+};
+
+&main_uart3 {
+       status = "disabled";
+};
+
+&main_uart4 {
+       status = "disabled";
+};
+
+&main_uart5 {
+       status = "disabled";
+};
+
+&main_uart6 {
+       status = "disabled";
+};
+
+&mcu_i2c0 {
+       status = "disabled";
+};
+
+&wkup_i2c0 {
+       status = "disabled";
+};
+
+&main_i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&main_i2c0_pins_default>;
+       clock-frequency = <400000>;
+};
+
+&main_i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&main_i2c1_pins_default>;
+       clock-frequency = <400000>;
+};
+
+&main_i2c2 {
+       status = "disabled";
+};
+
+&main_i2c3 {
+       status = "disabled";
+};
+
+&mailbox0_cluster0 {
+       mbox_m4_0: mbox-m4-0 {
+               ti,mbox-rx = <0 0 0>;
+               ti,mbox-tx = <1 0 0>;
+       };
+};
diff --git a/arch/arm64/boot/dts/ti/k3-am625.dtsi b/arch/arm64/boot/dts/ti/k3-am625.dtsi
new file mode 100644 (file)
index 0000000..887f31c
--- /dev/null
@@ -0,0 +1,103 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for AM625 SoC family in Quad core configuration
+ *
+ * TRM: https://www.ti.com/lit/pdf/spruiv7
+ *
+ * Copyright (C) 2020-2022 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+/dts-v1/;
+
+#include "k3-am62.dtsi"
+
+/ {
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu-map {
+                       cluster0: cluster0 {
+                               core0 {
+                                       cpu = <&cpu0>;
+                               };
+
+                               core1 {
+                                       cpu = <&cpu1>;
+                               };
+
+                               core2 {
+                                       cpu = <&cpu2>;
+                               };
+
+                               core3 {
+                                       cpu = <&cpu3>;
+                               };
+                       };
+               };
+
+               cpu0: cpu@0 {
+                       compatible = "arm,cortex-a53";
+                       reg = <0x000>;
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       i-cache-size = <0x8000>;
+                       i-cache-line-size = <64>;
+                       i-cache-sets = <256>;
+                       d-cache-size = <0x8000>;
+                       d-cache-line-size = <64>;
+                       d-cache-sets = <128>;
+                       next-level-cache = <&L2_0>;
+               };
+
+               cpu1: cpu@1 {
+                       compatible = "arm,cortex-a53";
+                       reg = <0x001>;
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       i-cache-size = <0x8000>;
+                       i-cache-line-size = <64>;
+                       i-cache-sets = <256>;
+                       d-cache-size = <0x8000>;
+                       d-cache-line-size = <64>;
+                       d-cache-sets = <128>;
+                       next-level-cache = <&L2_0>;
+               };
+
+               cpu2: cpu@2 {
+                       compatible = "arm,cortex-a53";
+                       reg = <0x002>;
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       i-cache-size = <0x8000>;
+                       i-cache-line-size = <64>;
+                       i-cache-sets = <256>;
+                       d-cache-size = <0x8000>;
+                       d-cache-line-size = <64>;
+                       d-cache-sets = <128>;
+                       next-level-cache = <&L2_0>;
+               };
+
+               cpu3: cpu@3 {
+                       compatible = "arm,cortex-a53";
+                       reg = <0x003>;
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       i-cache-size = <0x8000>;
+                       i-cache-line-size = <64>;
+                       i-cache-sets = <256>;
+                       d-cache-size = <0x8000>;
+                       d-cache-line-size = <64>;
+                       d-cache-sets = <128>;
+                       next-level-cache = <&L2_0>;
+               };
+       };
+
+       L2_0: l2-cache0 {
+               compatible = "cache";
+               cache-level = <2>;
+               cache-size = <0x40000>;
+               cache-line-size = <64>;
+               cache-sets = <512>;
+       };
+};
index 012011d..f64b368 100644 (file)
                #interrupt-cells = <3>;
                interrupt-controller;
                reg = <0x00 0x01800000 0x00 0x10000>,   /* GICD */
-                     <0x00 0x01840000 0x00 0xC0000>;   /* GICR */
+                     <0x00 0x01840000 0x00 0xC0000>,   /* GICR */
+                     <0x01 0x00000000 0x00 0x2000>,    /* GICC */
+                     <0x01 0x00010000 0x00 0x1000>,    /* GICH */
+                     <0x01 0x00020000 0x00 0x2000>;    /* GICV */
                /*
                 * vcpumntirq:
                 * virtual CPU interface maintenance interrupt
                clock-names = "fck";
        };
 
+       main_rti0: watchdog@e000000 {
+                       compatible = "ti,j7-rti-wdt";
+                       reg = <0x00 0xe000000 0x00 0x100>;
+                       clocks = <&k3_clks 125 0>;
+                       power-domains = <&k3_pds 125 TI_SCI_PD_EXCLUSIVE>;
+                       assigned-clocks = <&k3_clks 125 0>;
+                       assigned-clock-parents = <&k3_clks 125 2>;
+       };
+
+       main_rti1: watchdog@e010000 {
+                       compatible = "ti,j7-rti-wdt";
+                       reg = <0x00 0xe010000 0x00 0x100>;
+                       clocks = <&k3_clks 126 0>;
+                       power-domains = <&k3_pds 126 TI_SCI_PD_EXCLUSIVE>;
+                       assigned-clocks = <&k3_clks 126 0>;
+                       assigned-clock-parents = <&k3_clks 126 2>;
+       };
+
        icssg0: icssg@30000000 {
                compatible = "ti,am642-icssg";
                reg = <0x00 0x30000000 0x00 0x80000>;
index 1209747..016dd85 100644 (file)
                #address-cells = <2>;
                #size-cells = <2>;
                ranges = <0x00 0x000f4000 0x00 0x000f4000 0x00 0x000002d0>, /* PINCTRL */
+                        <0x00 0x00420000 0x00 0x00420000 0x00 0x00001000>, /* ESM0 */
                         <0x00 0x00600000 0x00 0x00600000 0x00 0x00001100>, /* GPIO */
                         <0x00 0x00a40000 0x00 0x00a40000 0x00 0x00000800>, /* Timesync router */
                         <0x00 0x01000000 0x00 0x01000000 0x00 0x02330400>, /* First peripheral window */
                         <0x00 0x08000000 0x00 0x08000000 0x00 0x00200000>, /* Main CPSW */
                         <0x00 0x0d000000 0x00 0x0d000000 0x00 0x00800000>, /* PCIE_CORE */
+                        <0x00 0x0e000000 0x00 0x0e000000 0x00 0x00000100>, /* Main RTI0 */
+                        <0x00 0x0e010000 0x00 0x0e010000 0x00 0x00000100>, /* Main RTI1 */
                         <0x00 0x0f000000 0x00 0x0f000000 0x00 0x00c44200>, /* Second peripheral window */
                         <0x00 0x20000000 0x00 0x20000000 0x00 0x0a008000>, /* Third peripheral window */
                         <0x00 0x30000000 0x00 0x30000000 0x00 0x000bc100>, /* ICSSG0/1 */
@@ -87,6 +90,7 @@
                         <0x00 0x68000000 0x00 0x68000000 0x00 0x08000000>, /* PCIe DAT0 */
                         <0x00 0x70000000 0x00 0x70000000 0x00 0x00200000>, /* OC SRAM */
                         <0x00 0x78000000 0x00 0x78000000 0x00 0x00800000>, /* Main R5FSS */
+                        <0x01 0x00000000 0x01 0x00000000 0x00 0x00310000>, /* A53 PERIPHBASE */
                         <0x06 0x00000000 0x06 0x00000000 0x01 0x00000000>, /* PCIe DAT1 */
                         <0x05 0x00000000 0x05 0x00000000 0x01 0x00000000>, /* FSS0 DAT3 */
 
index e94ae17..8e7893e 100644 (file)
        pinctrl-names = "default";
        pinctrl-0 = <&ospi0_pins_default>;
 
-       flash@0{
+       flash@0 {
                compatible = "jedec,spi-nor";
                reg = <0x0>;
                spi-tx-bus-width = <8>;
                cdns,tchsh-ns = <60>;
                cdns,tslch-ns = <60>;
                cdns,read-delay = <4>;
-               #address-cells = <1>;
-               #size-cells = <1>;
        };
 };
 
index a9785be..1d7db8b 100644 (file)
        pinctrl-names = "default";
        pinctrl-0 = <&ospi0_pins_default>;
 
-       flash@0{
+       flash@0 {
                compatible = "jedec,spi-nor";
                reg = <0x0>;
                spi-tx-bus-width = <8>;
                cdns,tchsh-ns = <60>;
                cdns,tslch-ns = <60>;
                cdns,read-delay = <4>;
-               #address-cells = <1>;
-               #size-cells = <1>;
        };
 };
 
index 3079eae..6e41f2f 100644 (file)
                cdns,tchsh-ns = <60>;
                cdns,tslch-ns = <60>;
                cdns,read-delay = <2>;
-               #address-cells = <1>;
-               #size-cells = <1>;
        };
 };
 
index ce8bb4a..e749343 100644 (file)
                #interrupt-cells = <3>;
                interrupt-controller;
                reg = <0x00 0x01800000 0x00 0x10000>,   /* GICD */
-                     <0x00 0x01880000 0x00 0x90000>;   /* GICR */
+                     <0x00 0x01880000 0x00 0x90000>,   /* GICR */
+                     <0x00 0x6f000000 0x00 0x2000>,    /* GICC */
+                     <0x00 0x6f010000 0x00 0x1000>,    /* GICH */
+                     <0x00 0x6f020000 0x00 0x2000>;    /* GICV */
                /*
                 * vcpumntirq:
                 * virtual CPU interface maintenance interrupt
index a58a39f..c538a0b 100644 (file)
@@ -86,6 +86,7 @@
                         <0x00 0x46000000 0x00 0x46000000 0x00 0x00200000>,
                         <0x00 0x47000000 0x00 0x47000000 0x00 0x00068400>,
                         <0x00 0x50000000 0x00 0x50000000 0x00 0x8000000>,
+                        <0x00 0x6f000000 0x00 0x6f000000 0x00 0x00310000>, /* A53 PERIPHBASE */
                         <0x00 0x70000000 0x00 0x70000000 0x00 0x200000>,
                         <0x05 0x00000000 0x05 0x00000000 0x01 0x0000000>,
                         <0x07 0x00000000 0x07 0x00000000 0x01 0x0000000>;
index 9043f91..57497cb 100644 (file)
        #size-cells= <0>;
        ti,pindir-d0-out-d1-in;
 
-       flash@0{
+       flash@0 {
                compatible = "jedec,spi-nor";
                reg = <0x0>;
                spi-tx-bus-width = <1>;
                spi-rx-bus-width = <1>;
                spi-max-frequency = <48000000>;
-               #address-cells = <1>;
-               #size-cells= <1>;
        };
 };
 
        pinctrl-names = "default";
        pinctrl-0 = <&mcu_fss0_ospi0_pins_default>;
 
-       flash@0{
+       flash@0 {
                compatible = "jedec,spi-nor";
                reg = <0x0>;
                spi-tx-bus-width = <8>;
                cdns,tchsh-ns = <60>;
                cdns,tslch-ns = <60>;
                cdns,read-delay = <0>;
-               #address-cells = <1>;
-               #size-cells = <1>;
        };
 };
 
index 05a627a..16684a2 100644 (file)
                #interrupt-cells = <3>;
                interrupt-controller;
                reg = <0x00 0x01800000 0x00 0x10000>,   /* GICD */
-                     <0x00 0x01900000 0x00 0x100000>;  /* GICR */
+                     <0x00 0x01900000 0x00 0x100000>,  /* GICR */
+                     <0x00 0x6f000000 0x00 0x2000>,    /* GICC */
+                     <0x00 0x6f010000 0x00 0x1000>,    /* GICH */
+                     <0x00 0x6f020000 0x00 0x2000>;    /* GICV */
 
                /* vcpumntirq: virtual CPU interface maintenance interrupt */
                interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;
index 3472444..2d615c3 100644 (file)
        pinctrl-names = "default";
        pinctrl-0 = <&mcu_fss0_ospi0_pins_default>;
 
-       flash@0{
+       flash@0 {
                compatible = "jedec,spi-nor";
                reg = <0x0>;
                spi-tx-bus-width = <8>;
                cdns,tchsh-ns = <60>;
                cdns,tslch-ns = <60>;
                cdns,read-delay = <4>;
-               #address-cells = <1>;
-               #size-cells = <1>;
        };
 };
index 64fef4e..b6da045 100644 (file)
                         <0x00 0x00a40000 0x00 0x00a40000 0x00 0x00000800>, /* timesync router */
                         <0x00 0x01000000 0x00 0x01000000 0x00 0x0d000000>, /* Most peripherals */
                         <0x00 0x30000000 0x00 0x30000000 0x00 0x0c400000>, /* MAIN NAVSS */
+                        <0x00 0x6f000000 0x00 0x6f000000 0x00 0x00310000>, /* A72 PERIPHBASE */
                         <0x00 0x70000000 0x00 0x70000000 0x00 0x00800000>, /* MSMC RAM */
                         <0x00 0x18000000 0x00 0x18000000 0x00 0x08000000>, /* PCIe1 DAT0 */
                         <0x41 0x00000000 0x41 0x00000000 0x01 0x00000000>, /* PCIe1 DAT1 */
index 2d75969..f5ca8e2 100644 (file)
        pinctrl-names = "default";
        pinctrl-0 = <&mcu_fss0_ospi1_pins_default>;
 
-       flash@0{
+       flash@0 {
                compatible = "jedec,spi-nor";
                reg = <0x0>;
                spi-tx-bus-width = <1>;
                cdns,tchsh-ns = <60>;
                cdns,tslch-ns = <60>;
                cdns,read-delay = <2>;
-               #address-cells = <1>;
-               #size-cells = <1>;
        };
 };
 
index 5998612..db06699 100644 (file)
                #interrupt-cells = <3>;
                interrupt-controller;
                reg = <0x00 0x01800000 0x00 0x10000>,   /* GICD */
-                     <0x00 0x01900000 0x00 0x100000>;  /* GICR */
+                     <0x00 0x01900000 0x00 0x100000>,  /* GICR */
+                     <0x00 0x6f000000 0x00 0x2000>,    /* GICC */
+                     <0x00 0x6f010000 0x00 0x1000>,    /* GICH */
+                     <0x00 0x6f020000 0x00 0x2000>;    /* GICV */
 
                /* vcpumntirq: virtual CPU interface maintenance interrupt */
                interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;
index b726310..f25d851 100644 (file)
                cdns,tchsh-ns = <60>;
                cdns,tslch-ns = <60>;
                cdns,read-delay = <4>;
-               #address-cells = <1>;
-               #size-cells = <1>;
        };
 };
 
index 2fee290..e363352 100644 (file)
        pinctrl-names = "default";
        pinctrl-0 = <&mcu_fss0_ospi0_pins_default>;
 
-       flash@0{
+       flash@0 {
                compatible = "jedec,spi-nor";
                reg = <0x0>;
                spi-tx-bus-width = <8>;
                cdns,tchsh-ns = <60>;
                cdns,tslch-ns = <60>;
                cdns,read-delay = <0>;
-               #address-cells = <1>;
-               #size-cells = <1>;
        };
 };
 
index 4a3872f..0e23886 100644 (file)
                         <0x00 0x0e000000 0x00 0x0e000000 0x00 0x01800000>, /* PCIe Core*/
                         <0x00 0x10000000 0x00 0x10000000 0x00 0x10000000>, /* PCIe DAT */
                         <0x00 0x64800000 0x00 0x64800000 0x00 0x00800000>, /* C71 */
+                        <0x00 0x6f000000 0x00 0x6f000000 0x00 0x00310000>, /* A72 PERIPHBASE */
                         <0x44 0x00000000 0x44 0x00000000 0x00 0x08000000>, /* PCIe2 DAT */
                         <0x44 0x10000000 0x44 0x10000000 0x00 0x08000000>, /* PCIe3 DAT */
                         <0x4d 0x80800000 0x4d 0x80800000 0x00 0x00800000>, /* C66_0 */
index a5a24f9..b210cc0 100644 (file)
        model = "Texas Instruments J721S2 EVM";
 
        chosen {
-               stdout-path = "serial10:115200n8";
-               bootargs = "console=ttyS10,115200n8 earlycon=ns16550a,mmio32,2880000";
+               stdout-path = "serial2:115200n8";
+               bootargs = "console=ttyS2,115200n8 earlycon=ns16550a,mmio32,2880000";
+       };
+
+       aliases {
+               serial1 = &mcu_uart0;
+               serial2 = &main_uart8;
+               mmc0 = &main_sdhci0;
+               mmc1 = &main_sdhci1;
+               can0 = &main_mcan16;
+               can1 = &mcu_mcan0;
+               can2 = &mcu_mcan1;
        };
 
        evm_12v0: fixedregulator-evm12v0 {
index b04db1d..be7f392 100644 (file)
                #interrupt-cells = <3>;
                interrupt-controller;
                reg = <0x00 0x01800000 0x00 0x200000>, /* GICD */
-                     <0x00 0x01900000 0x00 0x100000>; /* GICR */
+                     <0x00 0x01900000 0x00 0x100000>, /* GICR */
+                     <0x00 0x6f000000 0x00 0x2000>,   /* GICC */
+                     <0x00 0x6f010000 0x00 0x1000>,   /* GICH */
+                     <0x00 0x6f020000 0x00 0x2000>;   /* GICV */
 
                /* vcpumntirq: virtual CPU interface maintenance interrupt */
                interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;
index 7521963..6c5c02e 100644 (file)
                reg = <0x00 0x42110000 0x00 0x100>;
                gpio-controller;
                #gpio-cells = <2>;
-               interrupt-parent = <&main_gpio_intr>;
+               interrupt-parent = <&wkup_gpio_intr>;
                interrupts = <103>, <104>, <105>, <106>, <107>, <108>;
                interrupt-controller;
                #interrupt-cells = <2>;
                reg = <0x00 0x42100000 0x00 0x100>;
                gpio-controller;
                #gpio-cells = <2>;
-               interrupt-parent = <&main_gpio_intr>;
+               interrupt-parent = <&wkup_gpio_intr>;
                interrupts = <112>, <113>, <114>, <115>, <116>, <117>;
                interrupt-controller;
                #interrupt-cells = <2>;
index 80d3cae..7b930a8 100644 (file)
        #address-cells = <2>;
        #size-cells = <2>;
 
-       aliases {
-               serial0 = &wkup_uart0;
-               serial1 = &mcu_uart0;
-               serial2 = &main_uart0;
-               serial3 = &main_uart1;
-               serial4 = &main_uart2;
-               serial5 = &main_uart3;
-               serial6 = &main_uart4;
-               serial7 = &main_uart5;
-               serial8 = &main_uart6;
-               serial9 = &main_uart7;
-               serial10 = &main_uart8;
-               serial11 = &main_uart9;
-               mmc0 = &main_sdhci0;
-               mmc1 = &main_sdhci1;
-               can0 = &main_mcan16;
-               can1 = &mcu_mcan0;
-               can2 = &mcu_mcan1;
-               can3 = &main_mcan3;
-               can4 = &main_mcan5;
-       };
-
        chosen { };
 
        cpus {
                         <0x00 0x18000000 0x00 0x18000000 0x00 0x08000000>, /* PCIe1 DAT0 */
                         <0x00 0x64800000 0x00 0x64800000 0x00 0x0070c000>, /* C71_1 */
                         <0x00 0x65800000 0x00 0x65800000 0x00 0x0070c000>, /* C71_2 */
+                        <0x00 0x6f000000 0x00 0x6f000000 0x00 0x00310000>, /* A72 PERIPHBASE */
                         <0x00 0x70000000 0x00 0x70000000 0x00 0x00400000>, /* MSMC RAM */
                         <0x00 0x30000000 0x00 0x30000000 0x00 0x0c400000>, /* MAIN NAVSS */
                         <0x41 0x00000000 0x41 0x00000000 0x01 0x00000000>, /* PCIe1 DAT1 */
index 30516dc..415fb3a 100644 (file)
@@ -54,6 +54,7 @@ CONFIG_ARCH_SEATTLE=y
 CONFIG_ARCH_INTEL_SOCFPGA=y
 CONFIG_ARCH_SYNQUACER=y
 CONFIG_ARCH_TEGRA=y
+CONFIG_ARCH_TESLA_FSD=y
 CONFIG_ARCH_SPRD=y
 CONFIG_ARCH_THUNDER=y
 CONFIG_ARCH_THUNDER2=y
index 19b8441..999b914 100644 (file)
@@ -73,7 +73,9 @@
 #define ARM_CPU_PART_CORTEX_A76                0xD0B
 #define ARM_CPU_PART_NEOVERSE_N1       0xD0C
 #define ARM_CPU_PART_CORTEX_A77                0xD0D
+#define ARM_CPU_PART_CORTEX_A510       0xD46
 #define ARM_CPU_PART_CORTEX_A710       0xD47
+#define ARM_CPU_PART_CORTEX_X2         0xD48
 #define ARM_CPU_PART_NEOVERSE_N2       0xD49
 
 #define APM_CPU_PART_POTENZA           0x000
 #define MIDR_CORTEX_A76        MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A76)
 #define MIDR_NEOVERSE_N1 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_N1)
 #define MIDR_CORTEX_A77        MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A77)
+#define MIDR_CORTEX_A510 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A510)
 #define MIDR_CORTEX_A710 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A710)
+#define MIDR_CORTEX_X2 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X2)
 #define MIDR_NEOVERSE_N2 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_N2)
 #define MIDR_THUNDERX  MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX)
 #define MIDR_THUNDERX_81XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_81XX)
index 9e1c1ae..b217941 100644 (file)
@@ -347,6 +347,7 @@ static const struct midr_range trbe_overwrite_fill_mode_cpus[] = {
 #endif
 #ifdef CONFIG_ARM64_ERRATUM_2119858
        MIDR_ALL_VERSIONS(MIDR_CORTEX_A710),
+       MIDR_RANGE(MIDR_CORTEX_X2, 0, 0, 2, 0),
 #endif
        {},
 };
@@ -371,6 +372,7 @@ static struct midr_range trbe_write_out_of_range_cpus[] = {
 #endif
 #ifdef CONFIG_ARM64_ERRATUM_2224489
        MIDR_ALL_VERSIONS(MIDR_CORTEX_A710),
+       MIDR_RANGE(MIDR_CORTEX_X2, 0, 0, 2, 0),
 #endif
        {},
 };
@@ -598,6 +600,41 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
                CAP_MIDR_RANGE_LIST(trbe_write_out_of_range_cpus),
        },
 #endif
+#ifdef CONFIG_ARM64_ERRATUM_2077057
+       {
+               .desc = "ARM erratum 2077057",
+               .capability = ARM64_WORKAROUND_2077057,
+               .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
+               ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 2),
+       },
+#endif
+#ifdef CONFIG_ARM64_ERRATUM_2064142
+       {
+               .desc = "ARM erratum 2064142",
+               .capability = ARM64_WORKAROUND_2064142,
+
+               /* Cortex-A510 r0p0 - r0p2 */
+               ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 2)
+       },
+#endif
+#ifdef CONFIG_ARM64_ERRATUM_2038923
+       {
+               .desc = "ARM erratum 2038923",
+               .capability = ARM64_WORKAROUND_2038923,
+
+               /* Cortex-A510 r0p0 - r0p2 */
+               ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 2)
+       },
+#endif
+#ifdef CONFIG_ARM64_ERRATUM_1902691
+       {
+               .desc = "ARM erratum 1902691",
+               .capability = ARM64_WORKAROUND_1902691,
+
+               /* Cortex-A510 r0p0 - r0p1 */
+               ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 1)
+       },
+#endif
        {
        }
 };
index a46ab3b..e5f23da 100644 (file)
@@ -1646,6 +1646,9 @@ static bool cpu_has_broken_dbm(void)
                /* Kryo4xx Silver (rdpe => r1p0) */
                MIDR_REV(MIDR_QCOM_KRYO_4XX_SILVER, 0xd, 0xe),
 #endif
+#ifdef CONFIG_ARM64_ERRATUM_2051678
+               MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 2),
+#endif
                {},
        };
 
index 0fb58fe..e4103e0 100644 (file)
@@ -33,8 +33,8 @@
  */
 
 
-static void start_backtrace(struct stackframe *frame, unsigned long fp,
-                           unsigned long pc)
+static notrace void start_backtrace(struct stackframe *frame, unsigned long fp,
+                                   unsigned long pc)
 {
        frame->fp = fp;
        frame->pc = pc;
@@ -55,6 +55,7 @@ static void start_backtrace(struct stackframe *frame, unsigned long fp,
        frame->prev_fp = 0;
        frame->prev_type = STACK_TYPE_UNKNOWN;
 }
+NOKPROBE_SYMBOL(start_backtrace);
 
 /*
  * Unwind from one frame record (A) to the next frame record (B).
index 6081349..172452f 100644 (file)
@@ -29,8 +29,11 @@ ldflags-y := -shared -soname=linux-vdso.so.1 --hash-style=sysv       \
 ccflags-y := -fno-common -fno-builtin -fno-stack-protector -ffixed-x18
 ccflags-y += -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO
 
+# -Wmissing-prototypes and -Wmissing-declarations are removed from
+# the CFLAGS of vgettimeofday.c to make possible to build the
+# kernel with CONFIG_WERROR enabled.
 CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os $(CC_FLAGS_SCS) $(GCC_PLUGINS_CFLAGS) \
-                               $(CC_FLAGS_LTO)
+                               $(CC_FLAGS_LTO) -Wmissing-prototypes -Wmissing-declarations
 KASAN_SANITIZE                 := n
 KCSAN_SANITIZE                 := n
 UBSAN_SANITIZE                 := n
index a4a0063..ecc5958 100644 (file)
@@ -797,6 +797,24 @@ static bool kvm_vcpu_exit_request(struct kvm_vcpu *vcpu, int *ret)
                        xfer_to_guest_mode_work_pending();
 }
 
+/*
+ * Actually run the vCPU, entering an RCU extended quiescent state (EQS) while
+ * the vCPU is running.
+ *
+ * This must be noinstr as instrumentation may make use of RCU, and this is not
+ * safe during the EQS.
+ */
+static int noinstr kvm_arm_vcpu_enter_exit(struct kvm_vcpu *vcpu)
+{
+       int ret;
+
+       guest_state_enter_irqoff();
+       ret = kvm_call_hyp_ret(__kvm_vcpu_run, vcpu);
+       guest_state_exit_irqoff();
+
+       return ret;
+}
+
 /**
  * kvm_arch_vcpu_ioctl_run - the main VCPU run function to execute guest code
  * @vcpu:      The VCPU pointer
@@ -881,9 +899,9 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
                 * Enter the guest
                 */
                trace_kvm_entry(*vcpu_pc(vcpu));
-               guest_enter_irqoff();
+               guest_timing_enter_irqoff();
 
-               ret = kvm_call_hyp_ret(__kvm_vcpu_run, vcpu);
+               ret = kvm_arm_vcpu_enter_exit(vcpu);
 
                vcpu->mode = OUTSIDE_GUEST_MODE;
                vcpu->stat.exits++;
@@ -918,26 +936,23 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
                kvm_arch_vcpu_ctxsync_fp(vcpu);
 
                /*
-                * We may have taken a host interrupt in HYP mode (ie
-                * while executing the guest). This interrupt is still
-                * pending, as we haven't serviced it yet!
+                * We must ensure that any pending interrupts are taken before
+                * we exit guest timing so that timer ticks are accounted as
+                * guest time. Transiently unmask interrupts so that any
+                * pending interrupts are taken.
                 *
-                * We're now back in SVC mode, with interrupts
-                * disabled.  Enabling the interrupts now will have
-                * the effect of taking the interrupt again, in SVC
-                * mode this time.
+                * Per ARM DDI 0487G.b section D1.13.4, an ISB (or other
+                * context synchronization event) is necessary to ensure that
+                * pending interrupts are taken.
                 */
                local_irq_enable();
+               isb();
+               local_irq_disable();
+
+               guest_timing_exit_irqoff();
+
+               local_irq_enable();
 
-               /*
-                * We do local_irq_enable() before calling guest_exit() so
-                * that if a timer interrupt hits while running the guest we
-                * account that tick as being spent in the guest.  We enable
-                * preemption after calling guest_exit() so that if we get
-                * preempted we make sure ticks after that is not counted as
-                * guest time.
-                */
-               guest_exit();
                trace_kvm_exit(ret, kvm_vcpu_trap_get_class(vcpu), *vcpu_pc(vcpu));
 
                /* Exit types that need handling before we can be preempted */
index fd2dd26..e3140ab 100644 (file)
@@ -228,6 +228,14 @@ int handle_exit(struct kvm_vcpu *vcpu, int exception_index)
 {
        struct kvm_run *run = vcpu->run;
 
+       if (ARM_SERROR_PENDING(exception_index)) {
+               /*
+                * The SError is handled by handle_exit_early(). If the guest
+                * survives it will re-execute the original instruction.
+                */
+               return 1;
+       }
+
        exception_index = ARM_EXCEPTION_CODE(exception_index);
 
        switch (exception_index) {
index 0418399..c5d0097 100644 (file)
@@ -38,7 +38,10 @@ static inline void __vcpu_write_sys_reg(struct kvm_vcpu *vcpu, u64 val, int reg)
 
 static void __vcpu_write_spsr(struct kvm_vcpu *vcpu, u64 val)
 {
-       write_sysreg_el1(val, SYS_SPSR);
+       if (has_vhe())
+               write_sysreg_el1(val, SYS_SPSR);
+       else
+               __vcpu_sys_reg(vcpu, SPSR_EL1) = val;
 }
 
 static void __vcpu_write_spsr_abt(struct kvm_vcpu *vcpu, u64 val)
index 58e14f8..701cfb9 100644 (file)
@@ -402,6 +402,24 @@ static inline bool kvm_hyp_handle_exit(struct kvm_vcpu *vcpu, u64 *exit_code)
        return false;
 }
 
+static inline void synchronize_vcpu_pstate(struct kvm_vcpu *vcpu, u64 *exit_code)
+{
+       /*
+        * Check for the conditions of Cortex-A510's #2077057. When these occur
+        * SPSR_EL2 can't be trusted, but isn't needed either as it is
+        * unchanged from the value in vcpu_gp_regs(vcpu)->pstate.
+        * Are we single-stepping the guest, and took a PAC exception from the
+        * active-not-pending state?
+        */
+       if (cpus_have_final_cap(ARM64_WORKAROUND_2077057)               &&
+           vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP                 &&
+           *vcpu_cpsr(vcpu) & DBG_SPSR_SS                              &&
+           ESR_ELx_EC(read_sysreg_el2(SYS_ESR)) == ESR_ELx_EC_PAC)
+               write_sysreg_el2(*vcpu_cpsr(vcpu), SYS_SPSR);
+
+       vcpu->arch.ctxt.regs.pstate = read_sysreg_el2(SYS_SPSR);
+}
+
 /*
  * Return true when we were able to fixup the guest exit and should return to
  * the guest, false when we should restore the host state and return to the
@@ -413,7 +431,7 @@ static inline bool fixup_guest_exit(struct kvm_vcpu *vcpu, u64 *exit_code)
         * Save PSTATE early so that we can evaluate the vcpu mode
         * early on.
         */
-       vcpu->arch.ctxt.regs.pstate = read_sysreg_el2(SYS_SPSR);
+       synchronize_vcpu_pstate(vcpu, exit_code);
 
        /*
         * Check whether we want to repaint the state one way or
@@ -424,7 +442,8 @@ static inline bool fixup_guest_exit(struct kvm_vcpu *vcpu, u64 *exit_code)
        if (ARM_EXCEPTION_CODE(*exit_code) != ARM_EXCEPTION_IRQ)
                vcpu->arch.fault.esr_el2 = read_sysreg_el2(SYS_ESR);
 
-       if (ARM_SERROR_PENDING(*exit_code)) {
+       if (ARM_SERROR_PENDING(*exit_code) &&
+           ARM_EXCEPTION_CODE(*exit_code) != ARM_EXCEPTION_IRQ) {
                u8 esr_ec = kvm_vcpu_trap_get_class(vcpu);
 
                /*
index 844a6f0..2cb3867 100644 (file)
@@ -983,13 +983,9 @@ static int stage2_unmap_walker(u64 addr, u64 end, u32 level, kvm_pte_t *ptep,
         */
        stage2_put_pte(ptep, mmu, addr, level, mm_ops);
 
-       if (need_flush) {
-               kvm_pte_t *pte_follow = kvm_pte_follow(pte, mm_ops);
-
-               dcache_clean_inval_poc((unsigned long)pte_follow,
-                                   (unsigned long)pte_follow +
-                                           kvm_granule_size(level));
-       }
+       if (need_flush && mm_ops->dcache_clean_inval_poc)
+               mm_ops->dcache_clean_inval_poc(kvm_pte_follow(pte, mm_ops),
+                                              kvm_granule_size(level));
 
        if (childp)
                mm_ops->put_page(childp);
@@ -1151,15 +1147,13 @@ static int stage2_flush_walker(u64 addr, u64 end, u32 level, kvm_pte_t *ptep,
        struct kvm_pgtable *pgt = arg;
        struct kvm_pgtable_mm_ops *mm_ops = pgt->mm_ops;
        kvm_pte_t pte = *ptep;
-       kvm_pte_t *pte_follow;
 
        if (!kvm_pte_valid(pte) || !stage2_pte_cacheable(pgt, pte))
                return 0;
 
-       pte_follow = kvm_pte_follow(pte, mm_ops);
-       dcache_clean_inval_poc((unsigned long)pte_follow,
-                           (unsigned long)pte_follow +
-                                   kvm_granule_size(level));
+       if (mm_ops->dcache_clean_inval_poc)
+               mm_ops->dcache_clean_inval_poc(kvm_pte_follow(pte, mm_ops),
+                                              kvm_granule_size(level));
        return 0;
 }
 
index 20db2f2..4fb419f 100644 (file)
@@ -983,6 +983,9 @@ static void __vgic_v3_read_ctlr(struct kvm_vcpu *vcpu, u32 vmcr, int rt)
        val = ((vtr >> 29) & 7) << ICC_CTLR_EL1_PRI_BITS_SHIFT;
        /* IDbits */
        val |= ((vtr >> 23) & 7) << ICC_CTLR_EL1_ID_BITS_SHIFT;
+       /* SEIS */
+       if (kvm_vgic_global_state.ich_vtr_el2 & ICH_VTR_SEIS_MASK)
+               val |= BIT(ICC_CTLR_EL1_SEIS_SHIFT);
        /* A3V */
        val |= ((vtr >> 21) & 1) << ICC_CTLR_EL1_A3V_SHIFT;
        /* EOImode */
index a33d436..b549af8 100644 (file)
@@ -609,6 +609,18 @@ static int __init early_gicv4_enable(char *buf)
 }
 early_param("kvm-arm.vgic_v4_enable", early_gicv4_enable);
 
+static const struct midr_range broken_seis[] = {
+       MIDR_ALL_VERSIONS(MIDR_APPLE_M1_ICESTORM),
+       MIDR_ALL_VERSIONS(MIDR_APPLE_M1_FIRESTORM),
+       {},
+};
+
+static bool vgic_v3_broken_seis(void)
+{
+       return ((kvm_vgic_global_state.ich_vtr_el2 & ICH_VTR_SEIS_MASK) &&
+               is_midr_in_range_list(read_cpuid_id(), broken_seis));
+}
+
 /**
  * vgic_v3_probe - probe for a VGICv3 compatible interrupt controller
  * @info:      pointer to the GIC description
@@ -676,9 +688,10 @@ int vgic_v3_probe(const struct gic_kvm_info *info)
                group1_trap = true;
        }
 
-       if (kvm_vgic_global_state.ich_vtr_el2 & ICH_VTR_SEIS_MASK) {
-               kvm_info("GICv3 with locally generated SEI\n");
+       if (vgic_v3_broken_seis()) {
+               kvm_info("GICv3 with broken locally generated SEI\n");
 
+               kvm_vgic_global_state.ich_vtr_el2 &= ~ICH_VTR_SEIS_MASK;
                group0_trap = true;
                group1_trap = true;
                if (ich_vtr_el2 & ICH_VTR_TDS_MASK)
index c0181e6..4894553 100644 (file)
@@ -40,8 +40,8 @@ static bool
 ex_handler_load_unaligned_zeropad(const struct exception_table_entry *ex,
                                  struct pt_regs *regs)
 {
-       int reg_data = FIELD_GET(EX_DATA_REG_DATA, ex->type);
-       int reg_addr = FIELD_GET(EX_DATA_REG_ADDR, ex->type);
+       int reg_data = FIELD_GET(EX_DATA_REG_DATA, ex->data);
+       int reg_addr = FIELD_GET(EX_DATA_REG_ADDR, ex->data);
        unsigned long data, addr, offset;
 
        addr = pt_regs_read_reg(regs, reg_addr);
index 870c395..9c65b1e 100644 (file)
@@ -55,6 +55,10 @@ WORKAROUND_1418040
 WORKAROUND_1463225
 WORKAROUND_1508412
 WORKAROUND_1542419
+WORKAROUND_1902691
+WORKAROUND_2038923
+WORKAROUND_2064142
+WORKAROUND_2077057
 WORKAROUND_TRBE_OVERWRITE_FILL_MODE
 WORKAROUND_TSB_FLUSH_FAILURE
 WORKAROUND_TRBE_WRITE_OUT_OF_RANGE
index 7039528..a7e0157 100644 (file)
@@ -318,7 +318,7 @@ config ARCH_PROC_KCORE_TEXT
        depends on PROC_KCORE
 
 config IA64_MCA_RECOVERY
-       tristate "MCA recovery from errors other than TLB."
+       bool "MCA recovery from errors other than TLB."
 
 config IA64_PALINFO
        tristate "/proc/pal support"
index acb55a4..2bcdd7d 100644 (file)
@@ -76,5 +76,5 @@ static void pci_fixup_video(struct pci_dev *pdev)
                }
        }
 }
-DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID,
-                               PCI_CLASS_DISPLAY_VGA, 8, pci_fixup_video);
+DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_ANY_ID, PCI_ANY_ID,
+                              PCI_CLASS_DISPLAY_VGA, 8, pci_fixup_video);
index 0a515cd..25860fb 100644 (file)
@@ -74,7 +74,7 @@
 #define EXC(inst_reg,addr,handler)             \
 9:     inst_reg, addr;                         \
        .section __ex_table,"a";                \
-       PTR     9b, handler;                    \
+       PTR_WD  9b, handler;                    \
        .previous
 
 /*
index 6ffdd4b..336ac9b 100644 (file)
@@ -285,7 +285,7 @@ symbol              =       value
 
 #define PTR_SCALESHIFT 2
 
-#define PTR            .word
+#define PTR_WD         .word
 #define PTRSIZE                4
 #define PTRLOG         2
 #endif
@@ -310,7 +310,7 @@ symbol              =       value
 
 #define PTR_SCALESHIFT 3
 
-#define PTR            .dword
+#define PTR_WD         .dword
 #define PTRSIZE                8
 #define PTRLOG         3
 #endif
index b463f2a..db497a8 100644 (file)
@@ -32,7 +32,7 @@ do {                                                  \
                ".previous\n"                           \
                                                        \
                ".section\t__ex_table,\"a\"\n\t"        \
-               STR(PTR) "\t1b, 3b\n\t"                 \
+               STR(PTR_WD) "\t1b, 3b\n\t"              \
                ".previous\n"                           \
                                                        \
                : [tmp_dst] "=&r" (dst), [tmp_err] "=r" (error)\
@@ -54,7 +54,7 @@ do {                                          \
                ".previous\n"                   \
                                                \
                ".section\t__ex_table,\"a\"\n\t"\
-               STR(PTR) "\t1b, 3b\n\t"         \
+               STR(PTR_WD) "\t1b, 3b\n\t"      \
                ".previous\n"                   \
                                                \
                : [tmp_err] "=r" (error)        \
index af37885..431a1c9 100644 (file)
@@ -119,7 +119,7 @@ static inline void flush_scache_line(unsigned long addr)
        "       j       2b                      \n"             \
        "       .previous                       \n"             \
        "       .section __ex_table,\"a\"       \n"             \
-       "       "STR(PTR)" 1b, 3b               \n"             \
+       "       "STR(PTR_WD)" 1b, 3b            \n"             \
        "       .previous"                                      \
        : "+r" (__err)                                          \
        : "i" (op), "r" (addr), "i" (-EFAULT));                 \
@@ -142,7 +142,7 @@ static inline void flush_scache_line(unsigned long addr)
        "       j       2b                      \n"             \
        "       .previous                       \n"             \
        "       .section __ex_table,\"a\"       \n"             \
-       "       "STR(PTR)" 1b, 3b               \n"             \
+       "       "STR(PTR_WD)" 1b, 3b            \n"             \
        "       .previous"                                      \
        : "+r" (__err)                                          \
        : "i" (op), "r" (addr), "i" (-EFAULT));                 \
index 2022b18..9af0f4d 100644 (file)
@@ -20,8 +20,8 @@ do {                                                \
                "j\t3b\n\t"                         \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 4b\n\t"               \
-               STR(PTR)"\t2b, 4b\n\t"               \
+               STR(PTR_WD)"\t1b, 4b\n\t"           \
+               STR(PTR_WD)"\t2b, 4b\n\t"           \
                ".previous"                         \
                : "=&r" (value), "=r" (res)         \
                : "r" (addr), "i" (-EFAULT));       \
@@ -41,8 +41,8 @@ do {                                                \
                "j\t3b\n\t"                         \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 4b\n\t"               \
-               STR(PTR)"\t2b, 4b\n\t"               \
+               STR(PTR_WD)"\t1b, 4b\n\t"           \
+               STR(PTR_WD)"\t2b, 4b\n\t"           \
                ".previous"                         \
                : "=&r" (value), "=r" (res)         \
                : "r" (addr), "i" (-EFAULT));       \
@@ -74,10 +74,10 @@ do {                                                \
                "j\t10b\n\t"                        \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 11b\n\t"             \
-               STR(PTR)"\t2b, 11b\n\t"             \
-               STR(PTR)"\t3b, 11b\n\t"             \
-               STR(PTR)"\t4b, 11b\n\t"             \
+               STR(PTR_WD)"\t1b, 11b\n\t"          \
+               STR(PTR_WD)"\t2b, 11b\n\t"          \
+               STR(PTR_WD)"\t3b, 11b\n\t"          \
+               STR(PTR_WD)"\t4b, 11b\n\t"          \
                ".previous"                         \
                : "=&r" (value), "=r" (res)         \
                : "r" (addr), "i" (-EFAULT));       \
@@ -102,8 +102,8 @@ do {                                                \
                "j\t3b\n\t"                         \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 4b\n\t"               \
-               STR(PTR)"\t2b, 4b\n\t"               \
+               STR(PTR_WD)"\t1b, 4b\n\t"           \
+               STR(PTR_WD)"\t2b, 4b\n\t"           \
                ".previous"                         \
                : "=&r" (value), "=r" (res)         \
                : "r" (addr), "i" (-EFAULT));       \
@@ -125,8 +125,8 @@ do {                                                \
                "j\t3b\n\t"                         \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 4b\n\t"               \
-               STR(PTR)"\t2b, 4b\n\t"               \
+               STR(PTR_WD)"\t1b, 4b\n\t"           \
+               STR(PTR_WD)"\t2b, 4b\n\t"           \
                ".previous"                         \
                : "=&r" (value), "=r" (res)         \
                : "r" (addr), "i" (-EFAULT));       \
@@ -145,8 +145,8 @@ do {                                                \
                "j\t3b\n\t"                         \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 4b\n\t"               \
-               STR(PTR)"\t2b, 4b\n\t"               \
+               STR(PTR_WD)"\t1b, 4b\n\t"           \
+               STR(PTR_WD)"\t2b, 4b\n\t"           \
                ".previous"                         \
                : "=&r" (value), "=r" (res)         \
                : "r" (addr), "i" (-EFAULT));       \
@@ -178,10 +178,10 @@ do {                                                \
                "j\t10b\n\t"                        \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 11b\n\t"             \
-               STR(PTR)"\t2b, 11b\n\t"             \
-               STR(PTR)"\t3b, 11b\n\t"             \
-               STR(PTR)"\t4b, 11b\n\t"             \
+               STR(PTR_WD)"\t1b, 11b\n\t"          \
+               STR(PTR_WD)"\t2b, 11b\n\t"          \
+               STR(PTR_WD)"\t3b, 11b\n\t"          \
+               STR(PTR_WD)"\t4b, 11b\n\t"          \
                ".previous"                         \
                : "=&r" (value), "=r" (res)         \
                : "r" (addr), "i" (-EFAULT));       \
@@ -223,14 +223,14 @@ do {                                                \
                "j\t10b\n\t"                        \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 11b\n\t"             \
-               STR(PTR)"\t2b, 11b\n\t"             \
-               STR(PTR)"\t3b, 11b\n\t"             \
-               STR(PTR)"\t4b, 11b\n\t"             \
-               STR(PTR)"\t5b, 11b\n\t"             \
-               STR(PTR)"\t6b, 11b\n\t"             \
-               STR(PTR)"\t7b, 11b\n\t"             \
-               STR(PTR)"\t8b, 11b\n\t"             \
+               STR(PTR_WD)"\t1b, 11b\n\t"          \
+               STR(PTR_WD)"\t2b, 11b\n\t"          \
+               STR(PTR_WD)"\t3b, 11b\n\t"          \
+               STR(PTR_WD)"\t4b, 11b\n\t"          \
+               STR(PTR_WD)"\t5b, 11b\n\t"          \
+               STR(PTR_WD)"\t6b, 11b\n\t"          \
+               STR(PTR_WD)"\t7b, 11b\n\t"          \
+               STR(PTR_WD)"\t8b, 11b\n\t"          \
                ".previous"                         \
                : "=&r" (value), "=r" (res)         \
                : "r" (addr), "i" (-EFAULT));       \
@@ -255,8 +255,8 @@ do {                                                \
                "j\t3b\n\t"                         \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 4b\n\t"              \
-               STR(PTR)"\t2b, 4b\n\t"              \
+               STR(PTR_WD)"\t1b, 4b\n\t"           \
+               STR(PTR_WD)"\t2b, 4b\n\t"           \
                ".previous"                         \
                : "=r" (res)                        \
                : "r" (value), "r" (addr), "i" (-EFAULT));\
@@ -276,8 +276,8 @@ do {                                                \
                "j\t3b\n\t"                         \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 4b\n\t"               \
-               STR(PTR)"\t2b, 4b\n\t"               \
+               STR(PTR_WD)"\t1b, 4b\n\t"           \
+               STR(PTR_WD)"\t2b, 4b\n\t"           \
                ".previous"                         \
                : "=r" (res)                                \
                : "r" (value), "r" (addr), "i" (-EFAULT));  \
@@ -296,8 +296,8 @@ do {                                                \
                "j\t3b\n\t"                         \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 4b\n\t"               \
-               STR(PTR)"\t2b, 4b\n\t"               \
+               STR(PTR_WD)"\t1b, 4b\n\t"           \
+               STR(PTR_WD)"\t2b, 4b\n\t"           \
                ".previous"                         \
                : "=r" (res)                                \
                : "r" (value), "r" (addr), "i" (-EFAULT));  \
@@ -325,10 +325,10 @@ do {                                                \
                "j\t10b\n\t"                        \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 11b\n\t"             \
-               STR(PTR)"\t2b, 11b\n\t"             \
-               STR(PTR)"\t3b, 11b\n\t"             \
-               STR(PTR)"\t4b, 11b\n\t"             \
+               STR(PTR_WD)"\t1b, 11b\n\t"          \
+               STR(PTR_WD)"\t2b, 11b\n\t"          \
+               STR(PTR_WD)"\t3b, 11b\n\t"          \
+               STR(PTR_WD)"\t4b, 11b\n\t"          \
                ".previous"                         \
                : "=&r" (res)                               \
                : "r" (value), "r" (addr), "i" (-EFAULT)    \
@@ -365,14 +365,14 @@ do {                                                \
                "j\t10b\n\t"                        \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 11b\n\t"             \
-               STR(PTR)"\t2b, 11b\n\t"             \
-               STR(PTR)"\t3b, 11b\n\t"             \
-               STR(PTR)"\t4b, 11b\n\t"             \
-               STR(PTR)"\t5b, 11b\n\t"             \
-               STR(PTR)"\t6b, 11b\n\t"             \
-               STR(PTR)"\t7b, 11b\n\t"             \
-               STR(PTR)"\t8b, 11b\n\t"             \
+               STR(PTR_WD)"\t1b, 11b\n\t"          \
+               STR(PTR_WD)"\t2b, 11b\n\t"          \
+               STR(PTR_WD)"\t3b, 11b\n\t"          \
+               STR(PTR_WD)"\t4b, 11b\n\t"          \
+               STR(PTR_WD)"\t5b, 11b\n\t"          \
+               STR(PTR_WD)"\t6b, 11b\n\t"          \
+               STR(PTR_WD)"\t7b, 11b\n\t"          \
+               STR(PTR_WD)"\t8b, 11b\n\t"          \
                ".previous"                         \
                : "=&r" (res)                               \
                : "r" (value), "r" (addr), "i" (-EFAULT)    \
@@ -398,8 +398,8 @@ do {                                                \
                "j\t3b\n\t"                         \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 4b\n\t"               \
-               STR(PTR)"\t2b, 4b\n\t"               \
+               STR(PTR_WD)"\t1b, 4b\n\t"           \
+               STR(PTR_WD)"\t2b, 4b\n\t"           \
                ".previous"                         \
                : "=&r" (value), "=r" (res)         \
                : "r" (addr), "i" (-EFAULT));       \
@@ -419,8 +419,8 @@ do {                                                \
                "j\t3b\n\t"                         \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 4b\n\t"               \
-               STR(PTR)"\t2b, 4b\n\t"               \
+               STR(PTR_WD)"\t1b, 4b\n\t"           \
+               STR(PTR_WD)"\t2b, 4b\n\t"           \
                ".previous"                         \
                : "=&r" (value), "=r" (res)         \
                : "r" (addr), "i" (-EFAULT));       \
@@ -452,10 +452,10 @@ do {                                                \
                "j\t10b\n\t"                        \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 11b\n\t"             \
-               STR(PTR)"\t2b, 11b\n\t"             \
-               STR(PTR)"\t3b, 11b\n\t"             \
-               STR(PTR)"\t4b, 11b\n\t"             \
+               STR(PTR_WD)"\t1b, 11b\n\t"          \
+               STR(PTR_WD)"\t2b, 11b\n\t"          \
+               STR(PTR_WD)"\t3b, 11b\n\t"          \
+               STR(PTR_WD)"\t4b, 11b\n\t"          \
                ".previous"                         \
                : "=&r" (value), "=r" (res)         \
                : "r" (addr), "i" (-EFAULT));       \
@@ -481,8 +481,8 @@ do {                                                \
                "j\t3b\n\t"                         \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 4b\n\t"               \
-               STR(PTR)"\t2b, 4b\n\t"               \
+               STR(PTR_WD)"\t1b, 4b\n\t"           \
+               STR(PTR_WD)"\t2b, 4b\n\t"           \
                ".previous"                         \
                : "=&r" (value), "=r" (res)         \
                : "r" (addr), "i" (-EFAULT));       \
@@ -504,8 +504,8 @@ do {                                                \
                "j\t3b\n\t"                         \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 4b\n\t"               \
-               STR(PTR)"\t2b, 4b\n\t"               \
+               STR(PTR_WD)"\t1b, 4b\n\t"           \
+               STR(PTR_WD)"\t2b, 4b\n\t"           \
                ".previous"                         \
                : "=&r" (value), "=r" (res)         \
                : "r" (addr), "i" (-EFAULT));       \
@@ -524,8 +524,8 @@ do {                                                \
                "j\t3b\n\t"                         \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 4b\n\t"               \
-               STR(PTR)"\t2b, 4b\n\t"               \
+               STR(PTR_WD)"\t1b, 4b\n\t"           \
+               STR(PTR_WD)"\t2b, 4b\n\t"           \
                ".previous"                         \
                : "=&r" (value), "=r" (res)         \
                : "r" (addr), "i" (-EFAULT));       \
@@ -557,10 +557,10 @@ do {                                                \
                "j\t10b\n\t"                        \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 11b\n\t"             \
-               STR(PTR)"\t2b, 11b\n\t"             \
-               STR(PTR)"\t3b, 11b\n\t"             \
-               STR(PTR)"\t4b, 11b\n\t"             \
+               STR(PTR_WD)"\t1b, 11b\n\t"          \
+               STR(PTR_WD)"\t2b, 11b\n\t"          \
+               STR(PTR_WD)"\t3b, 11b\n\t"          \
+               STR(PTR_WD)"\t4b, 11b\n\t"          \
                ".previous"                         \
                : "=&r" (value), "=r" (res)         \
                : "r" (addr), "i" (-EFAULT));       \
@@ -602,14 +602,14 @@ do {                                                \
                "j\t10b\n\t"                        \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 11b\n\t"             \
-               STR(PTR)"\t2b, 11b\n\t"             \
-               STR(PTR)"\t3b, 11b\n\t"             \
-               STR(PTR)"\t4b, 11b\n\t"             \
-               STR(PTR)"\t5b, 11b\n\t"             \
-               STR(PTR)"\t6b, 11b\n\t"             \
-               STR(PTR)"\t7b, 11b\n\t"             \
-               STR(PTR)"\t8b, 11b\n\t"             \
+               STR(PTR_WD)"\t1b, 11b\n\t"          \
+               STR(PTR_WD)"\t2b, 11b\n\t"          \
+               STR(PTR_WD)"\t3b, 11b\n\t"          \
+               STR(PTR_WD)"\t4b, 11b\n\t"          \
+               STR(PTR_WD)"\t5b, 11b\n\t"          \
+               STR(PTR_WD)"\t6b, 11b\n\t"          \
+               STR(PTR_WD)"\t7b, 11b\n\t"          \
+               STR(PTR_WD)"\t8b, 11b\n\t"          \
                ".previous"                         \
                : "=&r" (value), "=r" (res)         \
                : "r" (addr), "i" (-EFAULT));       \
@@ -632,8 +632,8 @@ do {                                                 \
                "j\t3b\n\t"                         \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 4b\n\t"               \
-               STR(PTR)"\t2b, 4b\n\t"               \
+               STR(PTR_WD)"\t1b, 4b\n\t"           \
+               STR(PTR_WD)"\t2b, 4b\n\t"           \
                ".previous"                         \
                : "=r" (res)                        \
                : "r" (value), "r" (addr), "i" (-EFAULT));\
@@ -653,8 +653,8 @@ do {                                                \
                "j\t3b\n\t"                         \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 4b\n\t"               \
-               STR(PTR)"\t2b, 4b\n\t"               \
+               STR(PTR_WD)"\t1b, 4b\n\t"           \
+               STR(PTR_WD)"\t2b, 4b\n\t"           \
                ".previous"                         \
                : "=r" (res)                                \
                : "r" (value), "r" (addr), "i" (-EFAULT));  \
@@ -673,8 +673,8 @@ do {                                                \
                "j\t3b\n\t"                         \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 4b\n\t"               \
-               STR(PTR)"\t2b, 4b\n\t"               \
+               STR(PTR_WD)"\t1b, 4b\n\t"           \
+               STR(PTR_WD)"\t2b, 4b\n\t"           \
                ".previous"                         \
                : "=r" (res)                                \
                : "r" (value), "r" (addr), "i" (-EFAULT));  \
@@ -703,10 +703,10 @@ do {                                                \
                "j\t10b\n\t"                        \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 11b\n\t"             \
-               STR(PTR)"\t2b, 11b\n\t"             \
-               STR(PTR)"\t3b, 11b\n\t"             \
-               STR(PTR)"\t4b, 11b\n\t"             \
+               STR(PTR_WD)"\t1b, 11b\n\t"          \
+               STR(PTR_WD)"\t2b, 11b\n\t"          \
+               STR(PTR_WD)"\t3b, 11b\n\t"          \
+               STR(PTR_WD)"\t4b, 11b\n\t"          \
                ".previous"                         \
                : "=&r" (res)                               \
                : "r" (value), "r" (addr), "i" (-EFAULT)    \
@@ -743,14 +743,14 @@ do {                                                \
                "j\t10b\n\t"                        \
                ".previous\n\t"                     \
                ".section\t__ex_table,\"a\"\n\t"    \
-               STR(PTR)"\t1b, 11b\n\t"             \
-               STR(PTR)"\t2b, 11b\n\t"             \
-               STR(PTR)"\t3b, 11b\n\t"             \
-               STR(PTR)"\t4b, 11b\n\t"             \
-               STR(PTR)"\t5b, 11b\n\t"             \
-               STR(PTR)"\t6b, 11b\n\t"             \
-               STR(PTR)"\t7b, 11b\n\t"             \
-               STR(PTR)"\t8b, 11b\n\t"             \
+               STR(PTR_WD)"\t1b, 11b\n\t"          \
+               STR(PTR_WD)"\t2b, 11b\n\t"          \
+               STR(PTR_WD)"\t3b, 11b\n\t"          \
+               STR(PTR_WD)"\t4b, 11b\n\t"          \
+               STR(PTR_WD)"\t5b, 11b\n\t"          \
+               STR(PTR_WD)"\t6b, 11b\n\t"          \
+               STR(PTR_WD)"\t7b, 11b\n\t"          \
+               STR(PTR_WD)"\t8b, 11b\n\t"          \
                ".previous"                         \
                : "=&r" (res)                               \
                : "r" (value), "r" (addr), "i" (-EFAULT)    \
index a39ec75..750fe56 100644 (file)
@@ -1258,10 +1258,10 @@ fpu_emul:
                        "       j       10b\n"
                        "       .previous\n"
                        "       .section        __ex_table,\"a\"\n"
-                       STR(PTR) " 1b,8b\n"
-                       STR(PTR) " 2b,8b\n"
-                       STR(PTR) " 3b,8b\n"
-                       STR(PTR) " 4b,8b\n"
+                       STR(PTR_WD) " 1b,8b\n"
+                       STR(PTR_WD) " 2b,8b\n"
+                       STR(PTR_WD) " 3b,8b\n"
+                       STR(PTR_WD) " 4b,8b\n"
                        "       .previous\n"
                        "       .set    pop\n"
                        : "+&r"(rt), "=&r"(rs),
@@ -1333,10 +1333,10 @@ fpu_emul:
                        "       j       10b\n"
                        "       .previous\n"
                        "       .section        __ex_table,\"a\"\n"
-                       STR(PTR) " 1b,8b\n"
-                       STR(PTR) " 2b,8b\n"
-                       STR(PTR) " 3b,8b\n"
-                       STR(PTR) " 4b,8b\n"
+                       STR(PTR_WD) " 1b,8b\n"
+                       STR(PTR_WD) " 2b,8b\n"
+                       STR(PTR_WD) " 3b,8b\n"
+                       STR(PTR_WD) " 4b,8b\n"
                        "       .previous\n"
                        "       .set    pop\n"
                        : "+&r"(rt), "=&r"(rs),
@@ -1404,10 +1404,10 @@ fpu_emul:
                        "       j       9b\n"
                        "       .previous\n"
                        "       .section        __ex_table,\"a\"\n"
-                       STR(PTR) " 1b,8b\n"
-                       STR(PTR) " 2b,8b\n"
-                       STR(PTR) " 3b,8b\n"
-                       STR(PTR) " 4b,8b\n"
+                       STR(PTR_WD) " 1b,8b\n"
+                       STR(PTR_WD) " 2b,8b\n"
+                       STR(PTR_WD) " 3b,8b\n"
+                       STR(PTR_WD) " 4b,8b\n"
                        "       .previous\n"
                        "       .set    pop\n"
                        : "+&r"(rt), "=&r"(rs),
@@ -1474,10 +1474,10 @@ fpu_emul:
                        "       j       9b\n"
                        "       .previous\n"
                        "       .section        __ex_table,\"a\"\n"
-                       STR(PTR) " 1b,8b\n"
-                       STR(PTR) " 2b,8b\n"
-                       STR(PTR) " 3b,8b\n"
-                       STR(PTR) " 4b,8b\n"
+                       STR(PTR_WD) " 1b,8b\n"
+                       STR(PTR_WD) " 2b,8b\n"
+                       STR(PTR_WD) " 3b,8b\n"
+                       STR(PTR_WD) " 4b,8b\n"
                        "       .previous\n"
                        "       .set    pop\n"
                        : "+&r"(rt), "=&r"(rs),
@@ -1589,14 +1589,14 @@ fpu_emul:
                        "       j       9b\n"
                        "       .previous\n"
                        "       .section        __ex_table,\"a\"\n"
-                       STR(PTR) " 1b,8b\n"
-                       STR(PTR) " 2b,8b\n"
-                       STR(PTR) " 3b,8b\n"
-                       STR(PTR) " 4b,8b\n"
-                       STR(PTR) " 5b,8b\n"
-                       STR(PTR) " 6b,8b\n"
-                       STR(PTR) " 7b,8b\n"
-                       STR(PTR) " 0b,8b\n"
+                       STR(PTR_WD) " 1b,8b\n"
+                       STR(PTR_WD) " 2b,8b\n"
+                       STR(PTR_WD) " 3b,8b\n"
+                       STR(PTR_WD) " 4b,8b\n"
+                       STR(PTR_WD) " 5b,8b\n"
+                       STR(PTR_WD) " 6b,8b\n"
+                       STR(PTR_WD) " 7b,8b\n"
+                       STR(PTR_WD) " 0b,8b\n"
                        "       .previous\n"
                        "       .set    pop\n"
                        : "+&r"(rt), "=&r"(rs),
@@ -1708,14 +1708,14 @@ fpu_emul:
                        "       j      9b\n"
                        "       .previous\n"
                        "       .section        __ex_table,\"a\"\n"
-                       STR(PTR) " 1b,8b\n"
-                       STR(PTR) " 2b,8b\n"
-                       STR(PTR) " 3b,8b\n"
-                       STR(PTR) " 4b,8b\n"
-                       STR(PTR) " 5b,8b\n"
-                       STR(PTR) " 6b,8b\n"
-                       STR(PTR) " 7b,8b\n"
-                       STR(PTR) " 0b,8b\n"
+                       STR(PTR_WD) " 1b,8b\n"
+                       STR(PTR_WD) " 2b,8b\n"
+                       STR(PTR_WD) " 3b,8b\n"
+                       STR(PTR_WD) " 4b,8b\n"
+                       STR(PTR_WD) " 5b,8b\n"
+                       STR(PTR_WD) " 6b,8b\n"
+                       STR(PTR_WD) " 7b,8b\n"
+                       STR(PTR_WD) " 0b,8b\n"
                        "       .previous\n"
                        "       .set    pop\n"
                        : "+&r"(rt), "=&r"(rs),
@@ -1827,14 +1827,14 @@ fpu_emul:
                        "       j       9b\n"
                        "       .previous\n"
                        "       .section        __ex_table,\"a\"\n"
-                       STR(PTR) " 1b,8b\n"
-                       STR(PTR) " 2b,8b\n"
-                       STR(PTR) " 3b,8b\n"
-                       STR(PTR) " 4b,8b\n"
-                       STR(PTR) " 5b,8b\n"
-                       STR(PTR) " 6b,8b\n"
-                       STR(PTR) " 7b,8b\n"
-                       STR(PTR) " 0b,8b\n"
+                       STR(PTR_WD) " 1b,8b\n"
+                       STR(PTR_WD) " 2b,8b\n"
+                       STR(PTR_WD) " 3b,8b\n"
+                       STR(PTR_WD) " 4b,8b\n"
+                       STR(PTR_WD) " 5b,8b\n"
+                       STR(PTR_WD) " 6b,8b\n"
+                       STR(PTR_WD) " 7b,8b\n"
+                       STR(PTR_WD) " 0b,8b\n"
                        "       .previous\n"
                        "       .set    pop\n"
                        : "+&r"(rt), "=&r"(rs),
@@ -1945,14 +1945,14 @@ fpu_emul:
                        "       j       9b\n"
                        "       .previous\n"
                        "       .section        __ex_table,\"a\"\n"
-                       STR(PTR) " 1b,8b\n"
-                       STR(PTR) " 2b,8b\n"
-                       STR(PTR) " 3b,8b\n"
-                       STR(PTR) " 4b,8b\n"
-                       STR(PTR) " 5b,8b\n"
-                       STR(PTR) " 6b,8b\n"
-                       STR(PTR) " 7b,8b\n"
-                       STR(PTR) " 0b,8b\n"
+                       STR(PTR_WD) " 1b,8b\n"
+                       STR(PTR_WD) " 2b,8b\n"
+                       STR(PTR_WD) " 3b,8b\n"
+                       STR(PTR_WD) " 4b,8b\n"
+                       STR(PTR_WD) " 5b,8b\n"
+                       STR(PTR_WD) " 6b,8b\n"
+                       STR(PTR_WD) " 7b,8b\n"
+                       STR(PTR_WD) " 0b,8b\n"
                        "       .previous\n"
                        "       .set    pop\n"
                        : "+&r"(rt), "=&r"(rs),
@@ -2007,7 +2007,7 @@ fpu_emul:
                        "j      2b\n"
                        ".previous\n"
                        ".section        __ex_table,\"a\"\n"
-                       STR(PTR) " 1b,3b\n"
+                       STR(PTR_WD) " 1b,3b\n"
                        ".previous\n"
                        : "=&r"(res), "+&r"(err)
                        : "r"(vaddr), "i"(SIGSEGV)
@@ -2065,7 +2065,7 @@ fpu_emul:
                        "j      2b\n"
                        ".previous\n"
                        ".section        __ex_table,\"a\"\n"
-                       STR(PTR) " 1b,3b\n"
+                       STR(PTR_WD) " 1b,3b\n"
                        ".previous\n"
                        : "+&r"(res), "+&r"(err)
                        : "r"(vaddr), "i"(SIGSEGV));
@@ -2126,7 +2126,7 @@ fpu_emul:
                        "j      2b\n"
                        ".previous\n"
                        ".section        __ex_table,\"a\"\n"
-                       STR(PTR) " 1b,3b\n"
+                       STR(PTR_WD) " 1b,3b\n"
                        ".previous\n"
                        : "=&r"(res), "+&r"(err)
                        : "r"(vaddr), "i"(SIGSEGV)
@@ -2189,7 +2189,7 @@ fpu_emul:
                        "j      2b\n"
                        ".previous\n"
                        ".section        __ex_table,\"a\"\n"
-                       STR(PTR) " 1b,3b\n"
+                       STR(PTR_WD) " 1b,3b\n"
                        ".previous\n"
                        : "+&r"(res), "+&r"(err)
                        : "r"(vaddr), "i"(SIGSEGV));
index cbf6db9..2748c55 100644 (file)
 #define EX(a,b)                                                        \
 9:     a,##b;                                                  \
        .section __ex_table,"a";                                \
-       PTR     9b,fault;                                       \
+       PTR_WD  9b,fault;                                       \
        .previous
 
 #define EX2(a,b)                                               \
 9:     a,##b;                                                  \
        .section __ex_table,"a";                                \
-       PTR     9b,fault;                                       \
-       PTR     9b+4,fault;                                     \
+       PTR_WD  9b,fault;                                       \
+       PTR_WD  9b+4,fault;                                     \
        .previous
 
        .set    mips1
index b91e911..2e687c6 100644 (file)
@@ -31,7 +31,7 @@
 .ex\@: \insn   \reg, \src
        .set    pop
        .section __ex_table,"a"
-       PTR     .ex\@, fault
+       PTR_WD  .ex\@, fault
        .previous
        .endm
 
index f3c908a..cfde14b 100644 (file)
@@ -147,10 +147,10 @@ LEAF(kexec_smp_wait)
 
 kexec_args:
        EXPORT(kexec_args)
-arg0:  PTR             0x0
-arg1:  PTR             0x0
-arg2:  PTR             0x0
-arg3:  PTR             0x0
+arg0:  PTR_WD          0x0
+arg1:  PTR_WD          0x0
+arg2:  PTR_WD          0x0
+arg3:  PTR_WD          0x0
        .size   kexec_args,PTRSIZE*4
 
 #ifdef CONFIG_SMP
@@ -161,10 +161,10 @@ arg3:     PTR             0x0
  */
 secondary_kexec_args:
        EXPORT(secondary_kexec_args)
-s_arg0: PTR            0x0
-s_arg1: PTR            0x0
-s_arg2: PTR            0x0
-s_arg3: PTR            0x0
+s_arg0: PTR_WD         0x0
+s_arg1: PTR_WD         0x0
+s_arg2: PTR_WD         0x0
+s_arg3: PTR_WD         0x0
        .size   secondary_kexec_args,PTRSIZE*4
 kexec_flag:
        LONG            0x1
@@ -173,17 +173,17 @@ kexec_flag:
 
 kexec_start_address:
        EXPORT(kexec_start_address)
-       PTR             0x0
+       PTR_WD          0x0
        .size           kexec_start_address, PTRSIZE
 
 kexec_indirection_page:
        EXPORT(kexec_indirection_page)
-       PTR             0
+       PTR_WD          0
        .size           kexec_indirection_page, PTRSIZE
 
 relocate_new_kernel_end:
 
 relocate_new_kernel_size:
        EXPORT(relocate_new_kernel_size)
-       PTR             relocate_new_kernel_end - relocate_new_kernel
+       PTR_WD          relocate_new_kernel_end - relocate_new_kernel
        .size           relocate_new_kernel_size, PTRSIZE
index b1b2e10..9bfce5f 100644 (file)
@@ -72,10 +72,10 @@ loads_done:
        .set    pop
 
        .section __ex_table,"a"
-       PTR     load_a4, bad_stack_a4
-       PTR     load_a5, bad_stack_a5
-       PTR     load_a6, bad_stack_a6
-       PTR     load_a7, bad_stack_a7
+       PTR_WD  load_a4, bad_stack_a4
+       PTR_WD  load_a5, bad_stack_a5
+       PTR_WD  load_a6, bad_stack_a6
+       PTR_WD  load_a7, bad_stack_a7
        .previous
 
        lw      t0, TI_FLAGS($28)       # syscall tracing enabled?
@@ -216,7 +216,7 @@ einval: li  v0, -ENOSYS
 #endif /* CONFIG_MIPS_MT_FPAFF */
 
 #define __SYSCALL_WITH_COMPAT(nr, native, compat)      __SYSCALL(nr, native)
-#define __SYSCALL(nr, entry)   PTR entry
+#define __SYSCALL(nr, entry)   PTR_WD entry
        .align  2
        .type   sys_call_table, @object
 EXPORT(sys_call_table)
index f650c55..97456b2 100644 (file)
@@ -101,7 +101,7 @@ not_n32_scall:
 
        END(handle_sysn32)
 
-#define __SYSCALL(nr, entry)   PTR entry
+#define __SYSCALL(nr, entry)   PTR_WD entry
        .type   sysn32_call_table, @object
 EXPORT(sysn32_call_table)
 #include <asm/syscall_table_n32.h>
index 5d7bfc6..5f6ed4b 100644 (file)
@@ -109,7 +109,7 @@ illegal_syscall:
        j       n64_syscall_exit
        END(handle_sys64)
 
-#define __SYSCALL(nr, entry)   PTR entry
+#define __SYSCALL(nr, entry)   PTR_WD entry
        .align  3
        .type   sys_call_table, @object
 EXPORT(sys_call_table)
index cedc8bd..d3c2616 100644 (file)
@@ -73,10 +73,10 @@ load_a7: lw a7, 28(t0)              # argument #8 from usp
 loads_done:
 
        .section __ex_table,"a"
-       PTR     load_a4, bad_stack_a4
-       PTR     load_a5, bad_stack_a5
-       PTR     load_a6, bad_stack_a6
-       PTR     load_a7, bad_stack_a7
+       PTR_WD  load_a4, bad_stack_a4
+       PTR_WD  load_a5, bad_stack_a5
+       PTR_WD  load_a6, bad_stack_a6
+       PTR_WD  load_a7, bad_stack_a7
        .previous
 
        li      t1, _TIF_WORK_SYSCALL_ENTRY
@@ -214,7 +214,7 @@ einval: li  v0, -ENOSYS
        END(sys32_syscall)
 
 #define __SYSCALL_WITH_COMPAT(nr, native, compat)      __SYSCALL(nr, compat)
-#define __SYSCALL(nr, entry)   PTR entry
+#define __SYSCALL(nr, entry)   PTR_WD entry
        .align  3
        .type   sys32_call_table,@object
 EXPORT(sys32_call_table)
index 5512cd5..ae93a60 100644 (file)
@@ -122,8 +122,8 @@ static inline int mips_atomic_set(unsigned long addr, unsigned long new)
                "       j       3b                                      \n"
                "       .previous                                       \n"
                "       .section __ex_table,\"a\"                       \n"
-               "       "STR(PTR)"      1b, 4b                          \n"
-               "       "STR(PTR)"      2b, 4b                          \n"
+               "       "STR(PTR_WD)"   1b, 4b                          \n"
+               "       "STR(PTR_WD)"   2b, 4b                          \n"
                "       .previous                                       \n"
                "       .set    pop                                     \n"
                : [old] "=&r" (old),
@@ -152,8 +152,8 @@ static inline int mips_atomic_set(unsigned long addr, unsigned long new)
                "       j       3b                                      \n"
                "       .previous                                       \n"
                "       .section __ex_table,\"a\"                       \n"
-               "       "STR(PTR)"      1b, 5b                          \n"
-               "       "STR(PTR)"      2b, 5b                          \n"
+               "       "STR(PTR_WD)"   1b, 5b                          \n"
+               "       "STR(PTR_WD)"   2b, 5b                          \n"
                "       .previous                                       \n"
                "       .set    pop                                     \n"
                : [old] "=&r" (old),
index e59cb62..a25e0b7 100644 (file)
@@ -414,6 +414,24 @@ int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
        return -ENOIOCTLCMD;
 }
 
+/*
+ * Actually run the vCPU, entering an RCU extended quiescent state (EQS) while
+ * the vCPU is running.
+ *
+ * This must be noinstr as instrumentation may make use of RCU, and this is not
+ * safe during the EQS.
+ */
+static int noinstr kvm_mips_vcpu_enter_exit(struct kvm_vcpu *vcpu)
+{
+       int ret;
+
+       guest_state_enter_irqoff();
+       ret = kvm_mips_callbacks->vcpu_run(vcpu);
+       guest_state_exit_irqoff();
+
+       return ret;
+}
+
 int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
 {
        int r = -EINTR;
@@ -434,7 +452,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
        lose_fpu(1);
 
        local_irq_disable();
-       guest_enter_irqoff();
+       guest_timing_enter_irqoff();
        trace_kvm_enter(vcpu);
 
        /*
@@ -445,10 +463,23 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
         */
        smp_store_mb(vcpu->mode, IN_GUEST_MODE);
 
-       r = kvm_mips_callbacks->vcpu_run(vcpu);
+       r = kvm_mips_vcpu_enter_exit(vcpu);
+
+       /*
+        * We must ensure that any pending interrupts are taken before
+        * we exit guest timing so that timer ticks are accounted as
+        * guest time. Transiently unmask interrupts so that any
+        * pending interrupts are taken.
+        *
+        * TODO: is there a barrier which ensures that pending interrupts are
+        * recognised? Currently this just hopes that the CPU takes any pending
+        * interrupts between the enable and disable.
+        */
+       local_irq_enable();
+       local_irq_disable();
 
        trace_kvm_out(vcpu);
-       guest_exit_irqoff();
+       guest_timing_exit_irqoff();
        local_irq_enable();
 
 out:
@@ -1168,7 +1199,7 @@ static void kvm_mips_set_c0_status(void)
 /*
  * Return value is in the form (errcode<<2 | RESUME_FLAG_HOST | RESUME_FLAG_NV)
  */
-int kvm_mips_handle_exit(struct kvm_vcpu *vcpu)
+static int __kvm_mips_handle_exit(struct kvm_vcpu *vcpu)
 {
        struct kvm_run *run = vcpu->run;
        u32 cause = vcpu->arch.host_cp0_cause;
@@ -1357,6 +1388,17 @@ int kvm_mips_handle_exit(struct kvm_vcpu *vcpu)
        return ret;
 }
 
+int noinstr kvm_mips_handle_exit(struct kvm_vcpu *vcpu)
+{
+       int ret;
+
+       guest_state_exit_irqoff();
+       ret = __kvm_mips_handle_exit(vcpu);
+       guest_state_enter_irqoff();
+
+       return ret;
+}
+
 /* Enable FPU for guest and restore context */
 void kvm_own_fpu(struct kvm_vcpu *vcpu)
 {
index 4adca5a..c706f58 100644 (file)
@@ -458,8 +458,8 @@ void kvm_vz_acquire_htimer(struct kvm_vcpu *vcpu)
 /**
  * _kvm_vz_save_htimer() - Switch to software emulation of guest timer.
  * @vcpu:      Virtual CPU.
- * @compare:   Pointer to write compare value to.
- * @cause:     Pointer to write cause value to.
+ * @out_compare: Pointer to write compare value to.
+ * @out_cause: Pointer to write cause value to.
  *
  * Save VZ guest timer state and switch to software emulation of guest CP0
  * timer. The hard timer must already be in use, so preemption should be
@@ -1541,11 +1541,14 @@ static int kvm_trap_vz_handle_guest_exit(struct kvm_vcpu *vcpu)
 }
 
 /**
- * kvm_trap_vz_handle_cop_unusuable() - Guest used unusable coprocessor.
+ * kvm_trap_vz_handle_cop_unusable() - Guest used unusable coprocessor.
  * @vcpu:      Virtual CPU context.
  *
  * Handle when the guest attempts to use a coprocessor which hasn't been allowed
  * by the root context.
+ *
+ * Return: value indicating whether to resume the host or the guest
+ *        (RESUME_HOST or RESUME_GUEST)
  */
 static int kvm_trap_vz_handle_cop_unusable(struct kvm_vcpu *vcpu)
 {
@@ -1592,6 +1595,9 @@ static int kvm_trap_vz_handle_cop_unusable(struct kvm_vcpu *vcpu)
  *
  * Handle when the guest attempts to use MSA when it is disabled in the root
  * context.
+ *
+ * Return: value indicating whether to resume the host or the guest
+ *        (RESUME_HOST or RESUME_GUEST)
  */
 static int kvm_trap_vz_handle_msa_disabled(struct kvm_vcpu *vcpu)
 {
index a46db08..7767137 100644 (file)
@@ -347,7 +347,7 @@ EXPORT_SYMBOL(csum_partial)
        .if \mode == LEGACY_MODE;               \
 9:             insn reg, addr;                 \
                .section __ex_table,"a";        \
-               PTR     9b, .L_exc;             \
+               PTR_WD  9b, .L_exc;             \
                .previous;                      \
        /* This is enabled in EVA mode */       \
        .else;                                  \
@@ -356,7 +356,7 @@ EXPORT_SYMBOL(csum_partial)
                    ((\to == USEROP) && (type == ST_INSN));     \
 9:                     __BUILD_EVA_INSN(insn##e, reg, addr);   \
                        .section __ex_table,"a";                \
-                       PTR     9b, .L_exc;                     \
+                       PTR_WD  9b, .L_exc;                     \
                        .previous;                              \
                .else;                                          \
                        /* EVA without exception */             \
index 277c322..18a43f2 100644 (file)
        .if \mode == LEGACY_MODE;                               \
 9:             insn reg, addr;                                 \
                .section __ex_table,"a";                        \
-               PTR     9b, handler;                            \
+               PTR_WD  9b, handler;                            \
                .previous;                                      \
        /* This is assembled in EVA mode */                     \
        .else;                                                  \
                    ((\to == USEROP) && (type == ST_INSN));     \
 9:                     __BUILD_EVA_INSN(insn##e, reg, addr);   \
                        .section __ex_table,"a";                \
-                       PTR     9b, handler;                    \
+                       PTR_WD  9b, handler;                    \
                        .previous;                              \
                .else;                                          \
                        /*                                      \
index b0baa3c..0b342ba 100644 (file)
@@ -52,7 +52,7 @@
 9:             ___BUILD_EVA_INSN(insn, reg, addr);     \
        .endif;                                         \
        .section __ex_table,"a";                        \
-       PTR     9b, handler;                            \
+       PTR_WD  9b, handler;                            \
        .previous
 
        .macro  f_fill64 dst, offset, val, fixup, mode
index 556acf6..13aaa99 100644 (file)
@@ -15,7 +15,7 @@
 #define EX(insn,reg,addr,handler)                      \
 9:     insn    reg, addr;                              \
        .section __ex_table,"a";                        \
-       PTR     9b, handler;                            \
+       PTR_WD  9b, handler;                            \
        .previous
 
 /*
@@ -59,7 +59,7 @@ LEAF(__strncpy_from_user_asm)
        jr              ra
 
        .section        __ex_table,"a"
-       PTR             1b, .Lfault
+       PTR_WD          1b, .Lfault
        .previous
 
        EXPORT_SYMBOL(__strncpy_from_user_asm)
index 92b63f2..6de31b6 100644 (file)
@@ -14,7 +14,7 @@
 #define EX(insn,reg,addr,handler)                      \
 9:     insn    reg, addr;                              \
        .section __ex_table,"a";                        \
-       PTR     9b, handler;                            \
+       PTR_WD  9b, handler;                            \
        .previous
 
 /*
index 9a29e94..3115d4d 100644 (file)
@@ -3,7 +3,7 @@
 #include <linux/pci.h>
 #include <loongson.h>
 
-static void pci_fixup_radeon(struct pci_dev *pdev)
+static void pci_fixup_video(struct pci_dev *pdev)
 {
        struct resource *res = &pdev->resource[PCI_ROM_RESOURCE];
 
@@ -22,8 +22,7 @@ static void pci_fixup_radeon(struct pci_dev *pdev)
        res->flags = IORESOURCE_MEM | IORESOURCE_ROM_SHADOW |
                     IORESOURCE_PCI_FIXED;
 
-       dev_info(&pdev->dev, "BAR %d: assigned %pR for Radeon ROM\n",
-                PCI_ROM_RESOURCE, res);
+       dev_info(&pdev->dev, "Video device with shadowed ROM at %pR\n", res);
 }
-DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_ATI, 0x9615,
-                               PCI_CLASS_DISPLAY_VGA, 8, pci_fixup_radeon);
+DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_VENDOR_ID_ATI, 0x9615,
+                              PCI_CLASS_DISPLAY_VGA, 8, pci_fixup_video);
index 7be2786..78c6a5f 100644 (file)
@@ -223,6 +223,8 @@ static __always_inline void update_user_segments(u32 val)
        update_user_segment(15, val);
 }
 
+int __init find_free_bat(void);
+unsigned int bat_block_size(unsigned long base, unsigned long top);
 #endif /* !__ASSEMBLY__ */
 
 /* We happily ignore the smaller BATs on 601, we don't actually use
index 609c80f..f8b94f7 100644 (file)
@@ -178,6 +178,7 @@ static inline bool pte_user(pte_t pte)
 #ifndef __ASSEMBLY__
 
 int map_kernel_page(unsigned long va, phys_addr_t pa, pgprot_t prot);
+void unmap_kernel_page(unsigned long va);
 
 #endif /* !__ASSEMBLY__ */
 
index 33e073d..875730d 100644 (file)
@@ -1082,6 +1082,8 @@ static inline int map_kernel_page(unsigned long ea, unsigned long pa, pgprot_t p
        return hash__map_kernel_page(ea, pa, prot);
 }
 
+void unmap_kernel_page(unsigned long va);
+
 static inline int __meminit vmemmap_create_mapping(unsigned long start,
                                                   unsigned long page_size,
                                                   unsigned long phys)
index 947b5b9..a832aea 100644 (file)
@@ -111,8 +111,10 @@ static inline void __set_fixmap(enum fixed_addresses idx,
                BUILD_BUG_ON(idx >= __end_of_fixed_addresses);
        else if (WARN_ON(idx >= __end_of_fixed_addresses))
                return;
-
-       map_kernel_page(__fix_to_virt(idx), phys, flags);
+       if (pgprot_val(flags))
+               map_kernel_page(__fix_to_virt(idx), phys, flags);
+       else
+               unmap_kernel_page(__fix_to_virt(idx));
 }
 
 #define __early_set_fixmap     __set_fixmap
index a58fb4a..674e5aa 100644 (file)
@@ -473,7 +473,7 @@ static inline bool arch_irq_disabled_regs(struct pt_regs *regs)
        return !(regs->msr & MSR_EE);
 }
 
-static inline bool should_hard_irq_enable(void)
+static __always_inline bool should_hard_irq_enable(void)
 {
        return false;
 }
index fe07558..827038a 100644 (file)
@@ -39,7 +39,6 @@ struct kvm_nested_guest {
        pgd_t *shadow_pgtable;          /* our page table for this guest */
        u64 l1_gr_to_hr;                /* L1's addr of part'n-scoped table */
        u64 process_table;              /* process table entry for this guest */
-       u64 hfscr;                      /* HFSCR that the L1 requested for this nested guest */
        long refcnt;                    /* number of pointers to this struct */
        struct mutex tlb_lock;          /* serialize page faults and tlbies */
        struct kvm_nested_guest *next;
index a770443..d9bf60b 100644 (file)
@@ -818,6 +818,7 @@ struct kvm_vcpu_arch {
 
        /* For support of nested guests */
        struct kvm_nested_guest *nested;
+       u64 nested_hfscr;       /* HFSCR that the L1 requested for the nested guest */
        u32 nested_vcpu_id;
        gpa_t nested_io_gpr;
 #endif
index b67742e..d959c2a 100644 (file)
@@ -64,6 +64,7 @@ extern int icache_44x_need_flush;
 #ifndef __ASSEMBLY__
 
 int map_kernel_page(unsigned long va, phys_addr_t pa, pgprot_t prot);
+void unmap_kernel_page(unsigned long va);
 
 #endif /* !__ASSEMBLY__ */
 
index a3313e8..2816d15 100644 (file)
@@ -308,6 +308,7 @@ static inline void __ptep_set_access_flags(struct vm_area_struct *vma,
 #define __swp_entry_to_pte(x)          __pte((x).val)
 
 int map_kernel_page(unsigned long ea, unsigned long pa, pgprot_t prot);
+void unmap_kernel_page(unsigned long va);
 extern int __meminit vmemmap_create_mapping(unsigned long start,
                                            unsigned long page_size,
                                            unsigned long phys);
index efad070..9675303 100644 (file)
 #define PPC_RAW_LDX(r, base, b)                (0x7c00002a | ___PPC_RT(r) | ___PPC_RA(base) | ___PPC_RB(b))
 #define PPC_RAW_LHZ(r, base, i)                (0xa0000000 | ___PPC_RT(r) | ___PPC_RA(base) | IMM_L(i))
 #define PPC_RAW_LHBRX(r, base, b)      (0x7c00062c | ___PPC_RT(r) | ___PPC_RA(base) | ___PPC_RB(b))
+#define PPC_RAW_LWBRX(r, base, b)      (0x7c00042c | ___PPC_RT(r) | ___PPC_RA(base) | ___PPC_RB(b))
 #define PPC_RAW_LDBRX(r, base, b)      (0x7c000428 | ___PPC_RT(r) | ___PPC_RA(base) | ___PPC_RB(b))
 #define PPC_RAW_STWCX(s, a, b)         (0x7c00012d | ___PPC_RS(s) | ___PPC_RA(a) | ___PPC_RB(b))
 #define PPC_RAW_CMPWI(a, i)            (0x2c000000 | ___PPC_RA(a) | IMM_L(i))
index 52d05b4..25fc8ad 100644 (file)
@@ -90,7 +90,7 @@ static inline void syscall_get_arguments(struct task_struct *task,
        unsigned long val, mask = -1UL;
        unsigned int n = 6;
 
-       if (is_32bit_task())
+       if (is_tsk_32bit_task(task))
                mask = 0xffffffff;
 
        while (n--) {
@@ -105,7 +105,7 @@ static inline void syscall_get_arguments(struct task_struct *task,
 
 static inline int syscall_get_arch(struct task_struct *task)
 {
-       if (is_32bit_task())
+       if (is_tsk_32bit_task(task))
                return AUDIT_ARCH_PPC;
        else if (IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN))
                return AUDIT_ARCH_PPC64LE;
index 5725029..d6e649b 100644 (file)
@@ -168,8 +168,10 @@ static inline bool test_thread_local_flags(unsigned int flags)
 
 #ifdef CONFIG_COMPAT
 #define is_32bit_task()        (test_thread_flag(TIF_32BIT))
+#define is_tsk_32bit_task(tsk) (test_tsk_thread_flag(tsk, TIF_32BIT))
 #else
 #define is_32bit_task()        (IS_ENABLED(CONFIG_PPC32))
+#define is_tsk_32bit_task(tsk) (IS_ENABLED(CONFIG_PPC32))
 #endif
 
 #if defined(CONFIG_PPC64)
index 92088f8..7bab2d7 100644 (file)
@@ -30,6 +30,7 @@ COMPAT_SYS_CALL_TABLE:
        .ifc \srr,srr
        mfspr   r11,SPRN_SRR0
        ld      r12,_NIP(r1)
+       clrrdi  r11,r11,2
        clrrdi  r12,r12,2
 100:   tdne    r11,r12
        EMIT_WARN_ENTRY 100b,__FILE__,__LINE__,(BUGFLAG_WARNING | BUGFLAG_ONCE)
@@ -40,6 +41,7 @@ COMPAT_SYS_CALL_TABLE:
        .else
        mfspr   r11,SPRN_HSRR0
        ld      r12,_NIP(r1)
+       clrrdi  r11,r11,2
        clrrdi  r12,r12,2
 100:   tdne    r11,r12
        EMIT_WARN_ENTRY 100b,__FILE__,__LINE__,(BUGFLAG_WARNING | BUGFLAG_ONCE)
index 62361cc..cd0b8b7 100644 (file)
@@ -649,8 +649,9 @@ DEFINE_INTERRUPT_HANDLER_ASYNC(timer_interrupt)
                __this_cpu_inc(irq_stat.timer_irqs_event);
        } else {
                now = *next_tb - now;
-               if (now <= decrementer_max)
-                       set_dec_or_work(now);
+               if (now > decrementer_max)
+                       now = decrementer_max;
+               set_dec_or_work(now);
                __this_cpu_inc(irq_stat.timer_irqs_others);
        }
 
index d1817cd..84c89f0 100644 (file)
@@ -1816,7 +1816,6 @@ static int kvmppc_handle_exit_hv(struct kvm_vcpu *vcpu,
 
 static int kvmppc_handle_nested_exit(struct kvm_vcpu *vcpu)
 {
-       struct kvm_nested_guest *nested = vcpu->arch.nested;
        int r;
        int srcu_idx;
 
@@ -1922,7 +1921,7 @@ static int kvmppc_handle_nested_exit(struct kvm_vcpu *vcpu)
                 * it into a HEAI.
                 */
                if (!(vcpu->arch.hfscr_permitted & (1UL << cause)) ||
-                                       (nested->hfscr & (1UL << cause))) {
+                               (vcpu->arch.nested_hfscr & (1UL << cause))) {
                        vcpu->arch.trap = BOOK3S_INTERRUPT_H_EMUL_ASSIST;
 
                        /*
index 8f8daae..9d373f8 100644 (file)
@@ -363,7 +363,7 @@ long kvmhv_enter_nested_guest(struct kvm_vcpu *vcpu)
        /* set L1 state to L2 state */
        vcpu->arch.nested = l2;
        vcpu->arch.nested_vcpu_id = l2_hv.vcpu_token;
-       l2->hfscr = l2_hv.hfscr;
+       vcpu->arch.nested_hfscr = l2_hv.hfscr;
        vcpu->arch.regs = l2_regs;
 
        /* Guest must always run with ME enabled, HV disabled. */
index 94045b2..203735c 100644 (file)
@@ -76,7 +76,7 @@ unsigned long p_block_mapped(phys_addr_t pa)
        return 0;
 }
 
-static int __init find_free_bat(void)
+int __init find_free_bat(void)
 {
        int b;
        int n = mmu_has_feature(MMU_FTR_USE_HIGH_BATS) ? 8 : 4;
@@ -100,7 +100,7 @@ static int __init find_free_bat(void)
  * - block size has to be a power of two. This is calculated by finding the
  *   highest bit set to 1.
  */
-static unsigned int block_size(unsigned long base, unsigned long top)
+unsigned int bat_block_size(unsigned long base, unsigned long top)
 {
        unsigned int max_size = SZ_256M;
        unsigned int base_shift = (ffs(base) - 1) & 31;
@@ -145,7 +145,7 @@ static unsigned long __init __mmu_mapin_ram(unsigned long base, unsigned long to
        int idx;
 
        while ((idx = find_free_bat()) != -1 && base != top) {
-               unsigned int size = block_size(base, top);
+               unsigned int size = bat_block_size(base, top);
 
                if (size < 128 << 10)
                        break;
@@ -201,12 +201,12 @@ void mmu_mark_initmem_nx(void)
        unsigned long size;
 
        for (i = 0; i < nb - 1 && base < top;) {
-               size = block_size(base, top);
+               size = bat_block_size(base, top);
                setibat(i++, PAGE_OFFSET + base, base, size, PAGE_KERNEL_TEXT);
                base += size;
        }
        if (base < top) {
-               size = block_size(base, top);
+               size = bat_block_size(base, top);
                if ((top - base) > size) {
                        size <<= 1;
                        if (strict_kernel_rwx_enabled() && base + size > border)
index 35b287b..450a67e 100644 (file)
@@ -10,48 +10,51 @@ int __init kasan_init_region(void *start, size_t size)
 {
        unsigned long k_start = (unsigned long)kasan_mem_to_shadow(start);
        unsigned long k_end = (unsigned long)kasan_mem_to_shadow(start + size);
-       unsigned long k_cur = k_start;
-       int k_size = k_end - k_start;
-       int k_size_base = 1 << (ffs(k_size) - 1);
+       unsigned long k_nobat = k_start;
+       unsigned long k_cur;
+       phys_addr_t phys;
        int ret;
-       void *block;
 
-       block = memblock_alloc(k_size, k_size_base);
-
-       if (block && k_size_base >= SZ_128K && k_start == ALIGN(k_start, k_size_base)) {
-               int shift = ffs(k_size - k_size_base);
-               int k_size_more = shift ? 1 << (shift - 1) : 0;
-
-               setbat(-1, k_start, __pa(block), k_size_base, PAGE_KERNEL);
-               if (k_size_more >= SZ_128K)
-                       setbat(-1, k_start + k_size_base, __pa(block) + k_size_base,
-                              k_size_more, PAGE_KERNEL);
-               if (v_block_mapped(k_start))
-                       k_cur = k_start + k_size_base;
-               if (v_block_mapped(k_start + k_size_base))
-                       k_cur = k_start + k_size_base + k_size_more;
-
-               update_bats();
+       while (k_nobat < k_end) {
+               unsigned int k_size = bat_block_size(k_nobat, k_end);
+               int idx = find_free_bat();
+
+               if (idx == -1)
+                       break;
+               if (k_size < SZ_128K)
+                       break;
+               phys = memblock_phys_alloc_range(k_size, k_size, 0,
+                                                MEMBLOCK_ALLOC_ANYWHERE);
+               if (!phys)
+                       break;
+
+               setbat(idx, k_nobat, phys, k_size, PAGE_KERNEL);
+               k_nobat += k_size;
        }
+       if (k_nobat != k_start)
+               update_bats();
 
-       if (!block)
-               block = memblock_alloc(k_size, PAGE_SIZE);
-       if (!block)
-               return -ENOMEM;
+       if (k_nobat < k_end) {
+               phys = memblock_phys_alloc_range(k_end - k_nobat, PAGE_SIZE, 0,
+                                                MEMBLOCK_ALLOC_ANYWHERE);
+               if (!phys)
+                       return -ENOMEM;
+       }
 
        ret = kasan_init_shadow_page_tables(k_start, k_end);
        if (ret)
                return ret;
 
-       kasan_update_early_region(k_start, k_cur, __pte(0));
+       kasan_update_early_region(k_start, k_nobat, __pte(0));
 
-       for (; k_cur < k_end; k_cur += PAGE_SIZE) {
+       for (k_cur = k_nobat; k_cur < k_end; k_cur += PAGE_SIZE) {
                pmd_t *pmd = pmd_off_k(k_cur);
-               void *va = block + k_cur - k_start;
-               pte_t pte = pfn_pte(PHYS_PFN(__pa(va)), PAGE_KERNEL);
+               pte_t pte = pfn_pte(PHYS_PFN(phys + k_cur - k_nobat), PAGE_KERNEL);
 
                __set_pte_at(&init_mm, k_cur, pte_offset_kernel(pmd, k_cur), pte, 0);
        }
        flush_tlb_kernel_range(k_start, k_end);
+       memset(kasan_mem_to_shadow(start), 0, k_end - k_start);
+
        return 0;
 }
index abb3198..6ec5a7d 100644 (file)
@@ -206,6 +206,15 @@ void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep,
        __set_pte_at(mm, addr, ptep, pte, 0);
 }
 
+void unmap_kernel_page(unsigned long va)
+{
+       pmd_t *pmdp = pmd_off_k(va);
+       pte_t *ptep = pte_offset_kernel(pmdp, va);
+
+       pte_clear(&init_mm, va, ptep);
+       flush_tlb_kernel_range(va, va + PAGE_SIZE);
+}
+
 /*
  * This is called when relaxing access to a PTE. It's also called in the page
  * fault path when we don't hit any of the major fault cases, ie, a minor
index d6ffdd0..56dd1f4 100644 (file)
@@ -23,15 +23,15 @@ static void bpf_jit_fill_ill_insns(void *area, unsigned int size)
        memset32(area, BREAKPOINT_INSTRUCTION, size / 4);
 }
 
-/* Fix the branch target addresses for subprog calls */
-static int bpf_jit_fixup_subprog_calls(struct bpf_prog *fp, u32 *image,
-                                      struct codegen_context *ctx, u32 *addrs)
+/* Fix updated addresses (for subprog calls, ldimm64, et al) during extra pass */
+static int bpf_jit_fixup_addresses(struct bpf_prog *fp, u32 *image,
+                                  struct codegen_context *ctx, u32 *addrs)
 {
        const struct bpf_insn *insn = fp->insnsi;
        bool func_addr_fixed;
        u64 func_addr;
        u32 tmp_idx;
-       int i, ret;
+       int i, j, ret;
 
        for (i = 0; i < fp->len; i++) {
                /*
@@ -66,6 +66,23 @@ static int bpf_jit_fixup_subprog_calls(struct bpf_prog *fp, u32 *image,
                         * of the JITed sequence remains unchanged.
                         */
                        ctx->idx = tmp_idx;
+               } else if (insn[i].code == (BPF_LD | BPF_IMM | BPF_DW)) {
+                       tmp_idx = ctx->idx;
+                       ctx->idx = addrs[i] / 4;
+#ifdef CONFIG_PPC32
+                       PPC_LI32(ctx->b2p[insn[i].dst_reg] - 1, (u32)insn[i + 1].imm);
+                       PPC_LI32(ctx->b2p[insn[i].dst_reg], (u32)insn[i].imm);
+                       for (j = ctx->idx - addrs[i] / 4; j < 4; j++)
+                               EMIT(PPC_RAW_NOP());
+#else
+                       func_addr = ((u64)(u32)insn[i].imm) | (((u64)(u32)insn[i + 1].imm) << 32);
+                       PPC_LI64(b2p[insn[i].dst_reg], func_addr);
+                       /* overwrite rest with nops */
+                       for (j = ctx->idx - addrs[i] / 4; j < 5; j++)
+                               EMIT(PPC_RAW_NOP());
+#endif
+                       ctx->idx = tmp_idx;
+                       i++;
                }
        }
 
@@ -200,13 +217,13 @@ skip_init_ctx:
                /*
                 * Do not touch the prologue and epilogue as they will remain
                 * unchanged. Only fix the branch target address for subprog
-                * calls in the body.
+                * calls in the body, and ldimm64 instructions.
                 *
                 * This does not change the offsets and lengths of the subprog
                 * call instruction sequences and hence, the size of the JITed
                 * image as well.
                 */
-               bpf_jit_fixup_subprog_calls(fp, code_base, &cgctx, addrs);
+               bpf_jit_fixup_addresses(fp, code_base, &cgctx, addrs);
 
                /* There is no need to perform the usual passes. */
                goto skip_codegen_passes;
index faaebd4..cf8dd8a 100644 (file)
@@ -191,6 +191,9 @@ void bpf_jit_emit_func_call_rel(u32 *image, struct codegen_context *ctx, u64 fun
 
        if (image && rel < 0x2000000 && rel >= -0x2000000) {
                PPC_BL_ABS(func);
+               EMIT(PPC_RAW_NOP());
+               EMIT(PPC_RAW_NOP());
+               EMIT(PPC_RAW_NOP());
        } else {
                /* Load function address into r0 */
                EMIT(PPC_RAW_LIS(_R0, IMM_H(func)));
@@ -290,6 +293,8 @@ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, struct codegen_context *
                bool func_addr_fixed;
                u64 func_addr;
                u32 true_cond;
+               u32 tmp_idx;
+               int j;
 
                /*
                 * addrs[] maps a BPF bytecode address into a real offset from
@@ -905,8 +910,12 @@ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, struct codegen_context *
                 * 16 byte instruction that uses two 'struct bpf_insn'
                 */
                case BPF_LD | BPF_IMM | BPF_DW: /* dst = (u64) imm */
+                       tmp_idx = ctx->idx;
                        PPC_LI32(dst_reg_h, (u32)insn[i + 1].imm);
                        PPC_LI32(dst_reg, (u32)insn[i].imm);
+                       /* padding to allow full 4 instructions for later patching */
+                       for (j = ctx->idx - tmp_idx; j < 4; j++)
+                               EMIT(PPC_RAW_NOP());
                        /* Adjust for two bpf instructions */
                        addrs[++i] = ctx->idx * 4;
                        break;
index 9eae8d8..e1e8c93 100644 (file)
@@ -319,6 +319,7 @@ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, struct codegen_context *
                u64 imm64;
                u32 true_cond;
                u32 tmp_idx;
+               int j;
 
                /*
                 * addrs[] maps a BPF bytecode address into a real offset from
@@ -633,17 +634,21 @@ bpf_alu32_trunc:
                                EMIT(PPC_RAW_MR(dst_reg, b2p[TMP_REG_1]));
                                break;
                        case 64:
-                               /*
-                                * Way easier and faster(?) to store the value
-                                * into stack and then use ldbrx
-                                *
-                                * ctx->seen will be reliable in pass2, but
-                                * the instructions generated will remain the
-                                * same across all passes
-                                */
+                               /* Store the value to stack and then use byte-reverse loads */
                                PPC_BPF_STL(dst_reg, 1, bpf_jit_stack_local(ctx));
                                EMIT(PPC_RAW_ADDI(b2p[TMP_REG_1], 1, bpf_jit_stack_local(ctx)));
-                               EMIT(PPC_RAW_LDBRX(dst_reg, 0, b2p[TMP_REG_1]));
+                               if (cpu_has_feature(CPU_FTR_ARCH_206)) {
+                                       EMIT(PPC_RAW_LDBRX(dst_reg, 0, b2p[TMP_REG_1]));
+                               } else {
+                                       EMIT(PPC_RAW_LWBRX(dst_reg, 0, b2p[TMP_REG_1]));
+                                       if (IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN))
+                                               EMIT(PPC_RAW_SLDI(dst_reg, dst_reg, 32));
+                                       EMIT(PPC_RAW_LI(b2p[TMP_REG_2], 4));
+                                       EMIT(PPC_RAW_LWBRX(b2p[TMP_REG_2], b2p[TMP_REG_2], b2p[TMP_REG_1]));
+                                       if (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN))
+                                               EMIT(PPC_RAW_SLDI(b2p[TMP_REG_2], b2p[TMP_REG_2], 32));
+                                       EMIT(PPC_RAW_OR(dst_reg, dst_reg, b2p[TMP_REG_2]));
+                               }
                                break;
                        }
                        break;
@@ -848,9 +853,13 @@ emit_clear:
                case BPF_LD | BPF_IMM | BPF_DW: /* dst = (u64) imm */
                        imm64 = ((u64)(u32) insn[i].imm) |
                                    (((u64)(u32) insn[i+1].imm) << 32);
+                       tmp_idx = ctx->idx;
+                       PPC_LI64(dst_reg, imm64);
+                       /* padding to allow full 5 instructions for later patching */
+                       for (j = ctx->idx - tmp_idx; j < 5; j++)
+                               EMIT(PPC_RAW_NOP());
                        /* Adjust for two bpf instructions */
                        addrs[++i] = ctx->idx * 4;
-                       PPC_LI64(dst_reg, imm64);
                        break;
 
                /*
index a684901..b5b42cf 100644 (file)
@@ -776,6 +776,34 @@ static void pmao_restore_workaround(bool ebb)
        mtspr(SPRN_PMC6, pmcs[5]);
 }
 
+/*
+ * If the perf subsystem wants performance monitor interrupts as soon as
+ * possible (e.g., to sample the instruction address and stack chain),
+ * this should return true. The IRQ masking code can then enable MSR[EE]
+ * in some places (e.g., interrupt handlers) that allows PMI interrupts
+ * through to improve accuracy of profiles, at the cost of some performance.
+ *
+ * The PMU counters can be enabled by other means (e.g., sysfs raw SPR
+ * access), but in that case there is no need for prompt PMI handling.
+ *
+ * This currently returns true if any perf counter is being used. It
+ * could possibly return false if only events are being counted rather than
+ * samples being taken, but for now this is good enough.
+ */
+bool power_pmu_wants_prompt_pmi(void)
+{
+       struct cpu_hw_events *cpuhw;
+
+       /*
+        * This could simply test local_paca->pmcregs_in_use if that were not
+        * under ifdef KVM.
+        */
+       if (!ppmu)
+               return false;
+
+       cpuhw = this_cpu_ptr(&cpu_hw_events);
+       return cpuhw->n_events;
+}
 #endif /* CONFIG_PPC64 */
 
 static void perf_event_interrupt(struct pt_regs *regs);
@@ -1327,9 +1355,20 @@ static void power_pmu_disable(struct pmu *pmu)
                 * Otherwise provide a warning if there is PMI pending, but
                 * no counter is found overflown.
                 */
-               if (any_pmc_overflown(cpuhw))
-                       clear_pmi_irq_pending();
-               else
+               if (any_pmc_overflown(cpuhw)) {
+                       /*
+                        * Since power_pmu_disable runs under local_irq_save, it
+                        * could happen that code hits a PMC overflow without PMI
+                        * pending in paca. Hence only clear PMI pending if it was
+                        * set.
+                        *
+                        * If a PMI is pending, then MSR[EE] must be disabled (because
+                        * the masked PMI handler disabling EE). So it is safe to
+                        * call clear_pmi_irq_pending().
+                        */
+                       if (pmi_irq_pending())
+                               clear_pmi_irq_pending();
+               } else
                        WARN_ON(pmi_irq_pending());
 
                val = mmcra = cpuhw->mmcr.mmcra;
@@ -2438,36 +2477,6 @@ static void perf_event_interrupt(struct pt_regs *regs)
        perf_sample_event_took(sched_clock() - start_clock);
 }
 
-/*
- * If the perf subsystem wants performance monitor interrupts as soon as
- * possible (e.g., to sample the instruction address and stack chain),
- * this should return true. The IRQ masking code can then enable MSR[EE]
- * in some places (e.g., interrupt handlers) that allows PMI interrupts
- * though to improve accuracy of profiles, at the cost of some performance.
- *
- * The PMU counters can be enabled by other means (e.g., sysfs raw SPR
- * access), but in that case there is no need for prompt PMI handling.
- *
- * This currently returns true if any perf counter is being used. It
- * could possibly return false if only events are being counted rather than
- * samples being taken, but for now this is good enough.
- */
-bool power_pmu_wants_prompt_pmi(void)
-{
-       struct cpu_hw_events *cpuhw;
-
-       /*
-        * This could simply test local_paca->pmcregs_in_use if that were not
-        * under ifdef KVM.
-        */
-
-       if (!ppmu)
-               return false;
-
-       cpuhw = this_cpu_ptr(&cpu_hw_events);
-       return cpuhw->n_events;
-}
-
 static int power_pmu_prepare_cpu(unsigned int cpu)
 {
        struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu);
index 0c5239e..6241660 100644 (file)
@@ -90,6 +90,7 @@ int kvm_arch_vcpu_precreate(struct kvm *kvm, unsigned int id)
 int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu)
 {
        struct kvm_cpu_context *cntx;
+       struct kvm_vcpu_csr *reset_csr = &vcpu->arch.guest_reset_csr;
 
        /* Mark this VCPU never ran */
        vcpu->arch.ran_atleast_once = false;
@@ -106,6 +107,9 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu)
        cntx->hstatus |= HSTATUS_SPVP;
        cntx->hstatus |= HSTATUS_SPV;
 
+       /* By default, make CY, TM, and IR counters accessible in VU mode */
+       reset_csr->scounteren = 0x7;
+
        /* Setup VCPU timer */
        kvm_riscv_vcpu_timer_init(vcpu);
 
@@ -699,6 +703,20 @@ static void kvm_riscv_update_hvip(struct kvm_vcpu *vcpu)
        csr_write(CSR_HVIP, csr->hvip);
 }
 
+/*
+ * Actually run the vCPU, entering an RCU extended quiescent state (EQS) while
+ * the vCPU is running.
+ *
+ * This must be noinstr as instrumentation may make use of RCU, and this is not
+ * safe during the EQS.
+ */
+static void noinstr kvm_riscv_vcpu_enter_exit(struct kvm_vcpu *vcpu)
+{
+       guest_state_enter_irqoff();
+       __kvm_riscv_switch_to(&vcpu->arch);
+       guest_state_exit_irqoff();
+}
+
 int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
 {
        int ret;
@@ -790,9 +808,9 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
                        continue;
                }
 
-               guest_enter_irqoff();
+               guest_timing_enter_irqoff();
 
-               __kvm_riscv_switch_to(&vcpu->arch);
+               kvm_riscv_vcpu_enter_exit(vcpu);
 
                vcpu->mode = OUTSIDE_GUEST_MODE;
                vcpu->stat.exits++;
@@ -812,25 +830,21 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
                kvm_riscv_vcpu_sync_interrupts(vcpu);
 
                /*
-                * We may have taken a host interrupt in VS/VU-mode (i.e.
-                * while executing the guest). This interrupt is still
-                * pending, as we haven't serviced it yet!
+                * We must ensure that any pending interrupts are taken before
+                * we exit guest timing so that timer ticks are accounted as
+                * guest time. Transiently unmask interrupts so that any
+                * pending interrupts are taken.
                 *
-                * We're now back in HS-mode with interrupts disabled
-                * so enabling the interrupts now will have the effect
-                * of taking the interrupt again, in HS-mode this time.
+                * There's no barrier which ensures that pending interrupts are
+                * recognised, so we just hope that the CPU takes any pending
+                * interrupts between the enable and disable.
                 */
                local_irq_enable();
+               local_irq_disable();
 
-               /*
-                * We do local_irq_enable() before calling guest_exit() so
-                * that if a timer interrupt hits while running the guest
-                * we account that tick as being spent in the guest. We
-                * enable preemption after calling guest_exit() so that if
-                * we get preempted we make sure ticks after that is not
-                * counted as guest time.
-                */
-               guest_exit();
+               guest_timing_exit_irqoff();
+
+               local_irq_enable();
 
                preempt_enable();
 
index 4ecf377..48f4310 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/errno.h>
 #include <linux/err.h>
 #include <linux/kvm_host.h>
+#include <linux/version.h>
 #include <asm/csr.h>
 #include <asm/sbi.h>
 #include <asm/kvm_vcpu_timer.h>
@@ -32,7 +33,7 @@ static int kvm_sbi_ext_base_handler(struct kvm_vcpu *vcpu, struct kvm_run *run,
                *out_val = KVM_SBI_IMPID;
                break;
        case SBI_EXT_BASE_GET_IMP_VERSION:
-               *out_val = 0;
+               *out_val = LINUX_VERSION_CODE;
                break;
        case SBI_EXT_BASE_PROBE_EXT:
                if ((cp->a0 >= SBI_EXT_EXPERIMENTAL_START &&
index 9750f92..be9f39f 100644 (file)
@@ -945,6 +945,9 @@ config S390_GUEST
 
 endmenu
 
+config S390_MODULES_SANITY_TEST_HELPERS
+       def_bool n
+
 menu "Selftests"
 
 config S390_UNWIND_SELFTEST
@@ -971,4 +974,16 @@ config S390_KPROBES_SANITY_TEST
 
          Say N if you are unsure.
 
+config S390_MODULES_SANITY_TEST
+       def_tristate n
+       depends on KUNIT
+       default KUNIT_ALL_TESTS
+       prompt "Enable s390 specific modules tests"
+       select S390_MODULES_SANITY_TEST_HELPERS
+       help
+         This option enables an s390 specific modules test. This option is
+         not useful for distributions or general kernels, but only for
+         kernel developers working on architecture code.
+
+         Say N if you are unsure.
 endmenu
index 7fe8975..498bed9 100644 (file)
@@ -63,6 +63,7 @@ CONFIG_APPLDATA_BASE=y
 CONFIG_KVM=m
 CONFIG_S390_UNWIND_SELFTEST=m
 CONFIG_S390_KPROBES_SANITY_TEST=m
+CONFIG_S390_MODULES_SANITY_TEST=m
 CONFIG_KPROBES=y
 CONFIG_JUMP_LABEL=y
 CONFIG_STATIC_KEYS_SELFTEST=y
@@ -96,7 +97,6 @@ CONFIG_MEMORY_HOTPLUG=y
 CONFIG_MEMORY_HOTREMOVE=y
 CONFIG_KSM=y
 CONFIG_TRANSPARENT_HUGEPAGE=y
-CONFIG_FRONTSWAP=y
 CONFIG_CMA_DEBUG=y
 CONFIG_CMA_DEBUGFS=y
 CONFIG_CMA_SYSFS=y
@@ -109,6 +109,7 @@ CONFIG_DEFERRED_STRUCT_PAGE_INIT=y
 CONFIG_IDLE_PAGE_TRACKING=y
 CONFIG_PERCPU_STATS=y
 CONFIG_GUP_TEST=y
+CONFIG_ANON_VMA_NAME=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_PACKET_DIAG=m
@@ -116,7 +117,6 @@ CONFIG_UNIX=y
 CONFIG_UNIX_DIAG=m
 CONFIG_XFRM_USER=m
 CONFIG_NET_KEY=m
-CONFIG_NET_SWITCHDEV=y
 CONFIG_SMC=m
 CONFIG_SMC_DIAG=m
 CONFIG_INET=y
@@ -185,7 +185,6 @@ CONFIG_NF_CT_NETLINK_TIMEOUT=m
 CONFIG_NF_TABLES=m
 CONFIG_NF_TABLES_INET=y
 CONFIG_NFT_CT=m
-CONFIG_NFT_COUNTER=m
 CONFIG_NFT_LOG=m
 CONFIG_NFT_LIMIT=m
 CONFIG_NFT_NAT=m
@@ -391,6 +390,7 @@ CONFIG_OPENVSWITCH=m
 CONFIG_VSOCKETS=m
 CONFIG_VIRTIO_VSOCKETS=m
 CONFIG_NETLINK_DIAG=m
+CONFIG_NET_SWITCHDEV=y
 CONFIG_CGROUP_NET_PRIO=y
 CONFIG_NET_PKTGEN=m
 CONFIG_PCI=y
@@ -400,6 +400,7 @@ CONFIG_PCI_IOV=y
 CONFIG_HOTPLUG_PCI=y
 CONFIG_HOTPLUG_PCI_S390=y
 CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_SAFE=y
 CONFIG_CONNECTOR=y
 CONFIG_ZRAM=y
 CONFIG_BLK_DEV_LOOP=m
@@ -501,6 +502,7 @@ CONFIG_NLMON=m
 # CONFIG_NET_VENDOR_DEC is not set
 # CONFIG_NET_VENDOR_DLINK is not set
 # CONFIG_NET_VENDOR_EMULEX is not set
+# CONFIG_NET_VENDOR_ENGLEDER is not set
 # CONFIG_NET_VENDOR_EZCHIP is not set
 # CONFIG_NET_VENDOR_GOOGLE is not set
 # CONFIG_NET_VENDOR_HUAWEI is not set
@@ -511,7 +513,6 @@ CONFIG_NLMON=m
 CONFIG_MLX4_EN=m
 CONFIG_MLX5_CORE=m
 CONFIG_MLX5_CORE_EN=y
-CONFIG_MLX5_ESWITCH=y
 # CONFIG_NET_VENDOR_MICREL is not set
 # CONFIG_NET_VENDOR_MICROCHIP is not set
 # CONFIG_NET_VENDOR_MICROSEMI is not set
@@ -542,6 +543,7 @@ CONFIG_MLX5_ESWITCH=y
 # CONFIG_NET_VENDOR_SYNOPSYS is not set
 # CONFIG_NET_VENDOR_TEHUTI is not set
 # CONFIG_NET_VENDOR_TI is not set
+# CONFIG_NET_VENDOR_VERTEXCOM is not set
 # CONFIG_NET_VENDOR_VIA is not set
 # CONFIG_NET_VENDOR_WIZNET is not set
 # CONFIG_NET_VENDOR_XILINX is not set
@@ -592,6 +594,7 @@ CONFIG_VIRTIO_BALLOON=m
 CONFIG_VIRTIO_INPUT=y
 CONFIG_VHOST_NET=m
 CONFIG_VHOST_VSOCK=m
+# CONFIG_SURFACE_PLATFORMS is not set
 CONFIG_S390_CCW_IOMMU=y
 CONFIG_S390_AP_IOMMU=y
 CONFIG_EXT4_FS=y
@@ -756,9 +759,6 @@ CONFIG_CRYPTO_USER_API_SKCIPHER=m
 CONFIG_CRYPTO_USER_API_RNG=m
 CONFIG_CRYPTO_USER_API_AEAD=m
 CONFIG_CRYPTO_STATS=y
-CONFIG_CRYPTO_LIB_BLAKE2S=m
-CONFIG_CRYPTO_LIB_CURVE25519=m
-CONFIG_CRYPTO_LIB_CHACHA20POLY1305=m
 CONFIG_ZCRYPT=m
 CONFIG_PKEY=m
 CONFIG_CRYPTO_PAES_S390=m
@@ -774,6 +774,8 @@ CONFIG_CRYPTO_GHASH_S390=m
 CONFIG_CRYPTO_CRC32_S390=y
 CONFIG_CRYPTO_DEV_VIRTIO=m
 CONFIG_CORDIC=m
+CONFIG_CRYPTO_LIB_CURVE25519=m
+CONFIG_CRYPTO_LIB_CHACHA20POLY1305=m
 CONFIG_CRC32_SELFTEST=y
 CONFIG_CRC4=m
 CONFIG_CRC7=m
@@ -807,7 +809,6 @@ CONFIG_SLUB_DEBUG_ON=y
 CONFIG_SLUB_STATS=y
 CONFIG_DEBUG_STACK_USAGE=y
 CONFIG_DEBUG_VM=y
-CONFIG_DEBUG_VM_VMACACHE=y
 CONFIG_DEBUG_VM_PGFLAGS=y
 CONFIG_DEBUG_MEMORY_INIT=y
 CONFIG_MEMORY_NOTIFIER_ERROR_INJECT=m
@@ -819,12 +820,11 @@ CONFIG_PANIC_ON_OOPS=y
 CONFIG_DETECT_HUNG_TASK=y
 CONFIG_WQ_WATCHDOG=y
 CONFIG_TEST_LOCKUP=m
-CONFIG_DEBUG_TIMEKEEPING=y
 CONFIG_PROVE_LOCKING=y
 CONFIG_LOCK_STAT=y
-CONFIG_DEBUG_LOCKDEP=y
 CONFIG_DEBUG_ATOMIC_SLEEP=y
 CONFIG_DEBUG_LOCKING_API_SELFTESTS=y
+CONFIG_DEBUG_IRQFLAGS=y
 CONFIG_DEBUG_SG=y
 CONFIG_DEBUG_NOTIFIERS=y
 CONFIG_BUG_ON_DATA_CORRUPTION=y
index 466780c..61e36b9 100644 (file)
@@ -61,6 +61,7 @@ CONFIG_APPLDATA_BASE=y
 CONFIG_KVM=m
 CONFIG_S390_UNWIND_SELFTEST=m
 CONFIG_S390_KPROBES_SANITY_TEST=m
+CONFIG_S390_MODULES_SANITY_TEST=m
 CONFIG_KPROBES=y
 CONFIG_JUMP_LABEL=y
 # CONFIG_GCC_PLUGINS is not set
@@ -91,7 +92,6 @@ CONFIG_MEMORY_HOTPLUG=y
 CONFIG_MEMORY_HOTREMOVE=y
 CONFIG_KSM=y
 CONFIG_TRANSPARENT_HUGEPAGE=y
-CONFIG_FRONTSWAP=y
 CONFIG_CMA_SYSFS=y
 CONFIG_CMA_AREAS=7
 CONFIG_MEM_SOFT_DIRTY=y
@@ -101,6 +101,7 @@ CONFIG_ZSMALLOC_STAT=y
 CONFIG_DEFERRED_STRUCT_PAGE_INIT=y
 CONFIG_IDLE_PAGE_TRACKING=y
 CONFIG_PERCPU_STATS=y
+CONFIG_ANON_VMA_NAME=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_PACKET_DIAG=m
@@ -108,7 +109,6 @@ CONFIG_UNIX=y
 CONFIG_UNIX_DIAG=m
 CONFIG_XFRM_USER=m
 CONFIG_NET_KEY=m
-CONFIG_NET_SWITCHDEV=y
 CONFIG_SMC=m
 CONFIG_SMC_DIAG=m
 CONFIG_INET=y
@@ -177,7 +177,6 @@ CONFIG_NF_CT_NETLINK_TIMEOUT=m
 CONFIG_NF_TABLES=m
 CONFIG_NF_TABLES_INET=y
 CONFIG_NFT_CT=m
-CONFIG_NFT_COUNTER=m
 CONFIG_NFT_LOG=m
 CONFIG_NFT_LIMIT=m
 CONFIG_NFT_NAT=m
@@ -382,6 +381,7 @@ CONFIG_OPENVSWITCH=m
 CONFIG_VSOCKETS=m
 CONFIG_VIRTIO_VSOCKETS=m
 CONFIG_NETLINK_DIAG=m
+CONFIG_NET_SWITCHDEV=y
 CONFIG_CGROUP_NET_PRIO=y
 CONFIG_NET_PKTGEN=m
 CONFIG_PCI=y
@@ -391,6 +391,7 @@ CONFIG_HOTPLUG_PCI=y
 CONFIG_HOTPLUG_PCI_S390=y
 CONFIG_UEVENT_HELPER=y
 CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_SAFE=y
 CONFIG_CONNECTOR=y
 CONFIG_ZRAM=y
 CONFIG_BLK_DEV_LOOP=m
@@ -492,6 +493,7 @@ CONFIG_NLMON=m
 # CONFIG_NET_VENDOR_DEC is not set
 # CONFIG_NET_VENDOR_DLINK is not set
 # CONFIG_NET_VENDOR_EMULEX is not set
+# CONFIG_NET_VENDOR_ENGLEDER is not set
 # CONFIG_NET_VENDOR_EZCHIP is not set
 # CONFIG_NET_VENDOR_GOOGLE is not set
 # CONFIG_NET_VENDOR_HUAWEI is not set
@@ -502,7 +504,6 @@ CONFIG_NLMON=m
 CONFIG_MLX4_EN=m
 CONFIG_MLX5_CORE=m
 CONFIG_MLX5_CORE_EN=y
-CONFIG_MLX5_ESWITCH=y
 # CONFIG_NET_VENDOR_MICREL is not set
 # CONFIG_NET_VENDOR_MICROCHIP is not set
 # CONFIG_NET_VENDOR_MICROSEMI is not set
@@ -533,6 +534,7 @@ CONFIG_MLX5_ESWITCH=y
 # CONFIG_NET_VENDOR_SYNOPSYS is not set
 # CONFIG_NET_VENDOR_TEHUTI is not set
 # CONFIG_NET_VENDOR_TI is not set
+# CONFIG_NET_VENDOR_VERTEXCOM is not set
 # CONFIG_NET_VENDOR_VIA is not set
 # CONFIG_NET_VENDOR_WIZNET is not set
 # CONFIG_NET_VENDOR_XILINX is not set
@@ -582,6 +584,7 @@ CONFIG_VIRTIO_BALLOON=m
 CONFIG_VIRTIO_INPUT=y
 CONFIG_VHOST_NET=m
 CONFIG_VHOST_VSOCK=m
+# CONFIG_SURFACE_PLATFORMS is not set
 CONFIG_S390_CCW_IOMMU=y
 CONFIG_S390_AP_IOMMU=y
 CONFIG_EXT4_FS=y
@@ -743,9 +746,6 @@ CONFIG_CRYPTO_USER_API_SKCIPHER=m
 CONFIG_CRYPTO_USER_API_RNG=m
 CONFIG_CRYPTO_USER_API_AEAD=m
 CONFIG_CRYPTO_STATS=y
-CONFIG_CRYPTO_LIB_BLAKE2S=m
-CONFIG_CRYPTO_LIB_CURVE25519=m
-CONFIG_CRYPTO_LIB_CHACHA20POLY1305=m
 CONFIG_ZCRYPT=m
 CONFIG_PKEY=m
 CONFIG_CRYPTO_PAES_S390=m
@@ -762,6 +762,8 @@ CONFIG_CRYPTO_CRC32_S390=y
 CONFIG_CRYPTO_DEV_VIRTIO=m
 CONFIG_CORDIC=m
 CONFIG_PRIME_NUMBERS=m
+CONFIG_CRYPTO_LIB_CURVE25519=m
+CONFIG_CRYPTO_LIB_CHACHA20POLY1305=m
 CONFIG_CRC4=m
 CONFIG_CRC7=m
 CONFIG_CRC8=m
index eed3b9a..c55c668 100644 (file)
@@ -1,6 +1,7 @@
 # CONFIG_SWAP is not set
 CONFIG_NO_HZ_IDLE=y
 CONFIG_HIGH_RES_TIMERS=y
+CONFIG_BPF_SYSCALL=y
 # CONFIG_CPU_ISOLATION is not set
 # CONFIG_UTS_NS is not set
 # CONFIG_TIME_NS is not set
@@ -34,6 +35,7 @@ CONFIG_NET=y
 # CONFIG_PCPU_DEV_REFCNT is not set
 # CONFIG_ETHTOOL_NETLINK is not set
 CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_SAFE=y
 CONFIG_BLK_DEV_RAM=y
 # CONFIG_DCSSBLK is not set
 # CONFIG_DASD is not set
@@ -58,6 +60,7 @@ CONFIG_ZFCP=y
 # CONFIG_HID is not set
 # CONFIG_VIRTIO_MENU is not set
 # CONFIG_VHOST_MENU is not set
+# CONFIG_SURFACE_PLATFORMS is not set
 # CONFIG_IOMMU_SUPPORT is not set
 # CONFIG_DNOTIFY is not set
 # CONFIG_INOTIFY_USER is not set
index 33f973f..e8f15db 100644 (file)
@@ -20,6 +20,7 @@
 
 static char local_guest[] = "        ";
 static char all_guests[] = "*       ";
+static char *all_groups = all_guests;
 static char *guest_query;
 
 struct diag2fc_data {
@@ -62,10 +63,11 @@ static int diag2fc(int size, char* query, void *addr)
 
        memcpy(parm_list.userid, query, NAME_LEN);
        ASCEBC(parm_list.userid, NAME_LEN);
-       parm_list.addr = (unsigned long) addr ;
+       memcpy(parm_list.aci_grp, all_groups, NAME_LEN);
+       ASCEBC(parm_list.aci_grp, NAME_LEN);
+       parm_list.addr = (unsigned long)addr;
        parm_list.size = size;
        parm_list.fmt = 0x02;
-       memset(parm_list.aci_grp, 0x40, NAME_LEN);
        rc = -1;
 
        diag_stat_inc(DIAG_STAT_X2FC);
index 147cb35..d74e26b 100644 (file)
@@ -47,8 +47,6 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n);
 int __put_user_bad(void) __attribute__((noreturn));
 int __get_user_bad(void) __attribute__((noreturn));
 
-#ifdef CONFIG_HAVE_MARCH_Z10_FEATURES
-
 union oac {
        unsigned int val;
        struct {
@@ -71,6 +69,8 @@ union oac {
        };
 };
 
+#ifdef CONFIG_HAVE_MARCH_Z10_FEATURES
+
 #define __put_get_user_asm(to, from, size, oac_spec)                   \
 ({                                                                     \
        int __rc;                                                       \
index d52d853..b032e55 100644 (file)
@@ -33,7 +33,7 @@
 #define DEBUGP(fmt , ...)
 #endif
 
-#define PLT_ENTRY_SIZE 20
+#define PLT_ENTRY_SIZE 22
 
 void *module_alloc(unsigned long size)
 {
@@ -341,27 +341,26 @@ static int apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
        case R_390_PLTOFF32:    /* 32 bit offset from GOT to PLT. */
        case R_390_PLTOFF64:    /* 16 bit offset from GOT to PLT. */
                if (info->plt_initialized == 0) {
-                       unsigned int insn[5];
-                       unsigned int *ip = me->core_layout.base +
-                                          me->arch.plt_offset +
-                                          info->plt_offset;
-
-                       insn[0] = 0x0d10e310;   /* basr 1,0  */
-                       insn[1] = 0x100a0004;   /* lg   1,10(1) */
+                       unsigned char insn[PLT_ENTRY_SIZE];
+                       char *plt_base;
+                       char *ip;
+
+                       plt_base = me->core_layout.base + me->arch.plt_offset;
+                       ip = plt_base + info->plt_offset;
+                       *(int *)insn = 0x0d10e310;      /* basr 1,0  */
+                       *(int *)&insn[4] = 0x100c0004;  /* lg   1,12(1) */
                        if (IS_ENABLED(CONFIG_EXPOLINE) && !nospec_disable) {
-                               unsigned int *ij;
-                               ij = me->core_layout.base +
-                                       me->arch.plt_offset +
-                                       me->arch.plt_size - PLT_ENTRY_SIZE;
-                               insn[2] = 0xa7f40000 +  /* j __jump_r1 */
-                                       (unsigned int)(u16)
-                                       (((unsigned long) ij - 8 -
-                                         (unsigned long) ip) / 2);
+                               char *jump_r1;
+
+                               jump_r1 = plt_base + me->arch.plt_size -
+                                       PLT_ENTRY_SIZE;
+                               /* brcl 0xf,__jump_r1 */
+                               *(short *)&insn[8] = 0xc0f4;
+                               *(int *)&insn[10] = (jump_r1 - (ip + 8)) / 2;
                        } else {
-                               insn[2] = 0x07f10000;   /* br %r1 */
+                               *(int *)&insn[8] = 0x07f10000;  /* br %r1 */
                        }
-                       insn[3] = (unsigned int) (val >> 32);
-                       insn[4] = (unsigned int) val;
+                       *(long *)&insn[14] = val;
 
                        write(ip, insn, sizeof(insn));
                        info->plt_initialized = 1;
index 0c9e894..651a519 100644 (file)
@@ -264,7 +264,14 @@ static int notrace s390_validate_registers(union mci mci, int umode)
                /* Validate vector registers */
                union ctlreg0 cr0;
 
-               if (!mci.vr) {
+               /*
+                * The vector validity must only be checked if not running a
+                * KVM guest. For KVM guests the machine check is forwarded by
+                * KVM and it is the responsibility of the guest to take
+                * appropriate actions. The host vector or FPU values have been
+                * saved by KVM and will be restored by KVM.
+                */
+               if (!mci.vr && !test_cpu_flag(CIF_MCCK_GUEST)) {
                        /*
                         * Vector registers can't be restored. If the kernel
                         * currently uses vector registers the system is
@@ -307,11 +314,21 @@ static int notrace s390_validate_registers(union mci mci, int umode)
        if (cr2.gse) {
                if (!mci.gs) {
                        /*
-                        * Guarded storage register can't be restored and
-                        * the current processes uses guarded storage.
-                        * It has to be terminated.
+                        * 2 cases:
+                        * - machine check in kernel or userspace
+                        * - machine check while running SIE (KVM guest)
+                        * For kernel or userspace the userspace values of
+                        * guarded storage control can not be recreated, the
+                        * process must be terminated.
+                        * For SIE the guest values of guarded storage can not
+                        * be recreated. This is either due to a bug or due to
+                        * GS being disabled in the guest. The guest will be
+                        * notified by KVM code and the guests machine check
+                        * handling must take care of this.  The host values
+                        * are saved by KVM and are not affected.
                         */
-                       kill_task = 1;
+                       if (!test_cpu_flag(CIF_MCCK_GUEST))
+                               kill_task = 1;
                } else {
                        load_gs_cb((struct gs_cb *)mcesa->guarded_storage_save_area);
                }
index 707cd46..69feb8e 100644 (file)
@@ -17,4 +17,7 @@ KASAN_SANITIZE_uaccess.o := n
 obj-$(CONFIG_S390_UNWIND_SELFTEST) += test_unwind.o
 CFLAGS_test_unwind.o += -fno-optimize-sibling-calls
 
+obj-$(CONFIG_S390_MODULES_SANITY_TEST) += test_modules.o
+obj-$(CONFIG_S390_MODULES_SANITY_TEST_HELPERS) += test_modules_helpers.o
+
 lib-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o
diff --git a/arch/s390/lib/test_modules.c b/arch/s390/lib/test_modules.c
new file mode 100644 (file)
index 0000000..d056baa
--- /dev/null
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+#include <kunit/test.h>
+#include <linux/module.h>
+
+#include "test_modules.h"
+
+#define DECLARE_RETURN(i) int test_modules_return_ ## i(void)
+REPEAT_10000(DECLARE_RETURN);
+
+/*
+ * Test that modules with many relocations are loaded properly.
+ */
+static void test_modules_many_vmlinux_relocs(struct kunit *test)
+{
+       int result = 0;
+
+#define CALL_RETURN(i) result += test_modules_return_ ## i()
+       REPEAT_10000(CALL_RETURN);
+       KUNIT_ASSERT_EQ(test, result, 49995000);
+}
+
+static struct kunit_case modules_testcases[] = {
+       KUNIT_CASE(test_modules_many_vmlinux_relocs),
+       {}
+};
+
+static struct kunit_suite modules_test_suite = {
+       .name = "modules_test_s390",
+       .test_cases = modules_testcases,
+};
+
+kunit_test_suites(&modules_test_suite);
+
+MODULE_LICENSE("GPL");
diff --git a/arch/s390/lib/test_modules.h b/arch/s390/lib/test_modules.h
new file mode 100644 (file)
index 0000000..43b5e4b
--- /dev/null
@@ -0,0 +1,50 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+#ifndef TEST_MODULES_H
+#define TEST_MODULES_H
+
+#define __REPEAT_10000_3(f, x) \
+       f(x ## 0); \
+       f(x ## 1); \
+       f(x ## 2); \
+       f(x ## 3); \
+       f(x ## 4); \
+       f(x ## 5); \
+       f(x ## 6); \
+       f(x ## 7); \
+       f(x ## 8); \
+       f(x ## 9)
+#define __REPEAT_10000_2(f, x) \
+       __REPEAT_10000_3(f, x ## 0); \
+       __REPEAT_10000_3(f, x ## 1); \
+       __REPEAT_10000_3(f, x ## 2); \
+       __REPEAT_10000_3(f, x ## 3); \
+       __REPEAT_10000_3(f, x ## 4); \
+       __REPEAT_10000_3(f, x ## 5); \
+       __REPEAT_10000_3(f, x ## 6); \
+       __REPEAT_10000_3(f, x ## 7); \
+       __REPEAT_10000_3(f, x ## 8); \
+       __REPEAT_10000_3(f, x ## 9)
+#define __REPEAT_10000_1(f, x) \
+       __REPEAT_10000_2(f, x ## 0); \
+       __REPEAT_10000_2(f, x ## 1); \
+       __REPEAT_10000_2(f, x ## 2); \
+       __REPEAT_10000_2(f, x ## 3); \
+       __REPEAT_10000_2(f, x ## 4); \
+       __REPEAT_10000_2(f, x ## 5); \
+       __REPEAT_10000_2(f, x ## 6); \
+       __REPEAT_10000_2(f, x ## 7); \
+       __REPEAT_10000_2(f, x ## 8); \
+       __REPEAT_10000_2(f, x ## 9)
+#define REPEAT_10000(f) \
+       __REPEAT_10000_1(f, 0); \
+       __REPEAT_10000_1(f, 1); \
+       __REPEAT_10000_1(f, 2); \
+       __REPEAT_10000_1(f, 3); \
+       __REPEAT_10000_1(f, 4); \
+       __REPEAT_10000_1(f, 5); \
+       __REPEAT_10000_1(f, 6); \
+       __REPEAT_10000_1(f, 7); \
+       __REPEAT_10000_1(f, 8); \
+       __REPEAT_10000_1(f, 9)
+
+#endif
diff --git a/arch/s390/lib/test_modules_helpers.c b/arch/s390/lib/test_modules_helpers.c
new file mode 100644 (file)
index 0000000..1670349
--- /dev/null
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+#include <linux/export.h>
+
+#include "test_modules.h"
+
+#define DEFINE_RETURN(i) \
+       int test_modules_return_ ## i(void) \
+       { \
+               return 1 ## i - 10000; \
+       } \
+       EXPORT_SYMBOL_GPL(test_modules_return_ ## i)
+REPEAT_10000(DEFINE_RETURN);
index ebe8fc7..9f5bd41 100644 (file)
@@ -186,6 +186,7 @@ config X86
        select HAVE_CONTEXT_TRACKING_OFFSTACK   if HAVE_CONTEXT_TRACKING
        select HAVE_C_RECORDMCOUNT
        select HAVE_OBJTOOL_MCOUNT              if STACK_VALIDATION
+       select HAVE_BUILDTIME_MCOUNT_SORT
        select HAVE_DEBUG_KMEMLEAK
        select HAVE_DMA_CONTIGUOUS
        select HAVE_DYNAMIC_FTRACE
index f9e2fec..59ae28a 100644 (file)
 static int crypto_blake2s_update_x86(struct shash_desc *desc,
                                     const u8 *in, unsigned int inlen)
 {
-       return crypto_blake2s_update(desc, in, inlen, blake2s_compress);
+       return crypto_blake2s_update(desc, in, inlen, false);
 }
 
 static int crypto_blake2s_final_x86(struct shash_desc *desc, u8 *out)
 {
-       return crypto_blake2s_final(desc, out, blake2s_compress);
+       return crypto_blake2s_final(desc, out, false);
 }
 
 #define BLAKE2S_ALG(name, driver_name, digest_size)                    \
index fd9f908..a3c7ca8 100644 (file)
@@ -4703,6 +4703,19 @@ static __initconst const struct x86_pmu intel_pmu = {
        .lbr_read               = intel_pmu_lbr_read_64,
        .lbr_save               = intel_pmu_lbr_save,
        .lbr_restore            = intel_pmu_lbr_restore,
+
+       /*
+        * SMM has access to all 4 rings and while traditionally SMM code only
+        * ran in CPL0, 2021-era firmware is starting to make use of CPL3 in SMM.
+        *
+        * Since the EVENTSEL.{USR,OS} CPL filtering makes no distinction
+        * between SMM or not, this results in what should be pure userspace
+        * counters including SMM data.
+        *
+        * This is a clear privilege issue, therefore globally disable
+        * counting SMM by default.
+        */
+       .attr_freeze_on_smi     = 1,
 };
 
 static __init void intel_clovertown_quirk(void)
@@ -6236,6 +6249,19 @@ __init int intel_pmu_init(void)
                        pmu->num_counters = x86_pmu.num_counters;
                        pmu->num_counters_fixed = x86_pmu.num_counters_fixed;
                }
+
+               /*
+                * Quirk: For some Alder Lake machine, when all E-cores are disabled in
+                * a BIOS, the leaf 0xA will enumerate all counters of P-cores. However,
+                * the X86_FEATURE_HYBRID_CPU is still set. The above codes will
+                * mistakenly add extra counters for P-cores. Correct the number of
+                * counters here.
+                */
+               if ((pmu->num_counters > 8) || (pmu->num_counters_fixed > 4)) {
+                       pmu->num_counters = x86_pmu.num_counters;
+                       pmu->num_counters_fixed = x86_pmu.num_counters_fixed;
+               }
+
                pmu->max_pebs_events = min_t(unsigned, MAX_PEBS_EVENTS, pmu->num_counters);
                pmu->unconstrained = (struct event_constraint)
                                        __EVENT_CONSTRAINT(0, (1ULL << pmu->num_counters) - 1,
@@ -6340,6 +6366,8 @@ __init int intel_pmu_init(void)
        }
 
        if (x86_pmu.lbr_nr) {
+               intel_pmu_lbr_init();
+
                pr_cont("%d-deep LBR, ", x86_pmu.lbr_nr);
 
                /* only support branch_stack snapshot for perfmon >= v2 */
index 8043213..669c2be 100644 (file)
@@ -8,14 +8,6 @@
 
 #include "../perf_event.h"
 
-static const enum {
-       LBR_EIP_FLAGS           = 1,
-       LBR_TSX                 = 2,
-} lbr_desc[LBR_FORMAT_MAX_KNOWN + 1] = {
-       [LBR_FORMAT_EIP_FLAGS]  = LBR_EIP_FLAGS,
-       [LBR_FORMAT_EIP_FLAGS2] = LBR_EIP_FLAGS | LBR_TSX,
-};
-
 /*
  * Intel LBR_SELECT bits
  * Intel Vol3a, April 2011, Section 16.7 Table 16-10
@@ -243,7 +235,7 @@ void intel_pmu_lbr_reset_64(void)
        for (i = 0; i < x86_pmu.lbr_nr; i++) {
                wrmsrl(x86_pmu.lbr_from + i, 0);
                wrmsrl(x86_pmu.lbr_to   + i, 0);
-               if (x86_pmu.intel_cap.lbr_format == LBR_FORMAT_INFO)
+               if (x86_pmu.lbr_has_info)
                        wrmsrl(x86_pmu.lbr_info + i, 0);
        }
 }
@@ -305,11 +297,10 @@ enum {
  */
 static inline bool lbr_from_signext_quirk_needed(void)
 {
-       int lbr_format = x86_pmu.intel_cap.lbr_format;
        bool tsx_support = boot_cpu_has(X86_FEATURE_HLE) ||
                           boot_cpu_has(X86_FEATURE_RTM);
 
-       return !tsx_support && (lbr_desc[lbr_format] & LBR_TSX);
+       return !tsx_support && x86_pmu.lbr_has_tsx;
 }
 
 static DEFINE_STATIC_KEY_FALSE(lbr_from_quirk_key);
@@ -427,12 +418,12 @@ rdlbr_all(struct lbr_entry *lbr, unsigned int idx, bool need_info)
 
 void intel_pmu_lbr_restore(void *ctx)
 {
-       bool need_info = x86_pmu.intel_cap.lbr_format == LBR_FORMAT_INFO;
        struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
        struct x86_perf_task_context *task_ctx = ctx;
-       int i;
-       unsigned lbr_idx, mask;
+       bool need_info = x86_pmu.lbr_has_info;
        u64 tos = task_ctx->tos;
+       unsigned lbr_idx, mask;
+       int i;
 
        mask = x86_pmu.lbr_nr - 1;
        for (i = 0; i < task_ctx->valid_lbrs; i++) {
@@ -444,7 +435,7 @@ void intel_pmu_lbr_restore(void *ctx)
                lbr_idx = (tos - i) & mask;
                wrlbr_from(lbr_idx, 0);
                wrlbr_to(lbr_idx, 0);
-               if (x86_pmu.intel_cap.lbr_format == LBR_FORMAT_INFO)
+               if (need_info)
                        wrlbr_info(lbr_idx, 0);
        }
 
@@ -519,9 +510,9 @@ static void __intel_pmu_lbr_restore(void *ctx)
 
 void intel_pmu_lbr_save(void *ctx)
 {
-       bool need_info = x86_pmu.intel_cap.lbr_format == LBR_FORMAT_INFO;
        struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
        struct x86_perf_task_context *task_ctx = ctx;
+       bool need_info = x86_pmu.lbr_has_info;
        unsigned lbr_idx, mask;
        u64 tos;
        int i;
@@ -816,7 +807,6 @@ void intel_pmu_lbr_read_64(struct cpu_hw_events *cpuc)
 {
        bool need_info = false, call_stack = false;
        unsigned long mask = x86_pmu.lbr_nr - 1;
-       int lbr_format = x86_pmu.intel_cap.lbr_format;
        u64 tos = intel_pmu_lbr_tos();
        int i;
        int out = 0;
@@ -831,9 +821,7 @@ void intel_pmu_lbr_read_64(struct cpu_hw_events *cpuc)
        for (i = 0; i < num; i++) {
                unsigned long lbr_idx = (tos - i) & mask;
                u64 from, to, mis = 0, pred = 0, in_tx = 0, abort = 0;
-               int skip = 0;
                u16 cycles = 0;
-               int lbr_flags = lbr_desc[lbr_format];
 
                from = rdlbr_from(lbr_idx, NULL);
                to   = rdlbr_to(lbr_idx, NULL);
@@ -845,37 +833,39 @@ void intel_pmu_lbr_read_64(struct cpu_hw_events *cpuc)
                if (call_stack && !from)
                        break;
 
-               if (lbr_format == LBR_FORMAT_INFO && need_info) {
-                       u64 info;
-
-                       info = rdlbr_info(lbr_idx, NULL);
-                       mis = !!(info & LBR_INFO_MISPRED);
-                       pred = !mis;
-                       in_tx = !!(info & LBR_INFO_IN_TX);
-                       abort = !!(info & LBR_INFO_ABORT);
-                       cycles = (info & LBR_INFO_CYCLES);
-               }
-
-               if (lbr_format == LBR_FORMAT_TIME) {
-                       mis = !!(from & LBR_FROM_FLAG_MISPRED);
-                       pred = !mis;
-                       skip = 1;
-                       cycles = ((to >> 48) & LBR_INFO_CYCLES);
-
-                       to = (u64)((((s64)to) << 16) >> 16);
-               }
-
-               if (lbr_flags & LBR_EIP_FLAGS) {
-                       mis = !!(from & LBR_FROM_FLAG_MISPRED);
-                       pred = !mis;
-                       skip = 1;
-               }
-               if (lbr_flags & LBR_TSX) {
-                       in_tx = !!(from & LBR_FROM_FLAG_IN_TX);
-                       abort = !!(from & LBR_FROM_FLAG_ABORT);
-                       skip = 3;
+               if (x86_pmu.lbr_has_info) {
+                       if (need_info) {
+                               u64 info;
+
+                               info = rdlbr_info(lbr_idx, NULL);
+                               mis = !!(info & LBR_INFO_MISPRED);
+                               pred = !mis;
+                               cycles = (info & LBR_INFO_CYCLES);
+                               if (x86_pmu.lbr_has_tsx) {
+                                       in_tx = !!(info & LBR_INFO_IN_TX);
+                                       abort = !!(info & LBR_INFO_ABORT);
+                               }
+                       }
+               } else {
+                       int skip = 0;
+
+                       if (x86_pmu.lbr_from_flags) {
+                               mis = !!(from & LBR_FROM_FLAG_MISPRED);
+                               pred = !mis;
+                               skip = 1;
+                       }
+                       if (x86_pmu.lbr_has_tsx) {
+                               in_tx = !!(from & LBR_FROM_FLAG_IN_TX);
+                               abort = !!(from & LBR_FROM_FLAG_ABORT);
+                               skip = 3;
+                       }
+                       from = (u64)((((s64)from) << skip) >> skip);
+
+                       if (x86_pmu.lbr_to_cycles) {
+                               cycles = ((to >> 48) & LBR_INFO_CYCLES);
+                               to = (u64)((((s64)to) << 16) >> 16);
+                       }
                }
-               from = (u64)((((s64)from) << skip) >> skip);
 
                /*
                 * Some CPUs report duplicated abort records,
@@ -903,37 +893,40 @@ void intel_pmu_lbr_read_64(struct cpu_hw_events *cpuc)
        cpuc->lbr_stack.hw_idx = tos;
 }
 
+static DEFINE_STATIC_KEY_FALSE(x86_lbr_mispred);
+static DEFINE_STATIC_KEY_FALSE(x86_lbr_cycles);
+static DEFINE_STATIC_KEY_FALSE(x86_lbr_type);
+
 static __always_inline int get_lbr_br_type(u64 info)
 {
-       if (!static_cpu_has(X86_FEATURE_ARCH_LBR) || !x86_pmu.lbr_br_type)
-               return 0;
+       int type = 0;
 
-       return (info & LBR_INFO_BR_TYPE) >> LBR_INFO_BR_TYPE_OFFSET;
+       if (static_branch_likely(&x86_lbr_type))
+               type = (info & LBR_INFO_BR_TYPE) >> LBR_INFO_BR_TYPE_OFFSET;
+
+       return type;
 }
 
 static __always_inline bool get_lbr_mispred(u64 info)
 {
-       if (static_cpu_has(X86_FEATURE_ARCH_LBR) && !x86_pmu.lbr_mispred)
-               return 0;
+       bool mispred = 0;
 
-       return !!(info & LBR_INFO_MISPRED);
-}
+       if (static_branch_likely(&x86_lbr_mispred))
+               mispred = !!(info & LBR_INFO_MISPRED);
 
-static __always_inline bool get_lbr_predicted(u64 info)
-{
-       if (static_cpu_has(X86_FEATURE_ARCH_LBR) && !x86_pmu.lbr_mispred)
-               return 0;
-
-       return !(info & LBR_INFO_MISPRED);
+       return mispred;
 }
 
 static __always_inline u16 get_lbr_cycles(u64 info)
 {
+       u16 cycles = info & LBR_INFO_CYCLES;
+
        if (static_cpu_has(X86_FEATURE_ARCH_LBR) &&
-           !(x86_pmu.lbr_timed_lbr && info & LBR_INFO_CYC_CNT_VALID))
-               return 0;
+           (!static_branch_likely(&x86_lbr_cycles) ||
+            !(info & LBR_INFO_CYC_CNT_VALID)))
+               cycles = 0;
 
-       return info & LBR_INFO_CYCLES;
+       return cycles;
 }
 
 static void intel_pmu_store_lbr(struct cpu_hw_events *cpuc,
@@ -961,7 +954,7 @@ static void intel_pmu_store_lbr(struct cpu_hw_events *cpuc,
                e->from         = from;
                e->to           = to;
                e->mispred      = get_lbr_mispred(info);
-               e->predicted    = get_lbr_predicted(info);
+               e->predicted    = !e->mispred;
                e->in_tx        = !!(info & LBR_INFO_IN_TX);
                e->abort        = !!(info & LBR_INFO_ABORT);
                e->cycles       = get_lbr_cycles(info);
@@ -1120,7 +1113,7 @@ static int intel_pmu_setup_hw_lbr_filter(struct perf_event *event)
 
        if ((br_type & PERF_SAMPLE_BRANCH_NO_CYCLES) &&
            (br_type & PERF_SAMPLE_BRANCH_NO_FLAGS) &&
-           (x86_pmu.intel_cap.lbr_format == LBR_FORMAT_INFO))
+           x86_pmu.lbr_has_info)
                reg->config |= LBR_NO_INFO;
 
        return 0;
@@ -1706,6 +1699,38 @@ void intel_pmu_lbr_init_knl(void)
                x86_pmu.intel_cap.lbr_format = LBR_FORMAT_EIP_FLAGS;
 }
 
+void intel_pmu_lbr_init(void)
+{
+       switch (x86_pmu.intel_cap.lbr_format) {
+       case LBR_FORMAT_EIP_FLAGS2:
+               x86_pmu.lbr_has_tsx = 1;
+               fallthrough;
+       case LBR_FORMAT_EIP_FLAGS:
+               x86_pmu.lbr_from_flags = 1;
+               break;
+
+       case LBR_FORMAT_INFO:
+               x86_pmu.lbr_has_tsx = 1;
+               fallthrough;
+       case LBR_FORMAT_INFO2:
+               x86_pmu.lbr_has_info = 1;
+               break;
+
+       case LBR_FORMAT_TIME:
+               x86_pmu.lbr_from_flags = 1;
+               x86_pmu.lbr_to_cycles = 1;
+               break;
+       }
+
+       if (x86_pmu.lbr_has_info) {
+               /*
+                * Only used in combination with baseline pebs.
+                */
+               static_branch_enable(&x86_lbr_mispred);
+               static_branch_enable(&x86_lbr_cycles);
+       }
+}
+
 /*
  * LBR state size is variable based on the max number of registers.
  * This calculates the expected state size, which should match
@@ -1726,6 +1751,9 @@ static bool is_arch_lbr_xsave_available(void)
         * Check the LBR state with the corresponding software structure.
         * Disable LBR XSAVES support if the size doesn't match.
         */
+       if (xfeature_size(XFEATURE_LBR) == 0)
+               return false;
+
        if (WARN_ON(xfeature_size(XFEATURE_LBR) != get_lbr_state_size()))
                return false;
 
@@ -1765,6 +1793,12 @@ void __init intel_pmu_arch_lbr_init(void)
        x86_pmu.lbr_br_type = ecx.split.lbr_br_type;
        x86_pmu.lbr_nr = lbr_nr;
 
+       if (x86_pmu.lbr_mispred)
+               static_branch_enable(&x86_lbr_mispred);
+       if (x86_pmu.lbr_timed_lbr)
+               static_branch_enable(&x86_lbr_cycles);
+       if (x86_pmu.lbr_br_type)
+               static_branch_enable(&x86_lbr_type);
 
        arch_lbr_xsave = is_arch_lbr_xsave_available();
        if (arch_lbr_xsave) {
index 7f406c1..2d33bba 100644 (file)
@@ -897,8 +897,9 @@ static void pt_handle_status(struct pt *pt)
                 * means we are already losing data; need to let the decoder
                 * know.
                 */
-               if (!intel_pt_validate_hw_cap(PT_CAP_topa_multiple_entries) ||
-                   buf->output_off == pt_buffer_region_size(buf)) {
+               if (!buf->single &&
+                   (!intel_pt_validate_hw_cap(PT_CAP_topa_multiple_entries) ||
+                    buf->output_off == pt_buffer_region_size(buf))) {
                        perf_aux_output_flag(&pt->handle,
                                             PERF_AUX_FLAG_TRUNCATED);
                        advance++;
index f1ba6ab..e497da9 100644 (file)
@@ -1762,7 +1762,7 @@ static const struct intel_uncore_init_fun rkl_uncore_init __initconst = {
 
 static const struct intel_uncore_init_fun adl_uncore_init __initconst = {
        .cpu_init = adl_uncore_cpu_init,
-       .mmio_init = tgl_uncore_mmio_init,
+       .mmio_init = adl_uncore_mmio_init,
 };
 
 static const struct intel_uncore_init_fun icx_uncore_init __initconst = {
index b968798..2adeaf4 100644 (file)
@@ -584,10 +584,11 @@ void snb_uncore_cpu_init(void);
 void nhm_uncore_cpu_init(void);
 void skl_uncore_cpu_init(void);
 void icl_uncore_cpu_init(void);
-void adl_uncore_cpu_init(void);
 void tgl_uncore_cpu_init(void);
+void adl_uncore_cpu_init(void);
 void tgl_uncore_mmio_init(void);
 void tgl_l_uncore_mmio_init(void);
+void adl_uncore_mmio_init(void);
 int snb_pci2phy_map_init(int devid);
 
 /* uncore_snbep.c */
index 3049c64..6ddadb4 100644 (file)
@@ -494,8 +494,8 @@ void intel_generic_uncore_mmio_enable_box(struct intel_uncore_box *box)
        writel(0, box->io_addr);
 }
 
-static void intel_generic_uncore_mmio_enable_event(struct intel_uncore_box *box,
-                                            struct perf_event *event)
+void intel_generic_uncore_mmio_enable_event(struct intel_uncore_box *box,
+                                           struct perf_event *event)
 {
        struct hw_perf_event *hwc = &event->hw;
 
index 6d73561..cfaf558 100644 (file)
@@ -139,6 +139,8 @@ void intel_generic_uncore_mmio_disable_box(struct intel_uncore_box *box);
 void intel_generic_uncore_mmio_enable_box(struct intel_uncore_box *box);
 void intel_generic_uncore_mmio_disable_event(struct intel_uncore_box *box,
                                             struct perf_event *event);
+void intel_generic_uncore_mmio_enable_event(struct intel_uncore_box *box,
+                                           struct perf_event *event);
 
 void intel_generic_uncore_pci_init_box(struct intel_uncore_box *box);
 void intel_generic_uncore_pci_disable_box(struct intel_uncore_box *box);
index 0f63706..f698a55 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 /* Nehalem/SandBridge/Haswell/Broadwell/Skylake uncore support */
 #include "uncore.h"
+#include "uncore_discovery.h"
 
 /* Uncore IMC PCI IDs */
 #define PCI_DEVICE_ID_INTEL_SNB_IMC            0x0100
 #define PCI_DEVICE_ID_INTEL_RKL_2_IMC          0x4c53
 #define PCI_DEVICE_ID_INTEL_ADL_1_IMC          0x4660
 #define PCI_DEVICE_ID_INTEL_ADL_2_IMC          0x4641
+#define PCI_DEVICE_ID_INTEL_ADL_3_IMC          0x4601
+#define PCI_DEVICE_ID_INTEL_ADL_4_IMC          0x4602
+#define PCI_DEVICE_ID_INTEL_ADL_5_IMC          0x4609
+#define PCI_DEVICE_ID_INTEL_ADL_6_IMC          0x460a
+#define PCI_DEVICE_ID_INTEL_ADL_7_IMC          0x4621
+#define PCI_DEVICE_ID_INTEL_ADL_8_IMC          0x4623
+#define PCI_DEVICE_ID_INTEL_ADL_9_IMC          0x4629
+#define PCI_DEVICE_ID_INTEL_ADL_10_IMC         0x4637
+#define PCI_DEVICE_ID_INTEL_ADL_11_IMC         0x463b
+#define PCI_DEVICE_ID_INTEL_ADL_12_IMC         0x4648
+#define PCI_DEVICE_ID_INTEL_ADL_13_IMC         0x4649
+#define PCI_DEVICE_ID_INTEL_ADL_14_IMC         0x4650
+#define PCI_DEVICE_ID_INTEL_ADL_15_IMC         0x4668
+#define PCI_DEVICE_ID_INTEL_ADL_16_IMC         0x4670
 
 /* SNB event control */
 #define SNB_UNC_CTL_EV_SEL_MASK                        0x000000ff
 
 DEFINE_UNCORE_FORMAT_ATTR(event, event, "config:0-7");
 DEFINE_UNCORE_FORMAT_ATTR(umask, umask, "config:8-15");
+DEFINE_UNCORE_FORMAT_ATTR(chmask, chmask, "config:8-11");
 DEFINE_UNCORE_FORMAT_ATTR(edge, edge, "config:18");
 DEFINE_UNCORE_FORMAT_ATTR(inv, inv, "config:23");
 DEFINE_UNCORE_FORMAT_ATTR(cmask5, cmask, "config:24-28");
@@ -1334,6 +1350,62 @@ static const struct pci_device_id tgl_uncore_pci_ids[] = {
                PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_2_IMC),
                .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
        },
+       { /* IMC */
+               PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_3_IMC),
+               .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
+       },
+       { /* IMC */
+               PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_4_IMC),
+               .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
+       },
+       { /* IMC */
+               PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_5_IMC),
+               .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
+       },
+       { /* IMC */
+               PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_6_IMC),
+               .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
+       },
+       { /* IMC */
+               PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_7_IMC),
+               .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
+       },
+       { /* IMC */
+               PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_8_IMC),
+               .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
+       },
+       { /* IMC */
+               PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_9_IMC),
+               .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
+       },
+       { /* IMC */
+               PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_10_IMC),
+               .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
+       },
+       { /* IMC */
+               PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_11_IMC),
+               .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
+       },
+       { /* IMC */
+               PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_12_IMC),
+               .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
+       },
+       { /* IMC */
+               PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_13_IMC),
+               .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
+       },
+       { /* IMC */
+               PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_14_IMC),
+               .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
+       },
+       { /* IMC */
+               PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_15_IMC),
+               .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
+       },
+       { /* IMC */
+               PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_16_IMC),
+               .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
+       },
        { /* end: all zeroes */ }
 };
 
@@ -1390,7 +1462,8 @@ static struct pci_dev *tgl_uncore_get_mc_dev(void)
 #define TGL_UNCORE_MMIO_IMC_MEM_OFFSET         0x10000
 #define TGL_UNCORE_PCI_IMC_MAP_SIZE            0xe000
 
-static void tgl_uncore_imc_freerunning_init_box(struct intel_uncore_box *box)
+static void __uncore_imc_init_box(struct intel_uncore_box *box,
+                                 unsigned int base_offset)
 {
        struct pci_dev *pdev = tgl_uncore_get_mc_dev();
        struct intel_uncore_pmu *pmu = box->pmu;
@@ -1417,11 +1490,17 @@ static void tgl_uncore_imc_freerunning_init_box(struct intel_uncore_box *box)
        addr |= ((resource_size_t)mch_bar << 32);
 #endif
 
+       addr += base_offset;
        box->io_addr = ioremap(addr, type->mmio_map_size);
        if (!box->io_addr)
                pr_warn("perf uncore: Failed to ioremap for %s.\n", type->name);
 }
 
+static void tgl_uncore_imc_freerunning_init_box(struct intel_uncore_box *box)
+{
+       __uncore_imc_init_box(box, 0);
+}
+
 static struct intel_uncore_ops tgl_uncore_imc_freerunning_ops = {
        .init_box       = tgl_uncore_imc_freerunning_init_box,
        .exit_box       = uncore_mmio_exit_box,
@@ -1469,3 +1548,136 @@ void tgl_uncore_mmio_init(void)
 }
 
 /* end of Tiger Lake MMIO uncore support */
+
+/* Alder Lake MMIO uncore support */
+#define ADL_UNCORE_IMC_BASE                    0xd900
+#define ADL_UNCORE_IMC_MAP_SIZE                        0x200
+#define ADL_UNCORE_IMC_CTR                     0xe8
+#define ADL_UNCORE_IMC_CTRL                    0xd0
+#define ADL_UNCORE_IMC_GLOBAL_CTL              0xc0
+#define ADL_UNCORE_IMC_BOX_CTL                 0xc4
+#define ADL_UNCORE_IMC_FREERUNNING_BASE                0xd800
+#define ADL_UNCORE_IMC_FREERUNNING_MAP_SIZE    0x100
+
+#define ADL_UNCORE_IMC_CTL_FRZ                 (1 << 0)
+#define ADL_UNCORE_IMC_CTL_RST_CTRL            (1 << 1)
+#define ADL_UNCORE_IMC_CTL_RST_CTRS            (1 << 2)
+#define ADL_UNCORE_IMC_CTL_INT                 (ADL_UNCORE_IMC_CTL_RST_CTRL | \
+                                               ADL_UNCORE_IMC_CTL_RST_CTRS)
+
+static void adl_uncore_imc_init_box(struct intel_uncore_box *box)
+{
+       __uncore_imc_init_box(box, ADL_UNCORE_IMC_BASE);
+
+       /* The global control in MC1 can control both MCs. */
+       if (box->io_addr && (box->pmu->pmu_idx == 1))
+               writel(ADL_UNCORE_IMC_CTL_INT, box->io_addr + ADL_UNCORE_IMC_GLOBAL_CTL);
+}
+
+static void adl_uncore_mmio_disable_box(struct intel_uncore_box *box)
+{
+       if (!box->io_addr)
+               return;
+
+       writel(ADL_UNCORE_IMC_CTL_FRZ, box->io_addr + uncore_mmio_box_ctl(box));
+}
+
+static void adl_uncore_mmio_enable_box(struct intel_uncore_box *box)
+{
+       if (!box->io_addr)
+               return;
+
+       writel(0, box->io_addr + uncore_mmio_box_ctl(box));
+}
+
+static struct intel_uncore_ops adl_uncore_mmio_ops = {
+       .init_box       = adl_uncore_imc_init_box,
+       .exit_box       = uncore_mmio_exit_box,
+       .disable_box    = adl_uncore_mmio_disable_box,
+       .enable_box     = adl_uncore_mmio_enable_box,
+       .disable_event  = intel_generic_uncore_mmio_disable_event,
+       .enable_event   = intel_generic_uncore_mmio_enable_event,
+       .read_counter   = uncore_mmio_read_counter,
+};
+
+#define ADL_UNC_CTL_CHMASK_MASK                        0x00000f00
+#define ADL_UNC_IMC_EVENT_MASK                 (SNB_UNC_CTL_EV_SEL_MASK | \
+                                                ADL_UNC_CTL_CHMASK_MASK | \
+                                                SNB_UNC_CTL_EDGE_DET)
+
+static struct attribute *adl_uncore_imc_formats_attr[] = {
+       &format_attr_event.attr,
+       &format_attr_chmask.attr,
+       &format_attr_edge.attr,
+       NULL,
+};
+
+static const struct attribute_group adl_uncore_imc_format_group = {
+       .name           = "format",
+       .attrs          = adl_uncore_imc_formats_attr,
+};
+
+static struct intel_uncore_type adl_uncore_imc = {
+       .name           = "imc",
+       .num_counters   = 5,
+       .num_boxes      = 2,
+       .perf_ctr_bits  = 64,
+       .perf_ctr       = ADL_UNCORE_IMC_CTR,
+       .event_ctl      = ADL_UNCORE_IMC_CTRL,
+       .event_mask     = ADL_UNC_IMC_EVENT_MASK,
+       .box_ctl        = ADL_UNCORE_IMC_BOX_CTL,
+       .mmio_offset    = 0,
+       .mmio_map_size  = ADL_UNCORE_IMC_MAP_SIZE,
+       .ops            = &adl_uncore_mmio_ops,
+       .format_group   = &adl_uncore_imc_format_group,
+};
+
+enum perf_adl_uncore_imc_freerunning_types {
+       ADL_MMIO_UNCORE_IMC_DATA_TOTAL,
+       ADL_MMIO_UNCORE_IMC_DATA_READ,
+       ADL_MMIO_UNCORE_IMC_DATA_WRITE,
+       ADL_MMIO_UNCORE_IMC_FREERUNNING_TYPE_MAX
+};
+
+static struct freerunning_counters adl_uncore_imc_freerunning[] = {
+       [ADL_MMIO_UNCORE_IMC_DATA_TOTAL]        = { 0x40, 0x0, 0x0, 1, 64 },
+       [ADL_MMIO_UNCORE_IMC_DATA_READ]         = { 0x58, 0x0, 0x0, 1, 64 },
+       [ADL_MMIO_UNCORE_IMC_DATA_WRITE]        = { 0xA0, 0x0, 0x0, 1, 64 },
+};
+
+static void adl_uncore_imc_freerunning_init_box(struct intel_uncore_box *box)
+{
+       __uncore_imc_init_box(box, ADL_UNCORE_IMC_FREERUNNING_BASE);
+}
+
+static struct intel_uncore_ops adl_uncore_imc_freerunning_ops = {
+       .init_box       = adl_uncore_imc_freerunning_init_box,
+       .exit_box       = uncore_mmio_exit_box,
+       .read_counter   = uncore_mmio_read_counter,
+       .hw_config      = uncore_freerunning_hw_config,
+};
+
+static struct intel_uncore_type adl_uncore_imc_free_running = {
+       .name                   = "imc_free_running",
+       .num_counters           = 3,
+       .num_boxes              = 2,
+       .num_freerunning_types  = ADL_MMIO_UNCORE_IMC_FREERUNNING_TYPE_MAX,
+       .mmio_map_size          = ADL_UNCORE_IMC_FREERUNNING_MAP_SIZE,
+       .freerunning            = adl_uncore_imc_freerunning,
+       .ops                    = &adl_uncore_imc_freerunning_ops,
+       .event_descs            = tgl_uncore_imc_events,
+       .format_group           = &tgl_uncore_imc_format_group,
+};
+
+static struct intel_uncore_type *adl_mmio_uncores[] = {
+       &adl_uncore_imc,
+       &adl_uncore_imc_free_running,
+       NULL
+};
+
+void adl_uncore_mmio_init(void)
+{
+       uncore_mmio_uncores = adl_mmio_uncores;
+}
+
+/* end of Alder Lake MMIO uncore support */
index 3660f69..ed86944 100644 (file)
@@ -5482,7 +5482,7 @@ static struct intel_uncore_type icx_uncore_imc = {
        .fixed_ctr_bits = 48,
        .fixed_ctr      = SNR_IMC_MMIO_PMON_FIXED_CTR,
        .fixed_ctl      = SNR_IMC_MMIO_PMON_FIXED_CTL,
-       .event_descs    = hswep_uncore_imc_events,
+       .event_descs    = snr_uncore_imc_events,
        .perf_ctr       = SNR_IMC_MMIO_PMON_CTR0,
        .event_ctl      = SNR_IMC_MMIO_PMON_CTL0,
        .event_mask     = SNBEP_PMON_RAW_EVENT_MASK,
index 9d376e5..150261d 100644 (file)
@@ -215,7 +215,8 @@ enum {
        LBR_FORMAT_EIP_FLAGS2   = 0x04,
        LBR_FORMAT_INFO         = 0x05,
        LBR_FORMAT_TIME         = 0x06,
-       LBR_FORMAT_MAX_KNOWN    = LBR_FORMAT_TIME,
+       LBR_FORMAT_INFO2        = 0x07,
+       LBR_FORMAT_MAX_KNOWN    = LBR_FORMAT_INFO2,
 };
 
 enum {
@@ -840,6 +841,11 @@ struct x86_pmu {
        bool            lbr_double_abort;          /* duplicated lbr aborts */
        bool            lbr_pt_coexist;            /* (LBR|BTS) may coexist with PT */
 
+       unsigned int    lbr_has_info:1;
+       unsigned int    lbr_has_tsx:1;
+       unsigned int    lbr_from_flags:1;
+       unsigned int    lbr_to_cycles:1;
+
        /*
         * Intel Architectural LBR CPUID Enumeration
         */
@@ -1392,6 +1398,8 @@ void intel_pmu_lbr_init_skl(void);
 
 void intel_pmu_lbr_init_knl(void);
 
+void intel_pmu_lbr_init(void);
+
 void intel_pmu_arch_lbr_init(void);
 
 void intel_pmu_pebs_data_source_nhm(void);
index 85feafa..77e3a47 100644 (file)
@@ -536,11 +536,14 @@ static struct perf_msr intel_rapl_spr_msrs[] = {
  * - perf_msr_probe(PERF_RAPL_MAX)
  * - want to use same event codes across both architectures
  */
-static struct perf_msr amd_rapl_msrs[PERF_RAPL_MAX] = {
-       [PERF_RAPL_PKG]  = { MSR_AMD_PKG_ENERGY_STATUS,  &rapl_events_pkg_group,   test_msr },
+static struct perf_msr amd_rapl_msrs[] = {
+       [PERF_RAPL_PP0]  = { 0, &rapl_events_cores_group, 0, false, 0 },
+       [PERF_RAPL_PKG]  = { MSR_AMD_PKG_ENERGY_STATUS,  &rapl_events_pkg_group,   test_msr, false, RAPL_MSR_MASK },
+       [PERF_RAPL_RAM]  = { 0, &rapl_events_ram_group,   0, false, 0 },
+       [PERF_RAPL_PP1]  = { 0, &rapl_events_gpu_group,   0, false, 0 },
+       [PERF_RAPL_PSYS] = { 0, &rapl_events_psys_group,  0, false, 0 },
 };
 
-
 static int rapl_cpu_offline(unsigned int cpu)
 {
        struct rapl_pmu *pmu = cpu_to_rapl_pmu(cpu);
index 631d504..d39e0de 100644 (file)
@@ -82,7 +82,7 @@ KVM_X86_OP_NULL(guest_apic_has_interrupt)
 KVM_X86_OP(load_eoi_exitmap)
 KVM_X86_OP(set_virtual_apic_mode)
 KVM_X86_OP_NULL(set_apic_access_page_addr)
-KVM_X86_OP(deliver_posted_interrupt)
+KVM_X86_OP(deliver_interrupt)
 KVM_X86_OP_NULL(sync_pir_to_irr)
 KVM_X86_OP(set_tss_addr)
 KVM_X86_OP(set_identity_map_addr)
index 1384517..6dcccb3 100644 (file)
@@ -1410,7 +1410,8 @@ struct kvm_x86_ops {
        void (*load_eoi_exitmap)(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap);
        void (*set_virtual_apic_mode)(struct kvm_vcpu *vcpu);
        void (*set_apic_access_page_addr)(struct kvm_vcpu *vcpu);
-       int (*deliver_posted_interrupt)(struct kvm_vcpu *vcpu, int vector);
+       void (*deliver_interrupt)(struct kvm_lapic *apic, int delivery_mode,
+                                 int trig_mode, int vector);
        int (*sync_pir_to_irr)(struct kvm_vcpu *vcpu);
        int (*set_tss_addr)(struct kvm *kvm, unsigned int addr);
        int (*set_identity_map_addr)(struct kvm *kvm, u64 ident_addr);
@@ -1483,7 +1484,8 @@ struct kvm_x86_ops {
 
        int (*get_msr_feature)(struct kvm_msr_entry *entry);
 
-       bool (*can_emulate_instruction)(struct kvm_vcpu *vcpu, void *insn, int insn_len);
+       bool (*can_emulate_instruction)(struct kvm_vcpu *vcpu, int emul_type,
+                                       void *insn, int insn_len);
 
        bool (*apic_init_signal_blocked)(struct kvm_vcpu *vcpu);
        int (*enable_direct_tlbflush)(struct kvm_vcpu *vcpu);
@@ -1496,6 +1498,7 @@ struct kvm_x86_ops {
 };
 
 struct kvm_x86_nested_ops {
+       void (*leave_nested)(struct kvm_vcpu *vcpu);
        int (*check_events)(struct kvm_vcpu *vcpu);
        bool (*hv_timer_pending)(struct kvm_vcpu *vcpu);
        void (*triple_fault)(struct kvm_vcpu *vcpu);
@@ -1861,7 +1864,6 @@ int kvm_cpu_has_extint(struct kvm_vcpu *v);
 int kvm_arch_interrupt_allowed(struct kvm_vcpu *vcpu);
 int kvm_cpu_get_interrupt(struct kvm_vcpu *v);
 void kvm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event);
-void kvm_vcpu_reload_apic_access_page(struct kvm_vcpu *vcpu);
 
 int kvm_pv_send_ipi(struct kvm *kvm, unsigned long ipi_bitmap_low,
                    unsigned long ipi_bitmap_high, u32 min,
index 1bf2ad3..16f548a 100644 (file)
@@ -43,20 +43,6 @@ static inline uint32_t xen_cpuid_base(void)
        return hypervisor_cpuid_base("XenVMMXenVMM", 2);
 }
 
-#ifdef CONFIG_XEN
-extern bool __init xen_hvm_need_lapic(void);
-
-static inline bool __init xen_x2apic_para_available(void)
-{
-       return xen_hvm_need_lapic();
-}
-#else
-static inline bool __init xen_x2apic_para_available(void)
-{
-       return (xen_cpuid_base() != 0);
-}
-#endif
-
 struct pci_dev;
 
 #ifdef CONFIG_XEN_PV_DOM0
index 2da3316..bf6e960 100644 (file)
@@ -452,6 +452,9 @@ struct kvm_sync_regs {
 
 #define KVM_STATE_VMX_PREEMPTION_TIMER_DEADLINE        0x00000001
 
+/* attributes for system fd (group 0) */
+#define KVM_X86_XCOMP_GUEST_SUPP       0
+
 struct kvm_vmx_nested_state_data {
        __u8 vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
        __u8 shadow_vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
index a1e2f41..9f4b508 100644 (file)
@@ -423,7 +423,7 @@ static void threshold_restart_bank(void *_tr)
        u32 hi, lo;
 
        /* sysfs write might race against an offline operation */
-       if (this_cpu_read(threshold_banks))
+       if (!this_cpu_read(threshold_banks) && !tr->set_lvt_off)
                return;
 
        rdmsr(tr->b->address, lo, hi);
index bb9a46a..baafbb3 100644 (file)
@@ -486,6 +486,7 @@ static void intel_ppin_init(struct cpuinfo_x86 *c)
        case INTEL_FAM6_BROADWELL_X:
        case INTEL_FAM6_SKYLAKE_X:
        case INTEL_FAM6_ICELAKE_X:
+       case INTEL_FAM6_ICELAKE_D:
        case INTEL_FAM6_SAPPHIRERAPIDS_X:
        case INTEL_FAM6_XEON_PHI_KNL:
        case INTEL_FAM6_XEON_PHI_KNM:
index 3902c28..494d4d3 100644 (file)
@@ -133,6 +133,7 @@ static int kvm_cpuid_check_equal(struct kvm_vcpu *vcpu, struct kvm_cpuid_entry2
                orig = &vcpu->arch.cpuid_entries[i];
                if (e2[i].function != orig->function ||
                    e2[i].index != orig->index ||
+                   e2[i].flags != orig->flags ||
                    e2[i].eax != orig->eax || e2[i].ebx != orig->ebx ||
                    e2[i].ecx != orig->ecx || e2[i].edx != orig->edx)
                        return -EINVAL;
@@ -196,10 +197,26 @@ void kvm_update_pv_runtime(struct kvm_vcpu *vcpu)
                vcpu->arch.pv_cpuid.features = best->eax;
 }
 
+/*
+ * Calculate guest's supported XCR0 taking into account guest CPUID data and
+ * supported_xcr0 (comprised of host configuration and KVM_SUPPORTED_XCR0).
+ */
+static u64 cpuid_get_supported_xcr0(struct kvm_cpuid_entry2 *entries, int nent)
+{
+       struct kvm_cpuid_entry2 *best;
+
+       best = cpuid_entry2_find(entries, nent, 0xd, 0);
+       if (!best)
+               return 0;
+
+       return (best->eax | ((u64)best->edx << 32)) & supported_xcr0;
+}
+
 static void __kvm_update_cpuid_runtime(struct kvm_vcpu *vcpu, struct kvm_cpuid_entry2 *entries,
                                       int nent)
 {
        struct kvm_cpuid_entry2 *best;
+       u64 guest_supported_xcr0 = cpuid_get_supported_xcr0(entries, nent);
 
        best = cpuid_entry2_find(entries, nent, 1, 0);
        if (best) {
@@ -238,6 +255,21 @@ static void __kvm_update_cpuid_runtime(struct kvm_vcpu *vcpu, struct kvm_cpuid_e
                                           vcpu->arch.ia32_misc_enable_msr &
                                           MSR_IA32_MISC_ENABLE_MWAIT);
        }
+
+       /*
+        * Bits 127:0 of the allowed SECS.ATTRIBUTES (CPUID.0x12.0x1) enumerate
+        * the supported XSAVE Feature Request Mask (XFRM), i.e. the enclave's
+        * requested XCR0 value.  The enclave's XFRM must be a subset of XCRO
+        * at the time of EENTER, thus adjust the allowed XFRM by the guest's
+        * supported XCR0.  Similar to XCR0 handling, FP and SSE are forced to
+        * '1' even on CPUs that don't support XSAVE.
+        */
+       best = cpuid_entry2_find(entries, nent, 0x12, 0x1);
+       if (best) {
+               best->ecx &= guest_supported_xcr0 & 0xffffffff;
+               best->edx &= guest_supported_xcr0 >> 32;
+               best->ecx |= XFEATURE_MASK_FPSSE;
+       }
 }
 
 void kvm_update_cpuid_runtime(struct kvm_vcpu *vcpu)
@@ -261,27 +293,8 @@ static void kvm_vcpu_after_set_cpuid(struct kvm_vcpu *vcpu)
                kvm_apic_set_version(vcpu);
        }
 
-       best = kvm_find_cpuid_entry(vcpu, 0xD, 0);
-       if (!best)
-               vcpu->arch.guest_supported_xcr0 = 0;
-       else
-               vcpu->arch.guest_supported_xcr0 =
-                       (best->eax | ((u64)best->edx << 32)) & supported_xcr0;
-
-       /*
-        * Bits 127:0 of the allowed SECS.ATTRIBUTES (CPUID.0x12.0x1) enumerate
-        * the supported XSAVE Feature Request Mask (XFRM), i.e. the enclave's
-        * requested XCR0 value.  The enclave's XFRM must be a subset of XCRO
-        * at the time of EENTER, thus adjust the allowed XFRM by the guest's
-        * supported XCR0.  Similar to XCR0 handling, FP and SSE are forced to
-        * '1' even on CPUs that don't support XSAVE.
-        */
-       best = kvm_find_cpuid_entry(vcpu, 0x12, 0x1);
-       if (best) {
-               best->ecx &= vcpu->arch.guest_supported_xcr0 & 0xffffffff;
-               best->edx &= vcpu->arch.guest_supported_xcr0 >> 32;
-               best->ecx |= XFEATURE_MASK_FPSSE;
-       }
+       vcpu->arch.guest_supported_xcr0 =
+               cpuid_get_supported_xcr0(vcpu->arch.cpuid_entries, vcpu->arch.cpuid_nent);
 
        kvm_update_pv_runtime(vcpu);
 
@@ -346,8 +359,14 @@ static int kvm_set_cpuid(struct kvm_vcpu *vcpu, struct kvm_cpuid_entry2 *e2,
         * KVM_SET_CPUID{,2} again. To support this legacy behavior, check
         * whether the supplied CPUID data is equal to what's already set.
         */
-       if (vcpu->arch.last_vmentry_cpu != -1)
-               return kvm_cpuid_check_equal(vcpu, e2, nent);
+       if (vcpu->arch.last_vmentry_cpu != -1) {
+               r = kvm_cpuid_check_equal(vcpu, e2, nent);
+               if (r)
+                       return r;
+
+               kvfree(e2);
+               return 0;
+       }
 
        r = kvm_check_cpuid(vcpu, e2, nent);
        if (r)
@@ -535,12 +554,13 @@ void kvm_set_cpu_caps(void)
        );
 
        kvm_cpu_cap_mask(CPUID_7_0_EBX,
-               F(FSGSBASE) | F(SGX) | F(BMI1) | F(HLE) | F(AVX2) | F(SMEP) |
-               F(BMI2) | F(ERMS) | F(INVPCID) | F(RTM) | 0 /*MPX*/ | F(RDSEED) |
-               F(ADX) | F(SMAP) | F(AVX512IFMA) | F(AVX512F) | F(AVX512PF) |
-               F(AVX512ER) | F(AVX512CD) | F(CLFLUSHOPT) | F(CLWB) | F(AVX512DQ) |
-               F(SHA_NI) | F(AVX512BW) | F(AVX512VL) | 0 /*INTEL_PT*/
-       );
+               F(FSGSBASE) | F(SGX) | F(BMI1) | F(HLE) | F(AVX2) |
+               F(FDP_EXCPTN_ONLY) | F(SMEP) | F(BMI2) | F(ERMS) | F(INVPCID) |
+               F(RTM) | F(ZERO_FCS_FDS) | 0 /*MPX*/ | F(AVX512F) |
+               F(AVX512DQ) | F(RDSEED) | F(ADX) | F(SMAP) | F(AVX512IFMA) |
+               F(CLFLUSHOPT) | F(CLWB) | 0 /*INTEL_PT*/ | F(AVX512PF) |
+               F(AVX512ER) | F(AVX512CD) | F(SHA_NI) | F(AVX512BW) |
+               F(AVX512VL));
 
        kvm_cpu_cap_mask(CPUID_7_ECX,
                F(AVX512VBMI) | F(LA57) | F(PKU) | 0 /*OSPKE*/ | F(RDPID) |
@@ -887,13 +907,14 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function)
                }
                break;
        case 0xd: {
-               u64 guest_perm = xstate_get_guest_group_perm();
+               u64 permitted_xcr0 = supported_xcr0 & xstate_get_guest_group_perm();
+               u64 permitted_xss = supported_xss;
 
-               entry->eax &= supported_xcr0 & guest_perm;
-               entry->ebx = xstate_required_size(supported_xcr0, false);
+               entry->eax &= permitted_xcr0;
+               entry->ebx = xstate_required_size(permitted_xcr0, false);
                entry->ecx = entry->ebx;
-               entry->edx &= (supported_xcr0 & guest_perm) >> 32;
-               if (!supported_xcr0)
+               entry->edx &= permitted_xcr0 >> 32;
+               if (!permitted_xcr0)
                        break;
 
                entry = do_host_cpuid(array, function, 1);
@@ -902,20 +923,20 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function)
 
                cpuid_entry_override(entry, CPUID_D_1_EAX);
                if (entry->eax & (F(XSAVES)|F(XSAVEC)))
-                       entry->ebx = xstate_required_size(supported_xcr0 | supported_xss,
+                       entry->ebx = xstate_required_size(permitted_xcr0 | permitted_xss,
                                                          true);
                else {
-                       WARN_ON_ONCE(supported_xss != 0);
+                       WARN_ON_ONCE(permitted_xss != 0);
                        entry->ebx = 0;
                }
-               entry->ecx &= supported_xss;
-               entry->edx &= supported_xss >> 32;
+               entry->ecx &= permitted_xss;
+               entry->edx &= permitted_xss >> 32;
 
                for (i = 2; i < 64; ++i) {
                        bool s_state;
-                       if (supported_xcr0 & BIT_ULL(i))
+                       if (permitted_xcr0 & BIT_ULL(i))
                                s_state = false;
-                       else if (supported_xss & BIT_ULL(i))
+                       else if (permitted_xss & BIT_ULL(i))
                                s_state = true;
                        else
                                continue;
@@ -929,7 +950,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function)
                         * invalid sub-leafs.  Only valid sub-leafs should
                         * reach this point, and they should have a non-zero
                         * save state size.  Furthermore, check whether the
-                        * processor agrees with supported_xcr0/supported_xss
+                        * processor agrees with permitted_xcr0/permitted_xss
                         * on whether this is an XCR0- or IA32_XSS-managed area.
                         */
                        if (WARN_ON_ONCE(!entry->eax || (entry->ecx & 0x1) != s_state)) {
index baca9fa..d7e6fde 100644 (file)
@@ -1096,14 +1096,8 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode,
                                                       apic->regs + APIC_TMR);
                }
 
-               if (static_call(kvm_x86_deliver_posted_interrupt)(vcpu, vector)) {
-                       kvm_lapic_set_irr(vector, apic);
-                       kvm_make_request(KVM_REQ_EVENT, vcpu);
-                       kvm_vcpu_kick(vcpu);
-               } else {
-                       trace_kvm_apicv_accept_irq(vcpu->vcpu_id, delivery_mode,
-                                                  trig_mode, vector);
-               }
+               static_call(kvm_x86_deliver_interrupt)(apic, delivery_mode,
+                                                      trig_mode, vector);
                break;
 
        case APIC_DM_REMRD:
@@ -2629,7 +2623,7 @@ int kvm_apic_set_state(struct kvm_vcpu *vcpu, struct kvm_lapic_state *s)
        kvm_apic_set_version(vcpu);
 
        apic_update_ppr(apic);
-       hrtimer_cancel(&apic->lapic_timer.timer);
+       cancel_apic_timer(apic);
        apic->lapic_timer.expired_tscdeadline = 0;
        apic_update_lvtt(apic);
        apic_manage_nmi_watchdog(apic, kvm_lapic_get_reg(apic, APIC_LVT0));
index cf20685..1218b5a 100644 (file)
@@ -983,9 +983,9 @@ void svm_free_nested(struct vcpu_svm *svm)
 /*
  * Forcibly leave nested mode in order to be able to reset the VCPU later on.
  */
-void svm_leave_nested(struct vcpu_svm *svm)
+void svm_leave_nested(struct kvm_vcpu *vcpu)
 {
-       struct kvm_vcpu *vcpu = &svm->vcpu;
+       struct vcpu_svm *svm = to_svm(vcpu);
 
        if (is_guest_mode(vcpu)) {
                svm->nested.nested_run_pending = 0;
@@ -1411,7 +1411,7 @@ static int svm_set_nested_state(struct kvm_vcpu *vcpu,
                return -EINVAL;
 
        if (!(kvm_state->flags & KVM_STATE_NESTED_GUEST_MODE)) {
-               svm_leave_nested(svm);
+               svm_leave_nested(vcpu);
                svm_set_gif(svm, !!(kvm_state->flags & KVM_STATE_NESTED_GIF_SET));
                return 0;
        }
@@ -1478,7 +1478,7 @@ static int svm_set_nested_state(struct kvm_vcpu *vcpu,
         */
 
        if (is_guest_mode(vcpu))
-               svm_leave_nested(svm);
+               svm_leave_nested(vcpu);
        else
                svm->nested.vmcb02.ptr->save = svm->vmcb01.ptr->save;
 
@@ -1532,6 +1532,7 @@ static bool svm_get_nested_state_pages(struct kvm_vcpu *vcpu)
 }
 
 struct kvm_x86_nested_ops svm_nested_ops = {
+       .leave_nested = svm_leave_nested,
        .check_events = svm_check_nested_events,
        .triple_fault = nested_svm_triple_fault,
        .get_nested_state_pages = svm_get_nested_state_pages,
index 6a22798..17b5345 100644 (file)
@@ -2100,8 +2100,13 @@ void __init sev_hardware_setup(void)
        if (!sev_enabled || !npt_enabled)
                goto out;
 
-       /* Does the CPU support SEV? */
-       if (!boot_cpu_has(X86_FEATURE_SEV))
+       /*
+        * SEV must obviously be supported in hardware.  Sanity check that the
+        * CPU supports decode assists, which is mandatory for SEV guests to
+        * support instruction emulation.
+        */
+       if (!boot_cpu_has(X86_FEATURE_SEV) ||
+           WARN_ON_ONCE(!boot_cpu_has(X86_FEATURE_DECODEASSISTS)))
                goto out;
 
        /* Retrieve SEV CPUID information */
index 2c99b18..a290efb 100644 (file)
@@ -290,7 +290,7 @@ int svm_set_efer(struct kvm_vcpu *vcpu, u64 efer)
 
        if ((old_efer & EFER_SVME) != (efer & EFER_SVME)) {
                if (!(efer & EFER_SVME)) {
-                       svm_leave_nested(svm);
+                       svm_leave_nested(vcpu);
                        svm_set_gif(svm, true);
                        /* #GP intercept is still needed for vmware backdoor */
                        if (!enable_vmware_backdoor)
@@ -312,7 +312,11 @@ int svm_set_efer(struct kvm_vcpu *vcpu, u64 efer)
                                return ret;
                        }
 
-                       if (svm_gp_erratum_intercept)
+                       /*
+                        * Never intercept #GP for SEV guests, KVM can't
+                        * decrypt guest memory to workaround the erratum.
+                        */
+                       if (svm_gp_erratum_intercept && !sev_guest(vcpu->kvm))
                                set_exception_intercept(svm, GP_VECTOR);
                }
        }
@@ -1010,9 +1014,10 @@ static void init_vmcb(struct kvm_vcpu *vcpu)
         * Guest access to VMware backdoor ports could legitimately
         * trigger #GP because of TSS I/O permission bitmap.
         * We intercept those #GP and allow access to them anyway
-        * as VMware does.
+        * as VMware does.  Don't intercept #GP for SEV guests as KVM can't
+        * decrypt guest memory to decode the faulting instruction.
         */
-       if (enable_vmware_backdoor)
+       if (enable_vmware_backdoor && !sev_guest(vcpu->kvm))
                set_exception_intercept(svm, GP_VECTOR);
 
        svm_set_intercept(svm, INTERCEPT_INTR);
@@ -2091,10 +2096,6 @@ static int gp_interception(struct kvm_vcpu *vcpu)
        if (error_code)
                goto reinject;
 
-       /* All SVM instructions expect page aligned RAX */
-       if (svm->vmcb->save.rax & ~PAGE_MASK)
-               goto reinject;
-
        /* Decode the instruction for usage later */
        if (x86_decode_emulated_instruction(vcpu, 0, NULL, 0) != EMULATION_OK)
                goto reinject;
@@ -2112,8 +2113,13 @@ static int gp_interception(struct kvm_vcpu *vcpu)
                if (!is_guest_mode(vcpu))
                        return kvm_emulate_instruction(vcpu,
                                EMULTYPE_VMWARE_GP | EMULTYPE_NO_DECODE);
-       } else
+       } else {
+               /* All SVM instructions expect page aligned RAX */
+               if (svm->vmcb->save.rax & ~PAGE_MASK)
+                       goto reinject;
+
                return emulate_svm_instr(vcpu, opcode);
+       }
 
 reinject:
        kvm_queue_exception_e(vcpu, GP_VECTOR, error_code);
@@ -3285,6 +3291,21 @@ static void svm_set_irq(struct kvm_vcpu *vcpu)
                SVM_EVTINJ_VALID | SVM_EVTINJ_TYPE_INTR;
 }
 
+static void svm_deliver_interrupt(struct kvm_lapic *apic, int delivery_mode,
+                                 int trig_mode, int vector)
+{
+       struct kvm_vcpu *vcpu = apic->vcpu;
+
+       if (svm_deliver_avic_intr(vcpu, vector)) {
+               kvm_lapic_set_irr(vector, apic);
+               kvm_make_request(KVM_REQ_EVENT, vcpu);
+               kvm_vcpu_kick(vcpu);
+       } else {
+               trace_kvm_apicv_accept_irq(vcpu->vcpu_id, delivery_mode,
+                                          trig_mode, vector);
+       }
+}
+
 static void svm_update_cr8_intercept(struct kvm_vcpu *vcpu, int tpr, int irr)
 {
        struct vcpu_svm *svm = to_svm(vcpu);
@@ -3609,7 +3630,7 @@ static noinstr void svm_vcpu_enter_exit(struct kvm_vcpu *vcpu)
        struct vcpu_svm *svm = to_svm(vcpu);
        unsigned long vmcb_pa = svm->current_vmcb->pa;
 
-       kvm_guest_enter_irqoff();
+       guest_state_enter_irqoff();
 
        if (sev_es_guest(vcpu->kvm)) {
                __svm_sev_es_vcpu_run(vmcb_pa);
@@ -3629,7 +3650,7 @@ static noinstr void svm_vcpu_enter_exit(struct kvm_vcpu *vcpu)
                vmload(__sme_page_pa(sd->save_area));
        }
 
-       kvm_guest_exit_irqoff();
+       guest_state_exit_irqoff();
 }
 
 static __no_kcsan fastpath_t svm_vcpu_run(struct kvm_vcpu *vcpu)
@@ -4252,79 +4273,140 @@ static void svm_enable_smi_window(struct kvm_vcpu *vcpu)
        }
 }
 
-static bool svm_can_emulate_instruction(struct kvm_vcpu *vcpu, void *insn, int insn_len)
+static bool svm_can_emulate_instruction(struct kvm_vcpu *vcpu, int emul_type,
+                                       void *insn, int insn_len)
 {
        bool smep, smap, is_user;
        unsigned long cr4;
+       u64 error_code;
+
+       /* Emulation is always possible when KVM has access to all guest state. */
+       if (!sev_guest(vcpu->kvm))
+               return true;
+
+       /* #UD and #GP should never be intercepted for SEV guests. */
+       WARN_ON_ONCE(emul_type & (EMULTYPE_TRAP_UD |
+                                 EMULTYPE_TRAP_UD_FORCED |
+                                 EMULTYPE_VMWARE_GP));
 
        /*
-        * When the guest is an SEV-ES guest, emulation is not possible.
+        * Emulation is impossible for SEV-ES guests as KVM doesn't have access
+        * to guest register state.
         */
        if (sev_es_guest(vcpu->kvm))
                return false;
 
        /*
+        * Emulation is possible if the instruction is already decoded, e.g.
+        * when completing I/O after returning from userspace.
+        */
+       if (emul_type & EMULTYPE_NO_DECODE)
+               return true;
+
+       /*
+        * Emulation is possible for SEV guests if and only if a prefilled
+        * buffer containing the bytes of the intercepted instruction is
+        * available. SEV guest memory is encrypted with a guest specific key
+        * and cannot be decrypted by KVM, i.e. KVM would read cyphertext and
+        * decode garbage.
+        *
+        * Inject #UD if KVM reached this point without an instruction buffer.
+        * In practice, this path should never be hit by a well-behaved guest,
+        * e.g. KVM doesn't intercept #UD or #GP for SEV guests, but this path
+        * is still theoretically reachable, e.g. via unaccelerated fault-like
+        * AVIC access, and needs to be handled by KVM to avoid putting the
+        * guest into an infinite loop.   Injecting #UD is somewhat arbitrary,
+        * but its the least awful option given lack of insight into the guest.
+        */
+       if (unlikely(!insn)) {
+               kvm_queue_exception(vcpu, UD_VECTOR);
+               return false;
+       }
+
+       /*
+        * Emulate for SEV guests if the insn buffer is not empty.  The buffer
+        * will be empty if the DecodeAssist microcode cannot fetch bytes for
+        * the faulting instruction because the code fetch itself faulted, e.g.
+        * the guest attempted to fetch from emulated MMIO or a guest page
+        * table used to translate CS:RIP resides in emulated MMIO.
+        */
+       if (likely(insn_len))
+               return true;
+
+       /*
         * Detect and workaround Errata 1096 Fam_17h_00_0Fh.
         *
         * Errata:
-        * When CPU raise #NPF on guest data access and vCPU CR4.SMAP=1, it is
-        * possible that CPU microcode implementing DecodeAssist will fail
-        * to read bytes of instruction which caused #NPF. In this case,
-        * GuestIntrBytes field of the VMCB on a VMEXIT will incorrectly
-        * return 0 instead of the correct guest instruction bytes.
-        *
-        * This happens because CPU microcode reading instruction bytes
-        * uses a special opcode which attempts to read data using CPL=0
-        * privileges. The microcode reads CS:RIP and if it hits a SMAP
-        * fault, it gives up and returns no instruction bytes.
+        * When CPU raises #NPF on guest data access and vCPU CR4.SMAP=1, it is
+        * possible that CPU microcode implementing DecodeAssist will fail to
+        * read guest memory at CS:RIP and vmcb.GuestIntrBytes will incorrectly
+        * be '0'.  This happens because microcode reads CS:RIP using a _data_
+        * loap uop with CPL=0 privileges.  If the load hits a SMAP #PF, ucode
+        * gives up and does not fill the instruction bytes buffer.
         *
-        * Detection:
-        * We reach here in case CPU supports DecodeAssist, raised #NPF and
-        * returned 0 in GuestIntrBytes field of the VMCB.
-        * First, errata can only be triggered in case vCPU CR4.SMAP=1.
-        * Second, if vCPU CR4.SMEP=1, errata could only be triggered
-        * in case vCPU CPL==3 (Because otherwise guest would have triggered
-        * a SMEP fault instead of #NPF).
-        * Otherwise, vCPU CR4.SMEP=0, errata could be triggered by any vCPU CPL.
-        * As most guests enable SMAP if they have also enabled SMEP, use above
-        * logic in order to attempt minimize false-positive of detecting errata
-        * while still preserving all cases semantic correctness.
+        * As above, KVM reaches this point iff the VM is an SEV guest, the CPU
+        * supports DecodeAssist, a #NPF was raised, KVM's page fault handler
+        * triggered emulation (e.g. for MMIO), and the CPU returned 0 in the
+        * GuestIntrBytes field of the VMCB.
         *
-        * Workaround:
-        * To determine what instruction the guest was executing, the hypervisor
-        * will have to decode the instruction at the instruction pointer.
+        * This does _not_ mean that the erratum has been encountered, as the
+        * DecodeAssist will also fail if the load for CS:RIP hits a legitimate
+        * #PF, e.g. if the guest attempt to execute from emulated MMIO and
+        * encountered a reserved/not-present #PF.
         *
-        * In non SEV guest, hypervisor will be able to read the guest
-        * memory to decode the instruction pointer when insn_len is zero
-        * so we return true to indicate that decoding is possible.
+        * To hit the erratum, the following conditions must be true:
+        *    1. CR4.SMAP=1 (obviously).
+        *    2. CR4.SMEP=0 || CPL=3.  If SMEP=1 and CPL<3, the erratum cannot
+        *       have been hit as the guest would have encountered a SMEP
+        *       violation #PF, not a #NPF.
+        *    3. The #NPF is not due to a code fetch, in which case failure to
+        *       retrieve the instruction bytes is legitimate (see abvoe).
         *
-        * But in the SEV guest, the guest memory is encrypted with the
-        * guest specific key and hypervisor will not be able to decode the
-        * instruction pointer so we will not able to workaround it. Lets
-        * print the error and request to kill the guest.
+        * In addition, don't apply the erratum workaround if the #NPF occurred
+        * while translating guest page tables (see below).
         */
-       if (likely(!insn || insn_len))
-               return true;
-
-       /*
-        * If RIP is invalid, go ahead with emulation which will cause an
-        * internal error exit.
-        */
-       if (!kvm_vcpu_gfn_to_memslot(vcpu, kvm_rip_read(vcpu) >> PAGE_SHIFT))
-               return true;
+       error_code = to_svm(vcpu)->vmcb->control.exit_info_1;
+       if (error_code & (PFERR_GUEST_PAGE_MASK | PFERR_FETCH_MASK))
+               goto resume_guest;
 
        cr4 = kvm_read_cr4(vcpu);
        smep = cr4 & X86_CR4_SMEP;
        smap = cr4 & X86_CR4_SMAP;
        is_user = svm_get_cpl(vcpu) == 3;
        if (smap && (!smep || is_user)) {
-               if (!sev_guest(vcpu->kvm))
-                       return true;
-
                pr_err_ratelimited("KVM: SEV Guest triggered AMD Erratum 1096\n");
-               kvm_make_request(KVM_REQ_TRIPLE_FAULT, vcpu);
+
+               /*
+                * If the fault occurred in userspace, arbitrarily inject #GP
+                * to avoid killing the guest and to hopefully avoid confusing
+                * the guest kernel too much, e.g. injecting #PF would not be
+                * coherent with respect to the guest's page tables.  Request
+                * triple fault if the fault occurred in the kernel as there's
+                * no fault that KVM can inject without confusing the guest.
+                * In practice, the triple fault is moot as no sane SEV kernel
+                * will execute from user memory while also running with SMAP=1.
+                */
+               if (is_user)
+                       kvm_inject_gp(vcpu, 0);
+               else
+                       kvm_make_request(KVM_REQ_TRIPLE_FAULT, vcpu);
        }
 
+resume_guest:
+       /*
+        * If the erratum was not hit, simply resume the guest and let it fault
+        * again.  While awful, e.g. the vCPU may get stuck in an infinite loop
+        * if the fault is at CPL=0, it's the lesser of all evils.  Exiting to
+        * userspace will kill the guest, and letting the emulator read garbage
+        * will yield random behavior and potentially corrupt the guest.
+        *
+        * Simply resuming the guest is technically not a violation of the SEV
+        * architecture.  AMD's APM states that all code fetches and page table
+        * accesses for SEV guest are encrypted, regardless of the C-Bit.  The
+        * APM also states that encrypted accesses to MMIO are "ignored", but
+        * doesn't explicitly define "ignored", i.e. doing nothing and letting
+        * the guest spin is technically "ignoring" the access.
+        */
        return false;
 }
 
@@ -4478,7 +4560,7 @@ static struct kvm_x86_ops svm_x86_ops __initdata = {
        .pmu_ops = &amd_pmu_ops,
        .nested_ops = &svm_nested_ops,
 
-       .deliver_posted_interrupt = svm_deliver_avic_intr,
+       .deliver_interrupt = svm_deliver_interrupt,
        .dy_apicv_has_pending_interrupt = svm_dy_apicv_has_pending_interrupt,
        .update_pi_irte = svm_update_pi_irte,
        .setup_mce = svm_setup_mce,
index 47ef8f4..7352535 100644 (file)
@@ -304,11 +304,6 @@ static inline void vmcb_mark_all_clean(struct vmcb *vmcb)
                               & ~VMCB_ALWAYS_DIRTY_MASK;
 }
 
-static inline bool vmcb_is_clean(struct vmcb *vmcb, int bit)
-{
-       return (vmcb->control.clean & (1 << bit));
-}
-
 static inline void vmcb_mark_dirty(struct vmcb *vmcb, int bit)
 {
        vmcb->control.clean &= ~(1 << bit);
@@ -525,7 +520,7 @@ static inline bool nested_exit_on_nmi(struct vcpu_svm *svm)
 
 int enter_svm_guest_mode(struct kvm_vcpu *vcpu,
                         u64 vmcb_gpa, struct vmcb *vmcb12, bool from_vmrun);
-void svm_leave_nested(struct vcpu_svm *svm);
+void svm_leave_nested(struct kvm_vcpu *vcpu);
 void svm_free_nested(struct vcpu_svm *svm);
 int svm_allocate_nested(struct vcpu_svm *svm);
 int nested_svm_vmrun(struct kvm_vcpu *vcpu);
index c53b8bf..489ca56 100644 (file)
@@ -46,6 +46,9 @@ static inline void svm_hv_init_vmcb(struct vmcb *vmcb)
        if (npt_enabled &&
            ms_hyperv.nested_features & HV_X64_NESTED_ENLIGHTENED_TLB)
                hve->hv_enlightenments_control.enlightened_npt_tlb = 1;
+
+       if (ms_hyperv.nested_features & HV_X64_NESTED_MSR_BITMAP)
+               hve->hv_enlightenments_control.msr_bitmap = 1;
 }
 
 static inline void svm_hv_hardware_setup(void)
@@ -83,14 +86,7 @@ static inline void svm_hv_vmcb_dirty_nested_enlightenments(
        struct hv_enlightenments *hve =
                (struct hv_enlightenments *)vmcb->control.reserved_sw;
 
-       /*
-        * vmcb can be NULL if called during early vcpu init.
-        * And its okay not to mark vmcb dirty during vcpu init
-        * as we mark it dirty unconditionally towards end of vcpu
-        * init phase.
-        */
-       if (vmcb_is_clean(vmcb, VMCB_HV_NESTED_ENLIGHTENMENTS) &&
-           hve->hv_enlightenments_control.msr_bitmap)
+       if (hve->hv_enlightenments_control.msr_bitmap)
                vmcb_mark_dirty(vmcb, VMCB_HV_NESTED_ENLIGHTENMENTS);
 }
 
index 959b59d..3f430e2 100644 (file)
@@ -54,7 +54,6 @@ struct nested_vmx_msrs {
 
 struct vmcs_config {
        int size;
-       int order;
        u32 basic_cap;
        u32 revision_id;
        u32 pin_based_exec_ctrl;
index ba6f99f..87e3dc1 100644 (file)
@@ -12,8 +12,6 @@
 
 DEFINE_STATIC_KEY_FALSE(enable_evmcs);
 
-#if IS_ENABLED(CONFIG_HYPERV)
-
 #define EVMCS1_OFFSET(x) offsetof(struct hv_enlightened_vmcs, x)
 #define EVMCS1_FIELD(number, name, clean_field)[ROL16(number, 6)] = \
                {EVMCS1_OFFSET(name), clean_field}
@@ -296,6 +294,7 @@ const struct evmcs_field vmcs_field_to_evmcs_1[] = {
 };
 const unsigned int nr_evmcs_1_fields = ARRAY_SIZE(vmcs_field_to_evmcs_1);
 
+#if IS_ENABLED(CONFIG_HYPERV)
 __init void evmcs_sanitize_exec_ctrls(struct vmcs_config *vmcs_conf)
 {
        vmcs_conf->pin_based_exec_ctrl &= ~EVMCS1_UNSUPPORTED_PINCTRL;
@@ -362,6 +361,7 @@ void nested_evmcs_filter_control_msr(u32 msr_index, u64 *pdata)
        case MSR_IA32_VMX_PROCBASED_CTLS2:
                ctl_high &= ~EVMCS1_UNSUPPORTED_2NDEXEC;
                break;
+       case MSR_IA32_VMX_TRUE_PINBASED_CTLS:
        case MSR_IA32_VMX_PINBASED_CTLS:
                ctl_high &= ~EVMCS1_UNSUPPORTED_PINCTRL;
                break;
index 16731d2..8d70f9a 100644 (file)
@@ -59,12 +59,12 @@ DECLARE_STATIC_KEY_FALSE(enable_evmcs);
         SECONDARY_EXEC_SHADOW_VMCS |                                   \
         SECONDARY_EXEC_TSC_SCALING |                                   \
         SECONDARY_EXEC_PAUSE_LOOP_EXITING)
-#define EVMCS1_UNSUPPORTED_VMEXIT_CTRL (VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL)
+#define EVMCS1_UNSUPPORTED_VMEXIT_CTRL                                 \
+       (VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL |                           \
+        VM_EXIT_SAVE_VMX_PREEMPTION_TIMER)
 #define EVMCS1_UNSUPPORTED_VMENTRY_CTRL (VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL)
 #define EVMCS1_UNSUPPORTED_VMFUNC (VMX_VMFUNC_EPTP_SWITCHING)
 
-#if IS_ENABLED(CONFIG_HYPERV)
-
 struct evmcs_field {
        u16 offset;
        u16 clean_field;
@@ -73,26 +73,56 @@ struct evmcs_field {
 extern const struct evmcs_field vmcs_field_to_evmcs_1[];
 extern const unsigned int nr_evmcs_1_fields;
 
-static __always_inline int get_evmcs_offset(unsigned long field,
-                                           u16 *clean_field)
+static __always_inline int evmcs_field_offset(unsigned long field,
+                                             u16 *clean_field)
 {
        unsigned int index = ROL16(field, 6);
        const struct evmcs_field *evmcs_field;
 
-       if (unlikely(index >= nr_evmcs_1_fields)) {
-               WARN_ONCE(1, "KVM: accessing unsupported EVMCS field %lx\n",
-                         field);
+       if (unlikely(index >= nr_evmcs_1_fields))
                return -ENOENT;
-       }
 
        evmcs_field = &vmcs_field_to_evmcs_1[index];
 
+       /*
+        * Use offset=0 to detect holes in eVMCS. This offset belongs to
+        * 'revision_id' but this field has no encoding and is supposed to
+        * be accessed directly.
+        */
+       if (unlikely(!evmcs_field->offset))
+               return -ENOENT;
+
        if (clean_field)
                *clean_field = evmcs_field->clean_field;
 
        return evmcs_field->offset;
 }
 
+static inline u64 evmcs_read_any(struct hv_enlightened_vmcs *evmcs,
+                                unsigned long field, u16 offset)
+{
+       /*
+        * vmcs12_read_any() doesn't care whether the supplied structure
+        * is 'struct vmcs12' or 'struct hv_enlightened_vmcs' as it takes
+        * the exact offset of the required field, use it for convenience
+        * here.
+        */
+       return vmcs12_read_any((void *)evmcs, field, offset);
+}
+
+#if IS_ENABLED(CONFIG_HYPERV)
+
+static __always_inline int get_evmcs_offset(unsigned long field,
+                                           u16 *clean_field)
+{
+       int offset = evmcs_field_offset(field, clean_field);
+
+       WARN_ONCE(offset < 0, "KVM: accessing unsupported EVMCS field %lx\n",
+                 field);
+
+       return offset;
+}
+
 static __always_inline void evmcs_write64(unsigned long field, u64 value)
 {
        u16 clean_field;
index f235f77..ba34e94 100644 (file)
@@ -7,6 +7,7 @@
 #include <asm/mmu_context.h>
 
 #include "cpuid.h"
+#include "evmcs.h"
 #include "hyperv.h"
 #include "mmu.h"
 #include "nested.h"
@@ -4851,18 +4852,20 @@ static struct vmcs *alloc_shadow_vmcs(struct kvm_vcpu *vcpu)
        struct loaded_vmcs *loaded_vmcs = vmx->loaded_vmcs;
 
        /*
-        * We should allocate a shadow vmcs for vmcs01 only when L1
-        * executes VMXON and free it when L1 executes VMXOFF.
-        * As it is invalid to execute VMXON twice, we shouldn't reach
-        * here when vmcs01 already have an allocated shadow vmcs.
+        * KVM allocates a shadow VMCS only when L1 executes VMXON and frees it
+        * when L1 executes VMXOFF or the vCPU is forced out of nested
+        * operation.  VMXON faults if the CPU is already post-VMXON, so it
+        * should be impossible to already have an allocated shadow VMCS.  KVM
+        * doesn't support virtualization of VMCS shadowing, so vmcs01 should
+        * always be the loaded VMCS.
         */
-       WARN_ON(loaded_vmcs == &vmx->vmcs01 && loaded_vmcs->shadow_vmcs);
+       if (WARN_ON(loaded_vmcs != &vmx->vmcs01 || loaded_vmcs->shadow_vmcs))
+               return loaded_vmcs->shadow_vmcs;
+
+       loaded_vmcs->shadow_vmcs = alloc_vmcs(true);
+       if (loaded_vmcs->shadow_vmcs)
+               vmcs_clear(loaded_vmcs->shadow_vmcs);
 
-       if (!loaded_vmcs->shadow_vmcs) {
-               loaded_vmcs->shadow_vmcs = alloc_vmcs(true);
-               if (loaded_vmcs->shadow_vmcs)
-                       vmcs_clear(loaded_vmcs->shadow_vmcs);
-       }
        return loaded_vmcs->shadow_vmcs;
 }
 
@@ -5099,27 +5102,49 @@ static int handle_vmread(struct kvm_vcpu *vcpu)
        if (!nested_vmx_check_permission(vcpu))
                return 1;
 
-       /*
-        * In VMX non-root operation, when the VMCS-link pointer is INVALID_GPA,
-        * any VMREAD sets the ALU flags for VMfailInvalid.
-        */
-       if (vmx->nested.current_vmptr == INVALID_GPA ||
-           (is_guest_mode(vcpu) &&
-            get_vmcs12(vcpu)->vmcs_link_pointer == INVALID_GPA))
-               return nested_vmx_failInvalid(vcpu);
-
        /* Decode instruction info and find the field to read */
        field = kvm_register_read(vcpu, (((instr_info) >> 28) & 0xf));
 
-       offset = vmcs_field_to_offset(field);
-       if (offset < 0)
-               return nested_vmx_fail(vcpu, VMXERR_UNSUPPORTED_VMCS_COMPONENT);
+       if (!evmptr_is_valid(vmx->nested.hv_evmcs_vmptr)) {
+               /*
+                * In VMX non-root operation, when the VMCS-link pointer is INVALID_GPA,
+                * any VMREAD sets the ALU flags for VMfailInvalid.
+                */
+               if (vmx->nested.current_vmptr == INVALID_GPA ||
+                   (is_guest_mode(vcpu) &&
+                    get_vmcs12(vcpu)->vmcs_link_pointer == INVALID_GPA))
+                       return nested_vmx_failInvalid(vcpu);
 
-       if (!is_guest_mode(vcpu) && is_vmcs12_ext_field(field))
-               copy_vmcs02_to_vmcs12_rare(vcpu, vmcs12);
+               offset = get_vmcs12_field_offset(field);
+               if (offset < 0)
+                       return nested_vmx_fail(vcpu, VMXERR_UNSUPPORTED_VMCS_COMPONENT);
+
+               if (!is_guest_mode(vcpu) && is_vmcs12_ext_field(field))
+                       copy_vmcs02_to_vmcs12_rare(vcpu, vmcs12);
 
-       /* Read the field, zero-extended to a u64 value */
-       value = vmcs12_read_any(vmcs12, field, offset);
+               /* Read the field, zero-extended to a u64 value */
+               value = vmcs12_read_any(vmcs12, field, offset);
+       } else {
+               /*
+                * Hyper-V TLFS (as of 6.0b) explicitly states, that while an
+                * enlightened VMCS is active VMREAD/VMWRITE instructions are
+                * unsupported. Unfortunately, certain versions of Windows 11
+                * don't comply with this requirement which is not enforced in
+                * genuine Hyper-V. Allow VMREAD from an enlightened VMCS as a
+                * workaround, as misbehaving guests will panic on VM-Fail.
+                * Note, enlightened VMCS is incompatible with shadow VMCS so
+                * all VMREADs from L2 should go to L1.
+                */
+               if (WARN_ON_ONCE(is_guest_mode(vcpu)))
+                       return nested_vmx_failInvalid(vcpu);
+
+               offset = evmcs_field_offset(field, NULL);
+               if (offset < 0)
+                       return nested_vmx_fail(vcpu, VMXERR_UNSUPPORTED_VMCS_COMPONENT);
+
+               /* Read the field, zero-extended to a u64 value */
+               value = evmcs_read_any(vmx->nested.hv_evmcs, field, offset);
+       }
 
        /*
         * Now copy part of this value to register or memory, as requested.
@@ -5214,7 +5239,7 @@ static int handle_vmwrite(struct kvm_vcpu *vcpu)
 
        field = kvm_register_read(vcpu, (((instr_info) >> 28) & 0xf));
 
-       offset = vmcs_field_to_offset(field);
+       offset = get_vmcs12_field_offset(field);
        if (offset < 0)
                return nested_vmx_fail(vcpu, VMXERR_UNSUPPORTED_VMCS_COMPONENT);
 
@@ -6462,7 +6487,7 @@ static u64 nested_vmx_calc_vmcs_enum_msr(void)
        max_idx = 0;
        for (i = 0; i < nr_vmcs12_fields; i++) {
                /* The vmcs12 table is very, very sparsely populated. */
-               if (!vmcs_field_to_offset_table[i])
+               if (!vmcs12_field_offsets[i])
                        continue;
 
                idx = vmcs_field_index(VMCS12_IDX_TO_ENC(i));
@@ -6771,6 +6796,7 @@ __init int nested_vmx_hardware_setup(int (*exit_handlers[])(struct kvm_vcpu *))
 }
 
 struct kvm_x86_nested_ops vmx_nested_ops = {
+       .leave_nested = vmx_leave_nested,
        .check_events = vmx_check_nested_events,
        .hv_timer_pending = nested_vmx_preemption_timer_pending,
        .triple_fault = nested_vmx_triple_fault,
index cab6ba7..2251b60 100644 (file)
@@ -8,7 +8,7 @@
        FIELD(number, name),                                            \
        [ROL16(number##_HIGH, 6)] = VMCS12_OFFSET(name) + sizeof(u32)
 
-const unsigned short vmcs_field_to_offset_table[] = {
+const unsigned short vmcs12_field_offsets[] = {
        FIELD(VIRTUAL_PROCESSOR_ID, virtual_processor_id),
        FIELD(POSTED_INTR_NV, posted_intr_nv),
        FIELD(GUEST_ES_SELECTOR, guest_es_selector),
@@ -151,4 +151,4 @@ const unsigned short vmcs_field_to_offset_table[] = {
        FIELD(HOST_RSP, host_rsp),
        FIELD(HOST_RIP, host_rip),
 };
-const unsigned int nr_vmcs12_fields = ARRAY_SIZE(vmcs_field_to_offset_table);
+const unsigned int nr_vmcs12_fields = ARRAY_SIZE(vmcs12_field_offsets);
index 2a45f02..746129d 100644 (file)
@@ -361,10 +361,10 @@ static inline void vmx_check_vmcs12_offsets(void)
        CHECK_OFFSET(guest_pml_index, 996);
 }
 
-extern const unsigned short vmcs_field_to_offset_table[];
+extern const unsigned short vmcs12_field_offsets[];
 extern const unsigned int nr_vmcs12_fields;
 
-static inline short vmcs_field_to_offset(unsigned long field)
+static inline short get_vmcs12_field_offset(unsigned long field)
 {
        unsigned short offset;
        unsigned int index;
@@ -377,7 +377,7 @@ static inline short vmcs_field_to_offset(unsigned long field)
                return -ENOENT;
 
        index = array_index_nospec(index, nr_vmcs12_fields);
-       offset = vmcs_field_to_offset_table[index];
+       offset = vmcs12_field_offsets[index];
        if (offset == 0)
                return -ENOENT;
        return offset;
index 4ac6760..6c27bd0 100644 (file)
@@ -1487,11 +1487,12 @@ static int vmx_rtit_ctl_check(struct kvm_vcpu *vcpu, u64 data)
        return 0;
 }
 
-static bool vmx_can_emulate_instruction(struct kvm_vcpu *vcpu, void *insn, int insn_len)
+static bool vmx_can_emulate_instruction(struct kvm_vcpu *vcpu, int emul_type,
+                                       void *insn, int insn_len)
 {
        /*
         * Emulation of instructions in SGX enclaves is impossible as RIP does
-        * not point  tthe failing instruction, and even if it did, the code
+        * not point at the failing instruction, and even if it did, the code
         * stream is inaccessible.  Inject #UD instead of exiting to userspace
         * so that guest userspace can't DoS the guest simply by triggering
         * emulation (enclaves are CPL3 only).
@@ -2603,7 +2604,6 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf,
                return -EIO;
 
        vmcs_conf->size = vmx_msr_high & 0x1fff;
-       vmcs_conf->order = get_order(vmcs_conf->size);
        vmcs_conf->basic_cap = vmx_msr_high & ~0x1fff;
 
        vmcs_conf->revision_id = vmx_msr_low;
@@ -2628,7 +2628,7 @@ struct vmcs *alloc_vmcs_cpu(bool shadow, int cpu, gfp_t flags)
        struct page *pages;
        struct vmcs *vmcs;
 
-       pages = __alloc_pages_node(node, flags, vmcs_config.order);
+       pages = __alloc_pages_node(node, flags, 0);
        if (!pages)
                return NULL;
        vmcs = page_address(pages);
@@ -2647,7 +2647,7 @@ struct vmcs *alloc_vmcs_cpu(bool shadow, int cpu, gfp_t flags)
 
 void free_vmcs(struct vmcs *vmcs)
 {
-       free_pages((unsigned long)vmcs, vmcs_config.order);
+       free_page((unsigned long)vmcs);
 }
 
 /*
@@ -4041,6 +4041,21 @@ static int vmx_deliver_posted_interrupt(struct kvm_vcpu *vcpu, int vector)
        return 0;
 }
 
+static void vmx_deliver_interrupt(struct kvm_lapic *apic, int delivery_mode,
+                                 int trig_mode, int vector)
+{
+       struct kvm_vcpu *vcpu = apic->vcpu;
+
+       if (vmx_deliver_posted_interrupt(vcpu, vector)) {
+               kvm_lapic_set_irr(vector, apic);
+               kvm_make_request(KVM_REQ_EVENT, vcpu);
+               kvm_vcpu_kick(vcpu);
+       } else {
+               trace_kvm_apicv_accept_irq(vcpu->vcpu_id, delivery_mode,
+                                          trig_mode, vector);
+       }
+}
+
 /*
  * Set up the vmcs's constant host-state fields, i.e., host-state fields that
  * will not change in the lifetime of the guest.
@@ -4094,10 +4109,14 @@ void vmx_set_constant_host_state(struct vcpu_vmx *vmx)
        vmcs_write32(HOST_IA32_SYSENTER_CS, low32);
 
        /*
-        * If 32-bit syscall is enabled, vmx_vcpu_load_vcms rewrites
-        * HOST_IA32_SYSENTER_ESP.
+        * SYSENTER is used for 32-bit system calls on either 32-bit or
+        * 64-bit kernels.  It is always zero If neither is allowed, otherwise
+        * vmx_vcpu_load_vmcs loads it with the per-CPU entry stack (and may
+        * have already done so!).
         */
-       vmcs_writel(HOST_IA32_SYSENTER_ESP, 0);
+       if (!IS_ENABLED(CONFIG_IA32_EMULATION) && !IS_ENABLED(CONFIG_X86_32))
+               vmcs_writel(HOST_IA32_SYSENTER_ESP, 0);
+
        rdmsrl(MSR_IA32_SYSENTER_EIP, tmpl);
        vmcs_writel(HOST_IA32_SYSENTER_EIP, tmpl);   /* 22.2.3 */
 
@@ -4901,8 +4920,33 @@ static int handle_exception_nmi(struct kvm_vcpu *vcpu)
                dr6 = vmx_get_exit_qual(vcpu);
                if (!(vcpu->guest_debug &
                      (KVM_GUESTDBG_SINGLESTEP | KVM_GUESTDBG_USE_HW_BP))) {
+                       /*
+                        * If the #DB was due to ICEBP, a.k.a. INT1, skip the
+                        * instruction.  ICEBP generates a trap-like #DB, but
+                        * despite its interception control being tied to #DB,
+                        * is an instruction intercept, i.e. the VM-Exit occurs
+                        * on the ICEBP itself.  Note, skipping ICEBP also
+                        * clears STI and MOVSS blocking.
+                        *
+                        * For all other #DBs, set vmcs.PENDING_DBG_EXCEPTIONS.BS
+                        * if single-step is enabled in RFLAGS and STI or MOVSS
+                        * blocking is active, as the CPU doesn't set the bit
+                        * on VM-Exit due to #DB interception.  VM-Entry has a
+                        * consistency check that a single-step #DB is pending
+                        * in this scenario as the previous instruction cannot
+                        * have toggled RFLAGS.TF 0=>1 (because STI and POP/MOV
+                        * don't modify RFLAGS), therefore the one instruction
+                        * delay when activating single-step breakpoints must
+                        * have already expired.  Note, the CPU sets/clears BS
+                        * as appropriate for all other VM-Exits types.
+                        */
                        if (is_icebp(intr_info))
                                WARN_ON(!skip_emulated_instruction(vcpu));
+                       else if ((vmx_get_rflags(vcpu) & X86_EFLAGS_TF) &&
+                                (vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) &
+                                 (GUEST_INTR_STATE_STI | GUEST_INTR_STATE_MOV_SS)))
+                               vmcs_writel(GUEST_PENDING_DBG_EXCEPTIONS,
+                                           vmcs_readl(GUEST_PENDING_DBG_EXCEPTIONS) | DR6_BS);
 
                        kvm_queue_exception_p(vcpu, DB_VECTOR, dr6);
                        return 1;
@@ -5397,7 +5441,7 @@ static int handle_ept_misconfig(struct kvm_vcpu *vcpu)
 {
        gpa_t gpa;
 
-       if (!vmx_can_emulate_instruction(vcpu, NULL, 0))
+       if (!vmx_can_emulate_instruction(vcpu, EMULTYPE_PF, NULL, 0))
                return 1;
 
        /*
@@ -6725,7 +6769,7 @@ static fastpath_t vmx_exit_handlers_fastpath(struct kvm_vcpu *vcpu)
 static noinstr void vmx_vcpu_enter_exit(struct kvm_vcpu *vcpu,
                                        struct vcpu_vmx *vmx)
 {
-       kvm_guest_enter_irqoff();
+       guest_state_enter_irqoff();
 
        /* L1D Flush includes CPU buffer clear to mitigate MDS */
        if (static_branch_unlikely(&vmx_l1d_should_flush))
@@ -6741,7 +6785,7 @@ static noinstr void vmx_vcpu_enter_exit(struct kvm_vcpu *vcpu,
 
        vcpu->arch.cr2 = native_read_cr2();
 
-       kvm_guest_exit_irqoff();
+       guest_state_exit_irqoff();
 }
 
 static fastpath_t vmx_vcpu_run(struct kvm_vcpu *vcpu)
@@ -7739,7 +7783,7 @@ static struct kvm_x86_ops vmx_x86_ops __initdata = {
        .hwapic_isr_update = vmx_hwapic_isr_update,
        .guest_apic_has_interrupt = vmx_guest_apic_has_interrupt,
        .sync_pir_to_irr = vmx_sync_pir_to_irr,
-       .deliver_posted_interrupt = vmx_deliver_posted_interrupt,
+       .deliver_interrupt = vmx_deliver_interrupt,
        .dy_apicv_has_pending_interrupt = pi_has_pending_interrupt,
 
        .set_tss_addr = vmx_set_tss_addr,
index 9e43d75..7131d73 100644 (file)
@@ -90,6 +90,8 @@
 u64 __read_mostly kvm_mce_cap_supported = MCG_CTL_P | MCG_SER_P;
 EXPORT_SYMBOL_GPL(kvm_mce_cap_supported);
 
+#define  ERR_PTR_USR(e)  ((void __user *)ERR_PTR(e))
+
 #define emul_to_vcpu(ctxt) \
        ((struct kvm_vcpu *)(ctxt)->vcpu)
 
@@ -3535,6 +3537,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
                if (data & ~supported_xss)
                        return 1;
                vcpu->arch.ia32_xss = data;
+               kvm_update_cpuid_runtime(vcpu);
                break;
        case MSR_SMI_COUNT:
                if (!msr_info->host_initiated)
@@ -4229,6 +4232,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
        case KVM_CAP_SREGS2:
        case KVM_CAP_EXIT_ON_EMULATION_FAILURE:
        case KVM_CAP_VCPU_ATTRIBUTES:
+       case KVM_CAP_SYS_ATTRIBUTES:
                r = 1;
                break;
        case KVM_CAP_EXIT_HYPERCALL:
@@ -4331,7 +4335,49 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
                break;
        }
        return r;
+}
+
+static inline void __user *kvm_get_attr_addr(struct kvm_device_attr *attr)
+{
+       void __user *uaddr = (void __user*)(unsigned long)attr->addr;
+
+       if ((u64)(unsigned long)uaddr != attr->addr)
+               return ERR_PTR_USR(-EFAULT);
+       return uaddr;
+}
+
+static int kvm_x86_dev_get_attr(struct kvm_device_attr *attr)
+{
+       u64 __user *uaddr = kvm_get_attr_addr(attr);
+
+       if (attr->group)
+               return -ENXIO;
+
+       if (IS_ERR(uaddr))
+               return PTR_ERR(uaddr);
+
+       switch (attr->attr) {
+       case KVM_X86_XCOMP_GUEST_SUPP:
+               if (put_user(supported_xcr0, uaddr))
+                       return -EFAULT;
+               return 0;
+       default:
+               return -ENXIO;
+               break;
+       }
+}
+
+static int kvm_x86_dev_has_attr(struct kvm_device_attr *attr)
+{
+       if (attr->group)
+               return -ENXIO;
 
+       switch (attr->attr) {
+       case KVM_X86_XCOMP_GUEST_SUPP:
+               return 0;
+       default:
+               return -ENXIO;
+       }
 }
 
 long kvm_arch_dev_ioctl(struct file *filp,
@@ -4422,6 +4468,22 @@ long kvm_arch_dev_ioctl(struct file *filp,
        case KVM_GET_SUPPORTED_HV_CPUID:
                r = kvm_ioctl_get_supported_hv_cpuid(NULL, argp);
                break;
+       case KVM_GET_DEVICE_ATTR: {
+               struct kvm_device_attr attr;
+               r = -EFAULT;
+               if (copy_from_user(&attr, (void __user *)arg, sizeof(attr)))
+                       break;
+               r = kvm_x86_dev_get_attr(&attr);
+               break;
+       }
+       case KVM_HAS_DEVICE_ATTR: {
+               struct kvm_device_attr attr;
+               r = -EFAULT;
+               if (copy_from_user(&attr, (void __user *)arg, sizeof(attr)))
+                       break;
+               r = kvm_x86_dev_has_attr(&attr);
+               break;
+       }
        default:
                r = -EINVAL;
                break;
@@ -4860,8 +4922,10 @@ static int kvm_vcpu_ioctl_x86_set_vcpu_events(struct kvm_vcpu *vcpu,
                vcpu->arch.apic->sipi_vector = events->sipi_vector;
 
        if (events->flags & KVM_VCPUEVENT_VALID_SMM) {
-               if (!!(vcpu->arch.hflags & HF_SMM_MASK) != events->smi.smm)
+               if (!!(vcpu->arch.hflags & HF_SMM_MASK) != events->smi.smm) {
+                       kvm_x86_ops.nested_ops->leave_nested(vcpu);
                        kvm_smm_changed(vcpu, events->smi.smm);
+               }
 
                vcpu->arch.smi_pending = events->smi.pending;
 
@@ -5022,11 +5086,11 @@ static int kvm_arch_tsc_has_attr(struct kvm_vcpu *vcpu,
 static int kvm_arch_tsc_get_attr(struct kvm_vcpu *vcpu,
                                 struct kvm_device_attr *attr)
 {
-       u64 __user *uaddr = (u64 __user *)(unsigned long)attr->addr;
+       u64 __user *uaddr = kvm_get_attr_addr(attr);
        int r;
 
-       if ((u64)(unsigned long)uaddr != attr->addr)
-               return -EFAULT;
+       if (IS_ERR(uaddr))
+               return PTR_ERR(uaddr);
 
        switch (attr->attr) {
        case KVM_VCPU_TSC_OFFSET:
@@ -5045,12 +5109,12 @@ static int kvm_arch_tsc_get_attr(struct kvm_vcpu *vcpu,
 static int kvm_arch_tsc_set_attr(struct kvm_vcpu *vcpu,
                                 struct kvm_device_attr *attr)
 {
-       u64 __user *uaddr = (u64 __user *)(unsigned long)attr->addr;
+       u64 __user *uaddr = kvm_get_attr_addr(attr);
        struct kvm *kvm = vcpu->kvm;
        int r;
 
-       if ((u64)(unsigned long)uaddr != attr->addr)
-               return -EFAULT;
+       if (IS_ERR(uaddr))
+               return PTR_ERR(uaddr);
 
        switch (attr->attr) {
        case KVM_VCPU_TSC_OFFSET: {
@@ -6810,6 +6874,13 @@ int kvm_write_guest_virt_system(struct kvm_vcpu *vcpu, gva_t addr, void *val,
 }
 EXPORT_SYMBOL_GPL(kvm_write_guest_virt_system);
 
+static int kvm_can_emulate_insn(struct kvm_vcpu *vcpu, int emul_type,
+                               void *insn, int insn_len)
+{
+       return static_call(kvm_x86_can_emulate_instruction)(vcpu, emul_type,
+                                                           insn, insn_len);
+}
+
 int handle_ud(struct kvm_vcpu *vcpu)
 {
        static const char kvm_emulate_prefix[] = { __KVM_EMULATE_PREFIX };
@@ -6817,7 +6888,7 @@ int handle_ud(struct kvm_vcpu *vcpu)
        char sig[5]; /* ud2; .ascii "kvm" */
        struct x86_exception e;
 
-       if (unlikely(!static_call(kvm_x86_can_emulate_instruction)(vcpu, NULL, 0)))
+       if (unlikely(!kvm_can_emulate_insn(vcpu, emul_type, NULL, 0)))
                return 1;
 
        if (force_emulation_prefix &&
@@ -8193,7 +8264,7 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa,
        bool writeback = true;
        bool write_fault_to_spt;
 
-       if (unlikely(!static_call(kvm_x86_can_emulate_instruction)(vcpu, insn, insn_len)))
+       if (unlikely(!kvm_can_emulate_insn(vcpu, emulation_type, insn, insn_len)))
                return 1;
 
        vcpu->arch.l1tf_flush_l1d = true;
@@ -9706,7 +9777,7 @@ void kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm,
                kvm_make_all_cpus_request(kvm, KVM_REQ_APIC_PAGE_RELOAD);
 }
 
-void kvm_vcpu_reload_apic_access_page(struct kvm_vcpu *vcpu)
+static void kvm_vcpu_reload_apic_access_page(struct kvm_vcpu *vcpu)
 {
        if (!lapic_in_kernel(vcpu))
                return;
@@ -9972,6 +10043,8 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
                set_debugreg(0, 7);
        }
 
+       guest_timing_enter_irqoff();
+
        for (;;) {
                /*
                 * Assert that vCPU vs. VM APICv state is consistent.  An APICv
@@ -10056,7 +10129,7 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
         * of accounting via context tracking, but the loss of accuracy is
         * acceptable for all known use cases.
         */
-       vtime_account_guest_exit();
+       guest_timing_exit_irqoff();
 
        if (lapic_in_kernel(vcpu)) {
                s64 delta = vcpu->arch.apic->lapic_timer.advance_expire_delta;
@@ -11209,7 +11282,8 @@ void kvm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event)
 
                vcpu->arch.msr_misc_features_enables = 0;
 
-               vcpu->arch.xcr0 = XFEATURE_MASK_FP;
+               __kvm_set_xcr(vcpu, 0, XFEATURE_MASK_FP);
+               __kvm_set_msr(vcpu, MSR_IA32_XSS, 0, true);
        }
 
        /* All GPRs except RDX (handled below) are zeroed on RESET/INIT. */
@@ -11226,8 +11300,6 @@ void kvm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event)
        cpuid_0x1 = kvm_find_cpuid_entry(vcpu, 1, 0);
        kvm_rdx_write(vcpu, cpuid_0x1 ? cpuid_0x1->eax : 0x600);
 
-       vcpu->arch.ia32_xss = 0;
-
        static_call(kvm_x86_vcpu_reset)(vcpu, init_event);
 
        kvm_set_rflags(vcpu, X86_EFLAGS_FIXED);
@@ -11571,8 +11643,6 @@ void kvm_arch_sync_events(struct kvm *kvm)
        kvm_free_pit(kvm);
 }
 
-#define  ERR_PTR_USR(e)  ((void __user *)ERR_PTR(e))
-
 /**
  * __x86_set_memory_region: Setup KVM internal memory slot
  *
index 635b75f..767ec7f 100644 (file)
 
 void kvm_spurious_fault(void);
 
-static __always_inline void kvm_guest_enter_irqoff(void)
-{
-       /*
-        * VMENTER enables interrupts (host state), but the kernel state is
-        * interrupts disabled when this is invoked. Also tell RCU about
-        * it. This is the same logic as for exit_to_user_mode().
-        *
-        * This ensures that e.g. latency analysis on the host observes
-        * guest mode as interrupt enabled.
-        *
-        * guest_enter_irqoff() informs context tracking about the
-        * transition to guest mode and if enabled adjusts RCU state
-        * accordingly.
-        */
-       instrumentation_begin();
-       trace_hardirqs_on_prepare();
-       lockdep_hardirqs_on_prepare(CALLER_ADDR0);
-       instrumentation_end();
-
-       guest_enter_irqoff();
-       lockdep_hardirqs_on(CALLER_ADDR0);
-}
-
-static __always_inline void kvm_guest_exit_irqoff(void)
-{
-       /*
-        * VMEXIT disables interrupts (host state), but tracing and lockdep
-        * have them in state 'on' as recorded before entering guest mode.
-        * Same as enter_from_user_mode().
-        *
-        * context_tracking_guest_exit() restores host context and reinstates
-        * RCU if enabled and required.
-        *
-        * This needs to be done immediately after VM-Exit, before any code
-        * that might contain tracepoints or call out to the greater world,
-        * e.g. before x86_spec_ctrl_restore_host().
-        */
-       lockdep_hardirqs_off(CALLER_ADDR0);
-       context_tracking_guest_exit();
-
-       instrumentation_begin();
-       trace_hardirqs_off_finish();
-       instrumentation_end();
-}
-
 #define KVM_NESTED_VMENTER_CONSISTENCY_CHECK(consistency_check)                \
 ({                                                                     \
        bool failed = (consistency_check);                              \
index 0e3f7d6..bad5753 100644 (file)
@@ -316,10 +316,7 @@ int __kvm_xen_has_interrupt(struct kvm_vcpu *v)
                                     "\tnotq %0\n"
                                     "\t" LOCK_PREFIX "andq %0, %2\n"
                                     "2:\n"
-                                    "\t.section .fixup,\"ax\"\n"
-                                    "3:\tjmp\t2b\n"
-                                    "\t.previous\n"
-                                    _ASM_EXTABLE_UA(1b, 3b)
+                                    _ASM_EXTABLE_UA(1b, 2b)
                                     : "=r" (evtchn_pending_sel),
                                       "+m" (vi->evtchn_pending_sel),
                                       "+m" (v->arch.xen.evtchn_pending_sel)
@@ -335,10 +332,7 @@ int __kvm_xen_has_interrupt(struct kvm_vcpu *v)
                                     "\tnotl %0\n"
                                     "\t" LOCK_PREFIX "andl %0, %2\n"
                                     "2:\n"
-                                    "\t.section .fixup,\"ax\"\n"
-                                    "3:\tjmp\t2b\n"
-                                    "\t.previous\n"
-                                    _ASM_EXTABLE_UA(1b, 3b)
+                                    _ASM_EXTABLE_UA(1b, 2b)
                                     : "=r" (evtchn_pending_sel32),
                                       "+m" (vi->evtchn_pending_sel),
                                       "+m" (v->arch.xen.evtchn_pending_sel)
index 2edd866..615a76d 100644 (file)
@@ -353,8 +353,8 @@ static void pci_fixup_video(struct pci_dev *pdev)
                }
        }
 }
-DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID,
-                               PCI_CLASS_DISPLAY_VGA, 8, pci_fixup_video);
+DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_ANY_ID, PCI_ANY_ID,
+                              PCI_CLASS_DISPLAY_VGA, 8, pci_fixup_video);
 
 
 static const struct dmi_system_id msi_k8t_dmi_table[] = {
index 4230094..6448c50 100644 (file)
@@ -9,6 +9,7 @@
 #include <xen/events.h>
 #include <xen/interface/memory.h>
 
+#include <asm/apic.h>
 #include <asm/cpu.h>
 #include <asm/smp.h>
 #include <asm/io_apic.h>
@@ -242,15 +243,9 @@ static __init int xen_parse_no_vector_callback(char *arg)
 }
 early_param("xen_no_vector_callback", xen_parse_no_vector_callback);
 
-bool __init xen_hvm_need_lapic(void)
+static __init bool xen_x2apic_available(void)
 {
-       if (xen_pv_domain())
-               return false;
-       if (!xen_hvm_domain())
-               return false;
-       if (xen_feature(XENFEAT_hvm_pirqs) && xen_have_vector_callback)
-               return false;
-       return true;
+       return x2apic_supported();
 }
 
 static __init void xen_hvm_guest_late_init(void)
@@ -312,7 +307,7 @@ struct hypervisor_x86 x86_hyper_xen_hvm __initdata = {
        .detect                 = xen_platform_hvm,
        .type                   = X86_HYPER_XEN_HVM,
        .init.init_platform     = xen_hvm_guest_init,
-       .init.x2apic_available  = xen_x2apic_para_available,
+       .init.x2apic_available  = xen_x2apic_available,
        .init.init_mem_mapping  = xen_hvm_init_mem_mapping,
        .init.guest_late_init   = xen_hvm_guest_late_init,
        .runtime.pin_vcpu       = xen_pin_vcpu,
index 5004feb..d47c3d1 100644 (file)
@@ -1341,10 +1341,6 @@ asmlinkage __visible void __init xen_start_kernel(void)
 
                xen_acpi_sleep_register();
 
-               /* Avoid searching for BIOS MP tables */
-               x86_init.mpparse.find_smp_config = x86_init_noop;
-               x86_init.mpparse.get_smp_config = x86_init_uint_noop;
-
                xen_boot_params_init_edd();
 
 #ifdef CONFIG_ACPI
index 6a8f3b5..4a60192 100644 (file)
@@ -148,28 +148,12 @@ int xen_smp_intr_init_pv(unsigned int cpu)
        return rc;
 }
 
-static void __init xen_fill_possible_map(void)
-{
-       int i, rc;
-
-       if (xen_initial_domain())
-               return;
-
-       for (i = 0; i < nr_cpu_ids; i++) {
-               rc = HYPERVISOR_vcpu_op(VCPUOP_is_up, i, NULL);
-               if (rc >= 0) {
-                       num_processors++;
-                       set_cpu_possible(i, true);
-               }
-       }
-}
-
-static void __init xen_filter_cpu_maps(void)
+static void __init _get_smp_config(unsigned int early)
 {
        int i, rc;
        unsigned int subtract = 0;
 
-       if (!xen_initial_domain())
+       if (early)
                return;
 
        num_processors = 0;
@@ -210,7 +194,6 @@ static void __init xen_pv_smp_prepare_boot_cpu(void)
                 * sure the old memory can be recycled. */
                make_lowmem_page_readwrite(xen_initial_gdt);
 
-       xen_filter_cpu_maps();
        xen_setup_vcpu_info_placement();
 
        /*
@@ -476,5 +459,8 @@ static const struct smp_ops xen_smp_ops __initconst = {
 void __init xen_smp_init(void)
 {
        smp_ops = xen_smp_ops;
-       xen_fill_possible_map();
+
+       /* Avoid searching for BIOS MP tables */
+       x86_init.mpparse.find_smp_config = x86_init_noop;
+       x86_init.mpparse.get_smp_config = _get_smp_config;
 }
index d251147..0827b19 100644 (file)
@@ -373,7 +373,7 @@ void bio_integrity_advance(struct bio *bio, unsigned int bytes_done)
        struct blk_integrity *bi = blk_get_integrity(bio->bi_bdev->bd_disk);
        unsigned bytes = bio_integrity_bytes(bi, bytes_done >> 9);
 
-       bip->bip_iter.bi_sector += bytes_done >> 9;
+       bip->bip_iter.bi_sector += bio_integrity_intervals(bi, bytes_done >> 9);
        bvec_iter_advance(bip->bip_vec, &bip->bip_iter, bytes);
 }
 
index 97f8bc8..d93e3bb 100644 (file)
@@ -1061,20 +1061,32 @@ again:
 }
 
 static unsigned long __part_start_io_acct(struct block_device *part,
-                                         unsigned int sectors, unsigned int op)
+                                         unsigned int sectors, unsigned int op,
+                                         unsigned long start_time)
 {
        const int sgrp = op_stat_group(op);
-       unsigned long now = READ_ONCE(jiffies);
 
        part_stat_lock();
-       update_io_ticks(part, now, false);
+       update_io_ticks(part, start_time, false);
        part_stat_inc(part, ios[sgrp]);
        part_stat_add(part, sectors[sgrp], sectors);
        part_stat_local_inc(part, in_flight[op_is_write(op)]);
        part_stat_unlock();
 
-       return now;
+       return start_time;
+}
+
+/**
+ * bio_start_io_acct_time - start I/O accounting for bio based drivers
+ * @bio:       bio to start account for
+ * @start_time:        start time that should be passed back to bio_end_io_acct().
+ */
+void bio_start_io_acct_time(struct bio *bio, unsigned long start_time)
+{
+       __part_start_io_acct(bio->bi_bdev, bio_sectors(bio),
+                            bio_op(bio), start_time);
 }
+EXPORT_SYMBOL_GPL(bio_start_io_acct_time);
 
 /**
  * bio_start_io_acct - start I/O accounting for bio based drivers
@@ -1084,14 +1096,15 @@ static unsigned long __part_start_io_acct(struct block_device *part,
  */
 unsigned long bio_start_io_acct(struct bio *bio)
 {
-       return __part_start_io_acct(bio->bi_bdev, bio_sectors(bio), bio_op(bio));
+       return __part_start_io_acct(bio->bi_bdev, bio_sectors(bio),
+                                   bio_op(bio), jiffies);
 }
 EXPORT_SYMBOL_GPL(bio_start_io_acct);
 
 unsigned long disk_start_io_acct(struct gendisk *disk, unsigned int sectors,
                                 unsigned int op)
 {
-       return __part_start_io_acct(disk->part0, sectors, op);
+       return __part_start_io_acct(disk->part0, sectors, op, jiffies);
 }
 EXPORT_SYMBOL(disk_start_io_acct);
 
index b925f3d..18c68d8 100644 (file)
@@ -144,7 +144,7 @@ int disk_register_independent_access_ranges(struct gendisk *disk,
                                   &q->kobj, "%s", "independent_access_ranges");
        if (ret) {
                q->ia_ranges = NULL;
-               kfree(iars);
+               kobject_put(&iars->kobj);
                return ret;
        }
 
index f3bf335..1adfe48 100644 (file)
@@ -2922,6 +2922,8 @@ blk_status_t blk_insert_cloned_request(struct request_queue *q, struct request *
         */
        blk_mq_run_dispatch_ops(rq->q,
                        ret = blk_mq_request_issue_directly(rq, true));
+       if (ret)
+               blk_account_io_done(rq, ktime_get_ns());
        return ret;
 }
 EXPORT_SYMBOL_GPL(blk_insert_cloned_request);
index 26bf15c..4f59e0f 100644 (file)
@@ -566,34 +566,37 @@ static ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to)
 {
        struct block_device *bdev = iocb->ki_filp->private_data;
        loff_t size = bdev_nr_bytes(bdev);
-       size_t count = iov_iter_count(to);
        loff_t pos = iocb->ki_pos;
        size_t shorted = 0;
        ssize_t ret = 0;
+       size_t count;
 
-       if (unlikely(pos + count > size)) {
+       if (unlikely(pos + iov_iter_count(to) > size)) {
                if (pos >= size)
                        return 0;
                size -= pos;
-               if (count > size) {
-                       shorted = count - size;
-                       iov_iter_truncate(to, size);
-               }
+               shorted = iov_iter_count(to) - size;
+               iov_iter_truncate(to, size);
        }
 
+       count = iov_iter_count(to);
+       if (!count)
+               goto reexpand; /* skip atime */
+
        if (iocb->ki_flags & IOCB_DIRECT) {
                struct address_space *mapping = iocb->ki_filp->f_mapping;
 
                if (iocb->ki_flags & IOCB_NOWAIT) {
-                       if (filemap_range_needs_writeback(mapping, iocb->ki_pos,
-                                               iocb->ki_pos + count - 1))
-                               return -EAGAIN;
+                       if (filemap_range_needs_writeback(mapping, pos,
+                                                         pos + count - 1)) {
+                               ret = -EAGAIN;
+                               goto reexpand;
+                       }
                } else {
-                       ret = filemap_write_and_wait_range(mapping,
-                                               iocb->ki_pos,
-                                               iocb->ki_pos + count - 1);
+                       ret = filemap_write_and_wait_range(mapping, pos,
+                                                          pos + count - 1);
                        if (ret < 0)
-                               return ret;
+                               goto reexpand;
                }
 
                file_accessed(iocb->ki_filp);
@@ -603,12 +606,14 @@ static ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to)
                        iocb->ki_pos += ret;
                        count -= ret;
                }
+               iov_iter_revert(to, count - iov_iter_count(to));
                if (ret < 0 || !count)
-                       return ret;
+                       goto reexpand;
        }
 
        ret = filemap_read(iocb, to, ret);
 
+reexpand:
        if (unlikely(shorted))
                iov_iter_reexpand(to, iov_iter_count(to) + shorted);
        return ret;
index 72fe480..5f96a21 100644 (file)
 static int crypto_blake2s_update_generic(struct shash_desc *desc,
                                         const u8 *in, unsigned int inlen)
 {
-       return crypto_blake2s_update(desc, in, inlen, blake2s_compress_generic);
+       return crypto_blake2s_update(desc, in, inlen, true);
 }
 
 static int crypto_blake2s_final_generic(struct shash_desc *desc, u8 *out)
 {
-       return crypto_blake2s_final(desc, out, blake2s_compress_generic);
+       return crypto_blake2s_final(desc, out, true);
 }
 
 #define BLAKE2S_ALG(name, driver_name, digest_size)                    \
index ba45541..273741d 100644 (file)
@@ -11,6 +11,7 @@ menuconfig ACPI
        depends on ARCH_SUPPORTS_ACPI
        select PNP
        select NLS
+       select CRC32
        default y if X86
        help
          Advanced Configuration and Power Interface (ACPI) support for 
index 67f8802..e1b1dd2 100644 (file)
@@ -2007,6 +2007,9 @@ static bool ata_log_supported(struct ata_device *dev, u8 log)
 {
        struct ata_port *ap = dev->link->ap;
 
+       if (dev->horkage & ATA_HORKAGE_NO_LOG_DIR)
+               return false;
+
        if (ata_read_log_page(dev, ATA_LOG_DIRECTORY, 0, ap->sector_buf, 1))
                return false;
        return get_unaligned_le16(&ap->sector_buf[log * 2]) ? true : false;
@@ -4073,6 +4076,13 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
        { "WDC WD3000JD-*",             NULL,   ATA_HORKAGE_WD_BROKEN_LPM },
        { "WDC WD3200JD-*",             NULL,   ATA_HORKAGE_WD_BROKEN_LPM },
 
+       /*
+        * This sata dom device goes on a walkabout when the ATA_LOG_DIRECTORY
+        * log page is accessed. Ensure we never ask for this log page with
+        * these devices.
+        */
+       { "SATADOM-ML 3ME",             NULL,   ATA_HORKAGE_NO_LOG_DIR },
+
        /* End Marker */
        { }
 };
index 0283294..87c7c90 100644 (file)
@@ -128,6 +128,8 @@ int __pata_platform_probe(struct device *dev, struct resource *io_res,
        ap = host->ports[0];
 
        ap->ops = devm_kzalloc(dev, sizeof(*ap->ops), GFP_KERNEL);
+       if (!ap->ops)
+               return -ENOMEM;
        ap->ops->inherits = &ata_sff_port_ops;
        ap->ops->cable_detect = ata_cable_unknown;
        ap->ops->set_mode = pata_platform_set_mode;
index 68613f0..3404a91 100644 (file)
@@ -762,7 +762,7 @@ static bool crng_init_try_arch(struct crng_state *crng)
        return arch_init;
 }
 
-static bool __init crng_init_try_arch_early(struct crng_state *crng)
+static bool __init crng_init_try_arch_early(void)
 {
        int i;
        bool arch_init = true;
@@ -774,7 +774,7 @@ static bool __init crng_init_try_arch_early(struct crng_state *crng)
                        rv = random_get_entropy();
                        arch_init = false;
                }
-               crng->state[i] ^= rv;
+               primary_crng.state[i] ^= rv;
        }
 
        return arch_init;
@@ -788,22 +788,20 @@ static void crng_initialize_secondary(struct crng_state *crng)
        crng->init_time = jiffies - CRNG_RESEED_INTERVAL - 1;
 }
 
-static void __init crng_initialize_primary(struct crng_state *crng)
+static void __init crng_initialize_primary(void)
 {
-       _extract_entropy(&crng->state[4], sizeof(u32) * 12);
-       if (crng_init_try_arch_early(crng) && trust_cpu && crng_init < 2) {
+       _extract_entropy(&primary_crng.state[4], sizeof(u32) * 12);
+       if (crng_init_try_arch_early() && trust_cpu && crng_init < 2) {
                invalidate_batched_entropy();
                numa_crng_init();
                crng_init = 2;
                pr_notice("crng init done (trusting CPU's manufacturer)\n");
        }
-       crng->init_time = jiffies - CRNG_RESEED_INTERVAL - 1;
+       primary_crng.init_time = jiffies - CRNG_RESEED_INTERVAL - 1;
 }
 
-static void crng_finalize_init(struct crng_state *crng)
+static void crng_finalize_init(void)
 {
-       if (crng != &primary_crng || crng_init >= 2)
-               return;
        if (!system_wq) {
                /* We can't call numa_crng_init until we have workqueues,
                 * so mark this for processing later. */
@@ -814,6 +812,7 @@ static void crng_finalize_init(struct crng_state *crng)
        invalidate_batched_entropy();
        numa_crng_init();
        crng_init = 2;
+       crng_need_final_init = false;
        process_random_ready_list();
        wake_up_interruptible(&crng_init_wait);
        kill_fasync(&fasync, SIGIO, POLL_IN);
@@ -980,7 +979,8 @@ static void crng_reseed(struct crng_state *crng, bool use_input_pool)
        memzero_explicit(&buf, sizeof(buf));
        WRITE_ONCE(crng->init_time, jiffies);
        spin_unlock_irqrestore(&crng->lock, flags);
-       crng_finalize_init(crng);
+       if (crng == &primary_crng && crng_init < 2)
+               crng_finalize_init();
 }
 
 static void _extract_crng(struct crng_state *crng, u8 out[CHACHA_BLOCK_SIZE])
@@ -1697,8 +1697,8 @@ int __init rand_initialize(void)
 {
        init_std_data();
        if (crng_need_final_init)
-               crng_finalize_init(&primary_crng);
-       crng_initialize_primary(&primary_crng);
+               crng_finalize_init();
+       crng_initialize_primary();
        crng_global_init_time = jiffies;
        if (ratelimit_disable) {
                urandom_warning.interval = 0;
@@ -1856,7 +1856,10 @@ static long random_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
                 */
                if (!capable(CAP_SYS_ADMIN))
                        return -EPERM;
-               input_pool.entropy_count = 0;
+               if (xchg(&input_pool.entropy_count, 0) && random_write_wakeup_bits) {
+                       wake_up_interruptible(&random_write_wait);
+                       kill_fasync(&fasync, SIGIO, POLL_OUT);
+               }
                return 0;
        case RNDRESEEDCRNG:
                if (!capable(CAP_SYS_ADMIN))
@@ -2205,13 +2208,15 @@ void add_hwgenerator_randomness(const char *buffer, size_t count,
                        return;
        }
 
-       /* Suspend writing if we're above the trickle threshold.
+       /* Throttle writing if we're above the trickle threshold.
         * We'll be woken up again once below random_write_wakeup_thresh,
-        * or when the calling thread is about to terminate.
+        * when the calling thread is about to terminate, or once
+        * CRNG_RESEED_INTERVAL has lapsed.
         */
-       wait_event_interruptible(random_write_wait,
+       wait_event_interruptible_timeout(random_write_wait,
                        !system_wq || kthread_should_stop() ||
-                       POOL_ENTROPY_BITS() <= random_write_wakeup_bits);
+                       POOL_ENTROPY_BITS() <= random_write_wakeup_bits,
+                       CRNG_RESEED_INTERVAL);
        mix_pool_bytes(buffer, count);
        credit_entropy_bits(entropy);
 }
index 646ad38..ccac1c4 100644 (file)
@@ -358,7 +358,7 @@ static void cn_proc_mcast_ctl(struct cn_msg *msg,
         * other namespaces.
         */
        if ((current_user_ns() != &init_user_ns) ||
-           (task_active_pid_ns(current) != &init_pid_ns))
+           !task_is_in_init_pid_ns(current))
                return;
 
        /* Can only change if privileged. */
index 7e0957e..869894b 100644 (file)
@@ -90,10 +90,8 @@ struct counter_device *counter_alloc(size_t sizeof_priv)
        int err;
 
        ch = kzalloc(sizeof(*ch) + sizeof_priv, GFP_KERNEL);
-       if (!ch) {
-               err = -ENOMEM;
-               goto err_alloc_ch;
-       }
+       if (!ch)
+               return NULL;
 
        counter = &ch->counter;
        dev = &counter->dev;
@@ -123,9 +121,8 @@ err_chrdev_add:
 err_ida_alloc:
 
        kfree(ch);
-err_alloc_ch:
 
-       return ERR_PTR(err);
+       return NULL;
 }
 EXPORT_SYMBOL_GPL(counter_alloc);
 
@@ -208,12 +205,12 @@ struct counter_device *devm_counter_alloc(struct device *dev, size_t sizeof_priv
        int err;
 
        counter = counter_alloc(sizeof_priv);
-       if (IS_ERR(counter))
-               return counter;
+       if (!counter)
+               return NULL;
 
        err = devm_add_action_or_reset(dev, devm_counter_put, counter);
        if (err < 0)
-               return ERR_PTR(err);
+               return NULL;
 
        return counter;
 }
index 56bf5ad..8f5848a 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/xarray.h>
 #include <linux/list.h>
 #include <linux/slab.h>
+#include <linux/nospec.h>
 #include <linux/uaccess.h>
 #include <linux/syscalls.h>
 #include <linux/dma-heap.h>
@@ -135,6 +136,7 @@ static long dma_heap_ioctl(struct file *file, unsigned int ucmd,
        if (nr >= ARRAY_SIZE(dma_heap_ioctl_cmds))
                return -EINVAL;
 
+       nr = array_index_nospec(nr, ARRAY_SIZE(dma_heap_ioctl_cmds));
        /* Get the kernel ioctl cmd that matches */
        kcmd = dma_heap_ioctl_cmds[nr];
 
index 3a6d241..5dd2978 100644 (file)
@@ -350,7 +350,7 @@ static int altr_sdram_probe(struct platform_device *pdev)
        if (irq < 0) {
                edac_printk(KERN_ERR, EDAC_MC,
                            "No irq %d in DT\n", irq);
-               return -ENODEV;
+               return irq;
        }
 
        /* Arria10 has a 2nd IRQ */
index 2ccd1db..7197f9f 100644 (file)
@@ -1919,7 +1919,7 @@ static int xgene_edac_probe(struct platform_device *pdev)
                        irq = platform_get_irq_optional(pdev, i);
                        if (irq < 0) {
                                dev_err(&pdev->dev, "No IRQ resource\n");
-                               rc = -EINVAL;
+                               rc = irq;
                                goto out_err;
                        }
                        rc = devm_request_irq(&pdev->dev, irq,
index ae79c33..7de3f5b 100644 (file)
@@ -722,6 +722,13 @@ void __init efi_systab_report_header(const efi_table_hdr_t *systab_hdr,
                systab_hdr->revision >> 16,
                systab_hdr->revision & 0xffff,
                vendor);
+
+       if (IS_ENABLED(CONFIG_X86_64) &&
+           systab_hdr->revision > EFI_1_10_SYSTEM_TABLE_REVISION &&
+           !strcmp(vendor, "Apple")) {
+               pr_info("Apple Mac detected, using EFI v1.10 runtime services only\n");
+               efi.runtime_version = EFI_1_10_SYSTEM_TABLE_REVISION;
+       }
 }
 
 static __initdata char memory_type_name[][13] = {
index 2363fee..9cc5560 100644 (file)
@@ -119,9 +119,9 @@ efi_status_t handle_kernel_image(unsigned long *image_addr,
        if (image->image_base != _text)
                efi_err("FIRMWARE BUG: efi_loaded_image_t::image_base has bogus value\n");
 
-       if (!IS_ALIGNED((u64)_text, EFI_KIMG_ALIGN))
-               efi_err("FIRMWARE BUG: kernel image not aligned on %ldk boundary\n",
-                       EFI_KIMG_ALIGN >> 10);
+       if (!IS_ALIGNED((u64)_text, SEGMENT_ALIGN))
+               efi_err("FIRMWARE BUG: kernel image not aligned on %dk boundary\n",
+                       SEGMENT_ALIGN >> 10);
 
        kernel_size = _edata - _text;
        kernel_memsize = kernel_size + (_end - _edata);
index 838bbfe..04b137e 100644 (file)
@@ -816,7 +816,7 @@ gpio_sim_make_bank_swnode(struct gpio_sim_bank *bank,
 
        properties[prop_idx++] = PROPERTY_ENTRY_U32("ngpios", bank->num_lines);
 
-       if (bank->label)
+       if (bank->label && (strlen(bank->label) > 0))
                properties[prop_idx++] = PROPERTY_ENTRY_STRING("gpio-sim,label",
                                                               bank->label);
 
index d8b854f..9a53a4d 100644 (file)
@@ -1408,12 +1408,10 @@ int amdgpu_acpi_smart_shift_update(struct drm_device *dev, enum amdgpu_ss ss_sta
 int amdgpu_acpi_pcie_notify_device_ready(struct amdgpu_device *adev);
 
 void amdgpu_acpi_get_backlight_caps(struct amdgpu_dm_backlight_caps *caps);
-bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev);
 void amdgpu_acpi_detect(void);
 #else
 static inline int amdgpu_acpi_init(struct amdgpu_device *adev) { return 0; }
 static inline void amdgpu_acpi_fini(struct amdgpu_device *adev) { }
-static inline bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) { return false; }
 static inline void amdgpu_acpi_detect(void) { }
 static inline bool amdgpu_acpi_is_power_shift_control_supported(void) { return false; }
 static inline int amdgpu_acpi_power_shift_control(struct amdgpu_device *adev,
@@ -1422,6 +1420,14 @@ static inline int amdgpu_acpi_smart_shift_update(struct drm_device *dev,
                                                 enum amdgpu_ss ss_state) { return 0; }
 #endif
 
+#if defined(CONFIG_ACPI) && defined(CONFIG_SUSPEND)
+bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev);
+bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev);
+#else
+static inline bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) { return false; }
+static inline bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev) { return false; }
+#endif
+
 int amdgpu_cs_find_mapping(struct amdgpu_cs_parser *parser,
                           uint64_t addr, struct amdgpu_bo **bo,
                           struct amdgpu_bo_va_mapping **mapping);
index 4811b0f..0e12315 100644 (file)
@@ -1031,6 +1031,20 @@ void amdgpu_acpi_detect(void)
        }
 }
 
+#if IS_ENABLED(CONFIG_SUSPEND)
+/**
+ * amdgpu_acpi_is_s3_active
+ *
+ * @adev: amdgpu_device_pointer
+ *
+ * returns true if supported, false if not.
+ */
+bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev)
+{
+       return !(adev->flags & AMD_IS_APU) ||
+               (pm_suspend_target_state == PM_SUSPEND_MEM);
+}
+
 /**
  * amdgpu_acpi_is_s0ix_active
  *
@@ -1040,11 +1054,24 @@ void amdgpu_acpi_detect(void)
  */
 bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev)
 {
-#if IS_ENABLED(CONFIG_AMD_PMC) && IS_ENABLED(CONFIG_SUSPEND)
-       if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) {
-               if (adev->flags & AMD_IS_APU)
-                       return pm_suspend_target_state == PM_SUSPEND_TO_IDLE;
+       if (!(adev->flags & AMD_IS_APU) ||
+           (pm_suspend_target_state != PM_SUSPEND_TO_IDLE))
+               return false;
+
+       if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)) {
+               dev_warn_once(adev->dev,
+                             "Power consumption will be higher as BIOS has not been configured for suspend-to-idle.\n"
+                             "To use suspend-to-idle change the sleep mode in BIOS setup.\n");
+               return false;
        }
-#endif
+
+#if !IS_ENABLED(CONFIG_AMD_PMC)
+       dev_warn_once(adev->dev,
+                     "Power consumption will be higher as the kernel has not been compiled with CONFIG_AMD_PMC.\n");
        return false;
+#else
+       return true;
+#endif /* CONFIG_AMD_PMC */
 }
+
+#endif /* CONFIG_SUSPEND */
index b21bcdc..63a0899 100644 (file)
@@ -1525,6 +1525,87 @@ static const u16 amdgpu_unsupported_pciidlist[] = {
        0x99A0,
        0x99A2,
        0x99A4,
+       /* radeon secondary ids */
+       0x3171,
+       0x3e70,
+       0x4164,
+       0x4165,
+       0x4166,
+       0x4168,
+       0x4170,
+       0x4171,
+       0x4172,
+       0x4173,
+       0x496e,
+       0x4a69,
+       0x4a6a,
+       0x4a6b,
+       0x4a70,
+       0x4a74,
+       0x4b69,
+       0x4b6b,
+       0x4b6c,
+       0x4c6e,
+       0x4e64,
+       0x4e65,
+       0x4e66,
+       0x4e67,
+       0x4e68,
+       0x4e69,
+       0x4e6a,
+       0x4e71,
+       0x4f73,
+       0x5569,
+       0x556b,
+       0x556d,
+       0x556f,
+       0x5571,
+       0x5854,
+       0x5874,
+       0x5940,
+       0x5941,
+       0x5b72,
+       0x5b73,
+       0x5b74,
+       0x5b75,
+       0x5d44,
+       0x5d45,
+       0x5d6d,
+       0x5d6f,
+       0x5d72,
+       0x5d77,
+       0x5e6b,
+       0x5e6d,
+       0x7120,
+       0x7124,
+       0x7129,
+       0x712e,
+       0x712f,
+       0x7162,
+       0x7163,
+       0x7166,
+       0x7167,
+       0x7172,
+       0x7173,
+       0x71a0,
+       0x71a1,
+       0x71a3,
+       0x71a7,
+       0x71bb,
+       0x71e0,
+       0x71e1,
+       0x71e2,
+       0x71e6,
+       0x71e7,
+       0x71f2,
+       0x7269,
+       0x726b,
+       0x726e,
+       0x72a0,
+       0x72a8,
+       0x72b1,
+       0x72b3,
+       0x793f,
 };
 
 static const struct pci_device_id pciidlist[] = {
@@ -2165,13 +2246,20 @@ static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work)
 static int amdgpu_pmops_prepare(struct device *dev)
 {
        struct drm_device *drm_dev = dev_get_drvdata(dev);
+       struct amdgpu_device *adev = drm_to_adev(drm_dev);
 
        /* Return a positive number here so
         * DPM_FLAG_SMART_SUSPEND works properly
         */
        if (amdgpu_device_supports_boco(drm_dev))
-               return pm_runtime_suspended(dev) &&
-                       pm_suspend_via_firmware();
+               return pm_runtime_suspended(dev);
+
+       /* if we will not support s3 or s2i for the device
+        *  then skip suspend
+        */
+       if (!amdgpu_acpi_is_s0ix_active(adev) &&
+           !amdgpu_acpi_is_s3_active(adev))
+               return 1;
 
        return 0;
 }
index 5c3f240..4655702 100644 (file)
@@ -1904,7 +1904,7 @@ int amdgpu_copy_buffer(struct amdgpu_ring *ring, uint64_t src_offset,
        unsigned i;
        int r;
 
-       if (direct_submit && !ring->sched.ready) {
+       if (!direct_submit && !ring->sched.ready) {
                DRM_ERROR("Trying to move memory with ring turned off.\n");
                return -EINVAL;
        }
index 38bb427..a2f8ed0 100644 (file)
@@ -1140,6 +1140,9 @@ static void gmc_v10_0_get_clockgating_state(void *handle, u32 *flags)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+       if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 1, 3))
+               return;
+
        adev->mmhub.funcs->get_clockgating(adev, flags);
 
        if (adev->ip_versions[ATHUB_HWIP][0] >= IP_VERSION(2, 1, 0))
index ff5bb15..e6ef36d 100644 (file)
@@ -2033,10 +2033,10 @@ static void calculate_bandwidth(
        kfree(surface_type);
 free_tiling_mode:
        kfree(tiling_mode);
-free_yclk:
-       kfree(yclk);
 free_sclk:
        kfree(sclk);
+free_yclk:
+       kfree(yclk);
 }
 
 /*******************************************************************************
index ec19678..e447c74 100644 (file)
@@ -503,7 +503,6 @@ static void dcn_bw_calc_rq_dlg_ttu(
        //input[in_idx].dout.output_standard;
 
        /*todo: soc->sr_enter_plus_exit_time??*/
-       dlg_sys_param->t_srx_delay_us = dc->dcn_ip->dcfclk_cstate_latency / v->dcf_clk_deep_sleep;
 
        dml1_rq_dlg_get_rq_params(dml, rq_param, &input->pipe.src);
        dml1_extract_rq_regs(dml, rq_regs, rq_param);
index 48005de..bc4ddc3 100644 (file)
@@ -570,32 +570,32 @@ static struct wm_table lpddr5_wm_table = {
                        .wm_inst = WM_A,
                        .wm_type = WM_TYPE_PSTATE_CHG,
                        .pstate_latency_us = 11.65333,
-                       .sr_exit_time_us = 7.95,
-                       .sr_enter_plus_exit_time_us = 9,
+                       .sr_exit_time_us = 13.5,
+                       .sr_enter_plus_exit_time_us = 16.5,
                        .valid = true,
                },
                {
                        .wm_inst = WM_B,
                        .wm_type = WM_TYPE_PSTATE_CHG,
                        .pstate_latency_us = 11.65333,
-                       .sr_exit_time_us = 9.82,
-                       .sr_enter_plus_exit_time_us = 11.196,
+                       .sr_exit_time_us = 13.5,
+                       .sr_enter_plus_exit_time_us = 16.5,
                        .valid = true,
                },
                {
                        .wm_inst = WM_C,
                        .wm_type = WM_TYPE_PSTATE_CHG,
                        .pstate_latency_us = 11.65333,
-                       .sr_exit_time_us = 9.89,
-                       .sr_enter_plus_exit_time_us = 11.24,
+                       .sr_exit_time_us = 13.5,
+                       .sr_enter_plus_exit_time_us = 16.5,
                        .valid = true,
                },
                {
                        .wm_inst = WM_D,
                        .wm_type = WM_TYPE_PSTATE_CHG,
                        .pstate_latency_us = 11.65333,
-                       .sr_exit_time_us = 9.748,
-                       .sr_enter_plus_exit_time_us = 11.102,
+                       .sr_exit_time_us = 13.5,
+                       .sr_enter_plus_exit_time_us = 16.5,
                        .valid = true,
                },
        }
index 4162ce4..9d17c5a 100644 (file)
@@ -329,38 +329,38 @@ static struct clk_bw_params dcn31_bw_params = {
 
 };
 
-static struct wm_table ddr4_wm_table = {
+static struct wm_table ddr5_wm_table = {
        .entries = {
                {
                        .wm_inst = WM_A,
                        .wm_type = WM_TYPE_PSTATE_CHG,
                        .pstate_latency_us = 11.72,
-                       .sr_exit_time_us = 6.09,
-                       .sr_enter_plus_exit_time_us = 7.14,
+                       .sr_exit_time_us = 9,
+                       .sr_enter_plus_exit_time_us = 11,
                        .valid = true,
                },
                {
                        .wm_inst = WM_B,
                        .wm_type = WM_TYPE_PSTATE_CHG,
                        .pstate_latency_us = 11.72,
-                       .sr_exit_time_us = 10.12,
-                       .sr_enter_plus_exit_time_us = 11.48,
+                       .sr_exit_time_us = 9,
+                       .sr_enter_plus_exit_time_us = 11,
                        .valid = true,
                },
                {
                        .wm_inst = WM_C,
                        .wm_type = WM_TYPE_PSTATE_CHG,
                        .pstate_latency_us = 11.72,
-                       .sr_exit_time_us = 10.12,
-                       .sr_enter_plus_exit_time_us = 11.48,
+                       .sr_exit_time_us = 9,
+                       .sr_enter_plus_exit_time_us = 11,
                        .valid = true,
                },
                {
                        .wm_inst = WM_D,
                        .wm_type = WM_TYPE_PSTATE_CHG,
                        .pstate_latency_us = 11.72,
-                       .sr_exit_time_us = 10.12,
-                       .sr_enter_plus_exit_time_us = 11.48,
+                       .sr_exit_time_us = 9,
+                       .sr_enter_plus_exit_time_us = 11,
                        .valid = true,
                },
        }
@@ -687,7 +687,7 @@ void dcn31_clk_mgr_construct(
                if (ctx->dc_bios->integrated_info->memory_type == LpDdr5MemType) {
                        dcn31_bw_params.wm_table = lpddr5_wm_table;
                } else {
-                       dcn31_bw_params.wm_table = ddr4_wm_table;
+                       dcn31_bw_params.wm_table = ddr5_wm_table;
                }
                /* Saved clocks configured at boot for debug purposes */
                 dcn31_dump_clk_registers(&clk_mgr->base.base.boot_snapshot, &clk_mgr->base.base, &log_info);
index 01c8849..6f5528d 100644 (file)
@@ -1404,20 +1404,34 @@ static void program_timing_sync(
                                status->timing_sync_info.master = false;
 
                }
-               /* remove any other unblanked pipes as they have already been synced */
-               for (j = j + 1; j < group_size; j++) {
-                       bool is_blanked;
 
-                       if (pipe_set[j]->stream_res.opp->funcs->dpg_is_blanked)
-                               is_blanked =
-                                       pipe_set[j]->stream_res.opp->funcs->dpg_is_blanked(pipe_set[j]->stream_res.opp);
-                       else
-                               is_blanked =
-                                       pipe_set[j]->stream_res.tg->funcs->is_blanked(pipe_set[j]->stream_res.tg);
-                       if (!is_blanked) {
-                               group_size--;
-                               pipe_set[j] = pipe_set[group_size];
-                               j--;
+               /* remove any other pipes that are already been synced */
+               if (dc->config.use_pipe_ctx_sync_logic) {
+                       /* check pipe's syncd to decide which pipe to be removed */
+                       for (j = 1; j < group_size; j++) {
+                               if (pipe_set[j]->pipe_idx_syncd == pipe_set[0]->pipe_idx_syncd) {
+                                       group_size--;
+                                       pipe_set[j] = pipe_set[group_size];
+                                       j--;
+                               } else
+                                       /* link slave pipe's syncd with master pipe */
+                                       pipe_set[j]->pipe_idx_syncd = pipe_set[0]->pipe_idx_syncd;
+                       }
+               } else {
+                       for (j = j + 1; j < group_size; j++) {
+                               bool is_blanked;
+
+                               if (pipe_set[j]->stream_res.opp->funcs->dpg_is_blanked)
+                                       is_blanked =
+                                               pipe_set[j]->stream_res.opp->funcs->dpg_is_blanked(pipe_set[j]->stream_res.opp);
+                               else
+                                       is_blanked =
+                                               pipe_set[j]->stream_res.tg->funcs->is_blanked(pipe_set[j]->stream_res.tg);
+                               if (!is_blanked) {
+                                       group_size--;
+                                       pipe_set[j] = pipe_set[group_size];
+                                       j--;
+                               }
                        }
                }
 
index 05e2165..61b8f29 100644 (file)
@@ -202,7 +202,7 @@ void dp_wait_for_training_aux_rd_interval(
        uint32_t wait_in_micro_secs)
 {
 #if defined(CONFIG_DRM_AMD_DC_DCN)
-       if (wait_in_micro_secs > 16000)
+       if (wait_in_micro_secs > 1000)
                msleep(wait_in_micro_secs/1000);
        else
                udelay(wait_in_micro_secs);
@@ -5597,6 +5597,26 @@ static bool retrieve_link_cap(struct dc_link *link)
                dp_hw_fw_revision.ieee_fw_rev,
                sizeof(dp_hw_fw_revision.ieee_fw_rev));
 
+       /* Quirk for Apple MBP 2018 15" Retina panels: wrong DP_MAX_LINK_RATE */
+       {
+               uint8_t str_mbp_2018[] = { 101, 68, 21, 103, 98, 97 };
+               uint8_t fwrev_mbp_2018[] = { 7, 4 };
+               uint8_t fwrev_mbp_2018_vega[] = { 8, 4 };
+
+               /* We also check for the firmware revision as 16,1 models have an
+                * identical device id and are incorrectly quirked otherwise.
+                */
+               if ((link->dpcd_caps.sink_dev_id == 0x0010fa) &&
+                   !memcmp(link->dpcd_caps.sink_dev_id_str, str_mbp_2018,
+                            sizeof(str_mbp_2018)) &&
+                   (!memcmp(link->dpcd_caps.sink_fw_revision, fwrev_mbp_2018,
+                            sizeof(fwrev_mbp_2018)) ||
+                   !memcmp(link->dpcd_caps.sink_fw_revision, fwrev_mbp_2018_vega,
+                            sizeof(fwrev_mbp_2018_vega)))) {
+                       link->reported_link_cap.link_rate = LINK_RATE_RBR2;
+               }
+       }
+
        memset(&link->dpcd_caps.dsc_caps, '\0',
                        sizeof(link->dpcd_caps.dsc_caps));
        memset(&link->dpcd_caps.fec_cap, '\0', sizeof(link->dpcd_caps.fec_cap));
@@ -6935,7 +6955,7 @@ bool dpcd_write_128b_132b_sst_payload_allocation_table(
                        }
                }
                retries++;
-               udelay(5000);
+               msleep(5);
        }
 
        if (!result && retries == max_retries) {
@@ -6987,7 +7007,7 @@ bool dpcd_poll_for_allocation_change_trigger(struct dc_link *link)
                        break;
                }
 
-               udelay(5000);
+               msleep(5);
        }
 
        if (result == ACT_FAILED) {
index d4ff6cc..b3912ff 100644 (file)
@@ -3217,6 +3217,60 @@ struct hpo_dp_link_encoder *resource_get_hpo_dp_link_enc_for_det_lt(
 }
 #endif
 
+void reset_syncd_pipes_from_disabled_pipes(struct dc *dc,
+               struct dc_state *context)
+{
+       int i, j;
+       struct pipe_ctx *pipe_ctx_old, *pipe_ctx, *pipe_ctx_syncd;
+
+       /* If pipe backend is reset, need to reset pipe syncd status */
+       for (i = 0; i < dc->res_pool->pipe_count; i++) {
+               pipe_ctx_old =  &dc->current_state->res_ctx.pipe_ctx[i];
+               pipe_ctx = &context->res_ctx.pipe_ctx[i];
+
+               if (!pipe_ctx_old->stream)
+                       continue;
+
+               if (pipe_ctx_old->top_pipe || pipe_ctx_old->prev_odm_pipe)
+                       continue;
+
+               if (!pipe_ctx->stream ||
+                               pipe_need_reprogram(pipe_ctx_old, pipe_ctx)) {
+
+                       /* Reset all the syncd pipes from the disabled pipe */
+                       for (j = 0; j < dc->res_pool->pipe_count; j++) {
+                               pipe_ctx_syncd = &context->res_ctx.pipe_ctx[j];
+                               if ((GET_PIPE_SYNCD_FROM_PIPE(pipe_ctx_syncd) == pipe_ctx_old->pipe_idx) ||
+                                       !IS_PIPE_SYNCD_VALID(pipe_ctx_syncd))
+                                       SET_PIPE_SYNCD_TO_PIPE(pipe_ctx_syncd, j);
+                       }
+               }
+       }
+}
+
+void check_syncd_pipes_for_disabled_master_pipe(struct dc *dc,
+       struct dc_state *context,
+       uint8_t disabled_master_pipe_idx)
+{
+       int i;
+       struct pipe_ctx *pipe_ctx, *pipe_ctx_check;
+
+       pipe_ctx = &context->res_ctx.pipe_ctx[disabled_master_pipe_idx];
+       if ((GET_PIPE_SYNCD_FROM_PIPE(pipe_ctx) != disabled_master_pipe_idx) ||
+               !IS_PIPE_SYNCD_VALID(pipe_ctx))
+               SET_PIPE_SYNCD_TO_PIPE(pipe_ctx, disabled_master_pipe_idx);
+
+       /* for the pipe disabled, check if any slave pipe exists and assert */
+       for (i = 0; i < dc->res_pool->pipe_count; i++) {
+               pipe_ctx_check = &context->res_ctx.pipe_ctx[i];
+
+               if ((GET_PIPE_SYNCD_FROM_PIPE(pipe_ctx_check) == disabled_master_pipe_idx) &&
+                       IS_PIPE_SYNCD_VALID(pipe_ctx_check) && (i != disabled_master_pipe_idx))
+                       DC_ERR("DC: Failure: pipe_idx[%d] syncd with disabled master pipe_idx[%d]\n",
+                               i, disabled_master_pipe_idx);
+       }
+}
+
 uint8_t resource_transmitter_to_phy_idx(const struct dc *dc, enum transmitter transmitter)
 {
        /* TODO - get transmitter to phy idx mapping from DMUB */
index da2c78c..288e7b0 100644 (file)
@@ -344,6 +344,7 @@ struct dc_config {
        uint8_t  vblank_alignment_max_frame_time_diff;
        bool is_asymmetric_memory;
        bool is_single_rank_dimm;
+       bool use_pipe_ctx_sync_logic;
 };
 
 enum visual_confirm {
index 78192ec..26ec69b 100644 (file)
@@ -1566,6 +1566,10 @@ static enum dc_status apply_single_controller_ctx_to_hw(
                                &pipe_ctx->stream->audio_info);
        }
 
+       /* make sure no pipes syncd to the pipe being enabled */
+       if (!pipe_ctx->stream->apply_seamless_boot_optimization && dc->config.use_pipe_ctx_sync_logic)
+               check_syncd_pipes_for_disabled_master_pipe(dc, context, pipe_ctx->pipe_idx);
+
 #if defined(CONFIG_DRM_AMD_DC_DCN)
        /* DCN3.1 FPGA Workaround
         * Need to enable HPO DP Stream Encoder before setting OTG master enable.
@@ -1604,11 +1608,6 @@ static enum dc_status apply_single_controller_ctx_to_hw(
                        pipe_ctx->stream_res.stream_enc,
                        pipe_ctx->stream_res.tg->inst);
 
-       if (dc_is_dp_signal(pipe_ctx->stream->signal) &&
-               pipe_ctx->stream_res.stream_enc->funcs->reset_fifo)
-               pipe_ctx->stream_res.stream_enc->funcs->reset_fifo(
-                       pipe_ctx->stream_res.stream_enc);
-
        if (dc_is_dp_signal(pipe_ctx->stream->signal))
                dp_source_sequence_trace(link, DPCD_SOURCE_SEQ_AFTER_CONNECT_DIG_FE_OTG);
 
@@ -2297,6 +2296,10 @@ enum dc_status dce110_apply_ctx_to_hw(
        enum dc_status status;
        int i;
 
+       /* reset syncd pipes from disabled pipes */
+       if (dc->config.use_pipe_ctx_sync_logic)
+               reset_syncd_pipes_from_disabled_pipes(dc, context);
+
        /* Reset old context */
        /* look up the targets that have been removed since last commit */
        hws->funcs.reset_hw_ctx_wrap(dc, context);
index bf4436d..b0c08ee 100644 (file)
@@ -902,19 +902,6 @@ void enc1_stream_encoder_stop_dp_info_packets(
 
 }
 
-void enc1_stream_encoder_reset_fifo(
-       struct stream_encoder *enc)
-{
-       struct dcn10_stream_encoder *enc1 = DCN10STRENC_FROM_STRENC(enc);
-
-       /* set DIG_START to 0x1 to reset FIFO */
-       REG_UPDATE(DIG_FE_CNTL, DIG_START, 1);
-       udelay(100);
-
-       /* write 0 to take the FIFO out of reset */
-       REG_UPDATE(DIG_FE_CNTL, DIG_START, 0);
-}
-
 void enc1_stream_encoder_dp_blank(
        struct dc_link *link,
        struct stream_encoder *enc)
@@ -1600,8 +1587,6 @@ static const struct stream_encoder_funcs dcn10_str_enc_funcs = {
                enc1_stream_encoder_send_immediate_sdp_message,
        .stop_dp_info_packets =
                enc1_stream_encoder_stop_dp_info_packets,
-       .reset_fifo =
-               enc1_stream_encoder_reset_fifo,
        .dp_blank =
                enc1_stream_encoder_dp_blank,
        .dp_unblank =
index a146a41..687d7e4 100644 (file)
@@ -626,9 +626,6 @@ void enc1_stream_encoder_send_immediate_sdp_message(
 void enc1_stream_encoder_stop_dp_info_packets(
        struct stream_encoder *enc);
 
-void enc1_stream_encoder_reset_fifo(
-       struct stream_encoder *enc);
-
 void enc1_stream_encoder_dp_blank(
        struct dc_link *link,
        struct stream_encoder *enc);
index 8a70f92..aab25ca 100644 (file)
@@ -593,8 +593,6 @@ static const struct stream_encoder_funcs dcn20_str_enc_funcs = {
                enc1_stream_encoder_send_immediate_sdp_message,
        .stop_dp_info_packets =
                enc1_stream_encoder_stop_dp_info_packets,
-       .reset_fifo =
-               enc1_stream_encoder_reset_fifo,
        .dp_blank =
                enc1_stream_encoder_dp_blank,
        .dp_unblank =
index 8daa127..a04ca4a 100644 (file)
@@ -789,8 +789,6 @@ static const struct stream_encoder_funcs dcn30_str_enc_funcs = {
                enc3_stream_encoder_update_dp_info_packets,
        .stop_dp_info_packets =
                enc1_stream_encoder_stop_dp_info_packets,
-       .reset_fifo =
-               enc1_stream_encoder_reset_fifo,
        .dp_blank =
                enc1_stream_encoder_dp_blank,
        .dp_unblank =
index 602ec9a..8ca2638 100644 (file)
@@ -1878,7 +1878,6 @@ noinline bool dcn30_internal_validate_bw(
        dc->res_pool->funcs->update_soc_for_wm_a(dc, context);
        pipe_cnt = dc->res_pool->funcs->populate_dml_pipes(dc, context, pipes, fast_validate);
 
-       DC_FP_START();
        if (!pipe_cnt) {
                out = true;
                goto validate_out;
@@ -2104,7 +2103,6 @@ validate_fail:
        out = false;
 
 validate_out:
-       DC_FP_END();
        return out;
 }
 
@@ -2306,7 +2304,9 @@ bool dcn30_validate_bandwidth(struct dc *dc,
 
        BW_VAL_TRACE_COUNT();
 
+       DC_FP_START();
        out = dcn30_internal_validate_bw(dc, context, pipes, &pipe_cnt, &vlevel, fast_validate);
+       DC_FP_END();
 
        if (pipe_cnt == 0)
                goto validate_out;
index c1c6e60..5d9637b 100644 (file)
@@ -686,7 +686,7 @@ static const struct dc_debug_options debug_defaults_drv = {
        .disable_clock_gate = true,
        .disable_pplib_clock_request = true,
        .disable_pplib_wm_range = true,
-       .pipe_split_policy = MPC_SPLIT_DYNAMIC,
+       .pipe_split_policy = MPC_SPLIT_AVOID,
        .force_single_disp_pipe_split = false,
        .disable_dcc = DCC_ENABLE,
        .vsr_support = true,
@@ -1380,6 +1380,17 @@ static void set_wm_ranges(
        pp_smu->nv_funcs.set_wm_ranges(&pp_smu->nv_funcs.pp_smu, &ranges);
 }
 
+static void dcn301_calculate_wm_and_dlg(
+               struct dc *dc, struct dc_state *context,
+               display_e2e_pipe_params_st *pipes,
+               int pipe_cnt,
+               int vlevel)
+{
+       DC_FP_START();
+       dcn301_calculate_wm_and_dlg_fp(dc, context, pipes, pipe_cnt, vlevel);
+       DC_FP_END();
+}
+
 static struct resource_funcs dcn301_res_pool_funcs = {
        .destroy = dcn301_destroy_resource_pool,
        .link_enc_create = dcn301_link_encoder_create,
index 42ed47e..8d64187 100644 (file)
@@ -2260,6 +2260,9 @@ static bool dcn31_resource_construct(
        dc->caps.color.mpc.ogam_rom_caps.hlg = 0;
        dc->caps.color.mpc.ocsc = 1;
 
+       /* Use pipe context based otg sync logic */
+       dc->config.use_pipe_ctx_sync_logic = true;
+
        /* read VBIOS LTTPR caps */
        {
                if (ctx->dc_bios->funcs->get_lttpr_caps) {
index 246071c..548cdef 100644 (file)
@@ -1576,8 +1576,6 @@ void dml20_rq_dlg_get_dlg_reg(struct display_mode_lib *mode_lib,
        dlg_sys_param.total_flip_bytes = get_total_immediate_flip_bytes(mode_lib,
                        e2e_pipe_param,
                        num_pipes);
-       dlg_sys_param.t_srx_delay_us = mode_lib->ip.dcfclk_cstate_latency
-                       / dlg_sys_param.deepsleep_dcfclk_mhz; // TODO: Deprecated
 
        print__dlg_sys_params_st(mode_lib, &dlg_sys_param);
 
index 015e7f2..0fc9f3e 100644 (file)
@@ -1577,8 +1577,6 @@ void dml20v2_rq_dlg_get_dlg_reg(struct display_mode_lib *mode_lib,
        dlg_sys_param.total_flip_bytes = get_total_immediate_flip_bytes(mode_lib,
                        e2e_pipe_param,
                        num_pipes);
-       dlg_sys_param.t_srx_delay_us = mode_lib->ip.dcfclk_cstate_latency
-                       / dlg_sys_param.deepsleep_dcfclk_mhz; // TODO: Deprecated
 
        print__dlg_sys_params_st(mode_lib, &dlg_sys_param);
 
index 8bc27de..618f4b6 100644 (file)
@@ -1688,8 +1688,6 @@ void dml21_rq_dlg_get_dlg_reg(
                        mode_lib,
                        e2e_pipe_param,
                        num_pipes);
-       dlg_sys_param.t_srx_delay_us = mode_lib->ip.dcfclk_cstate_latency
-                       / dlg_sys_param.deepsleep_dcfclk_mhz; // TODO: Deprecated
 
        print__dlg_sys_params_st(mode_lib, &dlg_sys_param);
 
index aef8542..7471670 100644 (file)
@@ -1858,8 +1858,6 @@ void dml30_rq_dlg_get_dlg_reg(struct display_mode_lib *mode_lib,
        dlg_sys_param.total_flip_bytes = get_total_immediate_flip_bytes(mode_lib,
                e2e_pipe_param,
                num_pipes);
-       dlg_sys_param.t_srx_delay_us = mode_lib->ip.dcfclk_cstate_latency
-               / dlg_sys_param.deepsleep_dcfclk_mhz; // TODO: Deprecated
 
        print__dlg_sys_params_st(mode_lib, &dlg_sys_param);
 
index 94c3283..0a7a338 100644 (file)
@@ -327,7 +327,7 @@ void dcn301_fpu_init_soc_bounding_box(struct bp_soc_bb_info bb_info)
                dcn3_01_soc.sr_exit_time_us = bb_info.dram_sr_exit_latency_100ns * 10;
 }
 
-void dcn301_calculate_wm_and_dlg(struct dc *dc,
+void dcn301_calculate_wm_and_dlg_fp(struct dc *dc,
                struct dc_state *context,
                display_e2e_pipe_params_st *pipes,
                int pipe_cnt,
index fc7065d..774b0fd 100644 (file)
@@ -34,7 +34,7 @@ void dcn301_fpu_set_wm_ranges(int i,
 
 void dcn301_fpu_init_soc_bounding_box(struct bp_soc_bb_info bb_info);
 
-void dcn301_calculate_wm_and_dlg(struct dc *dc,
+void dcn301_calculate_wm_and_dlg_fp(struct dc *dc,
                struct dc_state *context,
                display_e2e_pipe_params_st *pipes,
                int pipe_cnt,
index d46a273..8f9f1d6 100644 (file)
@@ -546,7 +546,6 @@ struct _vcs_dpi_display_dlg_sys_params_st {
        double t_sr_wm_us;
        double t_extra_us;
        double mem_trip_us;
-       double t_srx_delay_us;
        double deepsleep_dcfclk_mhz;
        double total_flip_bw;
        unsigned int total_flip_bytes;
index 71ea503..412e75e 100644 (file)
@@ -142,9 +142,6 @@ void print__dlg_sys_params_st(struct display_mode_lib *mode_lib, const struct _v
        dml_print("DML_RQ_DLG_CALC:    t_sr_wm_us           = %3.2f\n", dlg_sys_param->t_sr_wm_us);
        dml_print("DML_RQ_DLG_CALC:    t_extra_us           = %3.2f\n", dlg_sys_param->t_extra_us);
        dml_print(
-                       "DML_RQ_DLG_CALC:    t_srx_delay_us       = %3.2f\n",
-                       dlg_sys_param->t_srx_delay_us);
-       dml_print(
                        "DML_RQ_DLG_CALC:    deepsleep_dcfclk_mhz = %3.2f\n",
                        dlg_sys_param->deepsleep_dcfclk_mhz);
        dml_print(
index 59dc2c5..3df559c 100644 (file)
@@ -1331,10 +1331,6 @@ void dml1_rq_dlg_get_dlg_params(
        if (dual_plane)
                DTRACE("DLG: %s: swath_height_c     = %d", __func__, swath_height_c);
 
-       DTRACE(
-                       "DLG: %s: t_srx_delay_us     = %3.2f",
-                       __func__,
-                       (double) dlg_sys_param->t_srx_delay_us);
        DTRACE("DLG: %s: line_time_in_us    = %3.2f", __func__, (double) line_time_in_us);
        DTRACE("DLG: %s: vupdate_offset     = %d", __func__, vupdate_offset);
        DTRACE("DLG: %s: vupdate_width      = %d", __func__, vupdate_width);
index 8902800..943240e 100644 (file)
@@ -382,6 +382,7 @@ struct pipe_ctx {
        struct pll_settings pll_settings;
 
        uint8_t pipe_idx;
+       uint8_t pipe_idx_syncd;
 
        struct pipe_ctx *top_pipe;
        struct pipe_ctx *bottom_pipe;
index 073f8b6..c88e113 100644 (file)
@@ -164,10 +164,6 @@ struct stream_encoder_funcs {
        void (*stop_dp_info_packets)(
                struct stream_encoder *enc);
 
-       void (*reset_fifo)(
-               struct stream_encoder *enc
-       );
-
        void (*dp_blank)(
                struct dc_link *link,
                struct stream_encoder *enc);
index 4249bf3..dbfe669 100644 (file)
 #define MEMORY_TYPE_HBM 2
 
 
+#define IS_PIPE_SYNCD_VALID(pipe) ((((pipe)->pipe_idx_syncd) & 0x80)?1:0)
+#define GET_PIPE_SYNCD_FROM_PIPE(pipe) ((pipe)->pipe_idx_syncd & 0x7F)
+#define SET_PIPE_SYNCD_TO_PIPE(pipe, pipe_syncd) ((pipe)->pipe_idx_syncd = (0x80 | pipe_syncd))
+
 enum dce_version resource_parse_asic_id(
                struct hw_asic_id asic_id);
 
@@ -208,6 +212,13 @@ struct hpo_dp_link_encoder *resource_get_hpo_dp_link_enc_for_det_lt(
                const struct dc_link *link);
 #endif
 
+void reset_syncd_pipes_from_disabled_pipes(struct dc *dc,
+       struct dc_state *context);
+
+void check_syncd_pipes_for_disabled_master_pipe(struct dc *dc,
+       struct dc_state *context,
+       uint8_t disabled_master_pipe_idx);
+
 uint8_t resource_transmitter_to_phy_idx(const struct dc *dc, enum transmitter transmitter);
 
 #endif /* DRIVERS_GPU_DRM_AMD_DC_DEV_DC_INC_RESOURCE_H_ */
index 777f717..a420729 100644 (file)
@@ -3696,14 +3696,14 @@ static ssize_t sienna_cichlid_get_gpu_metrics(struct smu_context *smu,
 
 static int sienna_cichlid_enable_mgpu_fan_boost(struct smu_context *smu)
 {
-       struct smu_table_context *table_context = &smu->smu_table;
-       PPTable_t *smc_pptable = table_context->driver_pptable;
+       uint16_t *mgpu_fan_boost_limit_rpm;
 
+       GET_PPTABLE_MEMBER(MGpuFanBoostLimitRpm, &mgpu_fan_boost_limit_rpm);
        /*
         * Skip the MGpuFanBoost setting for those ASICs
         * which do not support it
         */
-       if (!smc_pptable->MGpuFanBoostLimitRpm)
+       if (*mgpu_fan_boost_limit_rpm == 0)
                return 0;
 
        return smu_cmn_send_smc_msg_with_param(smu,
index d9eb353..dbe1cc6 100644 (file)
@@ -282,8 +282,6 @@ static const struct ast_vbios_enhtable res_1360x768[] = {
 };
 
 static const struct ast_vbios_enhtable res_1600x900[] = {
-       {1800, 1600, 24, 80, 1000,  900, 1, 3, VCLK108,         /* 60Hz */
-        (SyncPP | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo), 60, 3, 0x3A },
        {1760, 1600, 48, 32, 926, 900, 3, 5, VCLK97_75,         /* 60Hz CVT RB */
         (SyncNP | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo |
          AST2500PreCatchCRT), 60, 1, 0x3A },
index 21174ef..88cd992 100644 (file)
@@ -1327,8 +1327,10 @@ int drm_atomic_check_only(struct drm_atomic_state *state)
 
        drm_dbg_atomic(dev, "checking %p\n", state);
 
-       for_each_new_crtc_in_state(state, crtc, new_crtc_state, i)
-               requested_crtc |= drm_crtc_mask(crtc);
+       for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
+               if (new_crtc_state->enable)
+                       requested_crtc |= drm_crtc_mask(crtc);
+       }
 
        for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) {
                ret = drm_atomic_plane_check(old_plane_state, new_plane_state);
@@ -1377,8 +1379,10 @@ int drm_atomic_check_only(struct drm_atomic_state *state)
                }
        }
 
-       for_each_new_crtc_in_state(state, crtc, new_crtc_state, i)
-               affected_crtc |= drm_crtc_mask(crtc);
+       for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
+               if (new_crtc_state->enable)
+                       affected_crtc |= drm_crtc_mask(crtc);
+       }
 
        /*
         * For commits that allow modesets drivers can add other CRTCs to the
index 042bb80..b910978 100644 (file)
@@ -115,6 +115,12 @@ static const struct drm_dmi_panel_orientation_data lcd1280x1920_rightside_up = {
        .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP,
 };
 
+static const struct drm_dmi_panel_orientation_data lcd1600x2560_leftside_up = {
+       .width = 1600,
+       .height = 2560,
+       .orientation = DRM_MODE_PANEL_ORIENTATION_LEFT_UP,
+};
+
 static const struct dmi_system_id orientation_data[] = {
        {       /* Acer One 10 (S1003) */
                .matches = {
@@ -275,6 +281,12 @@ static const struct dmi_system_id orientation_data[] = {
                  DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Default string"),
                },
                .driver_data = (void *)&onegx1_pro,
+       }, {    /* OneXPlayer */
+               .matches = {
+                 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ONE-NETBOOK TECHNOLOGY CO., LTD."),
+                 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "ONE XPLAYER"),
+               },
+               .driver_data = (void *)&lcd1600x2560_leftside_up,
        }, {    /* Samsung GalaxyBook 10.6 */
                .matches = {
                  DMI_EXACT_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
index a2cafb2..e7aa74a 100644 (file)
@@ -33,6 +33,9 @@ static bool __init detect_thinkpad_privacy_screen(void)
        unsigned long long output;
        acpi_status status;
 
+       if (acpi_disabled)
+               return false;
+
        /* Get embedded-controller handle */
        status = acpi_get_devices("PNP0C09", acpi_set_handle, NULL, &ec_handle);
        if (ACPI_FAILURE(status) || !ec_handle)
index b03c20c..a173132 100644 (file)
@@ -469,8 +469,8 @@ int etnaviv_ioctl_gem_submit(struct drm_device *dev, void *data,
                return -EINVAL;
        }
 
-       if (args->stream_size > SZ_64K || args->nr_relocs > SZ_64K ||
-           args->nr_bos > SZ_64K || args->nr_pmrs > 128) {
+       if (args->stream_size > SZ_128K || args->nr_relocs > SZ_128K ||
+           args->nr_bos > SZ_128K || args->nr_pmrs > 128) {
                DRM_ERROR("submit arguments out of size limits\n");
                return -EINVAL;
        }
index 1a376e9..d610e48 100644 (file)
@@ -959,6 +959,9 @@ static int check_overlay_dst(struct intel_overlay *overlay,
        const struct intel_crtc_state *pipe_config =
                overlay->crtc->config;
 
+       if (rec->dst_height == 0 || rec->dst_width == 0)
+               return -EINVAL;
+
        if (rec->dst_x < pipe_config->pipe_src_w &&
            rec->dst_x + rec->dst_width <= pipe_config->pipe_src_w &&
            rec->dst_y < pipe_config->pipe_src_h &&
index 40faa18..dbd7d0d 100644 (file)
@@ -345,10 +345,11 @@ static bool icl_tc_phy_status_complete(struct intel_digital_port *dig_port)
 static bool adl_tc_phy_status_complete(struct intel_digital_port *dig_port)
 {
        struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
+       enum tc_port tc_port = intel_port_to_tc(i915, dig_port->base.port);
        struct intel_uncore *uncore = &i915->uncore;
        u32 val;
 
-       val = intel_uncore_read(uncore, TCSS_DDI_STATUS(dig_port->tc_phy_fia_idx));
+       val = intel_uncore_read(uncore, TCSS_DDI_STATUS(tc_port));
        if (val == 0xffffffff) {
                drm_dbg_kms(&i915->drm,
                            "Port %s: PHY in TCCOLD, assuming not complete\n",
index 3a5b247..1736efa 100644 (file)
@@ -2505,9 +2505,14 @@ static int eb_pin_timeline(struct i915_execbuffer *eb, struct intel_context *ce,
                                      timeout) < 0) {
                        i915_request_put(rq);
 
-                       tl = intel_context_timeline_lock(ce);
+                       /*
+                        * Error path, cannot use intel_context_timeline_lock as
+                        * that is user interruptable and this clean up step
+                        * must be done.
+                        */
+                       mutex_lock(&ce->timeline->mutex);
                        intel_context_exit(ce);
-                       intel_context_timeline_unlock(tl);
+                       mutex_unlock(&ce->timeline->mutex);
 
                        if (nonblock)
                                return -EWOULDBLOCK;
index 4b4829e..0dd107d 100644 (file)
@@ -311,6 +311,7 @@ struct drm_i915_gem_object {
 #define I915_BO_READONLY          BIT(6)
 #define I915_TILING_QUIRK_BIT     7 /* unknown swizzling; do not release! */
 #define I915_BO_PROTECTED         BIT(8)
+#define I915_BO_WAS_BOUND_BIT     9
        /**
         * @mem_flags - Mutable placement-related flags
         *
index 9f429ed..a50f884 100644 (file)
@@ -10,6 +10,8 @@
 #include "i915_gem_lmem.h"
 #include "i915_gem_mman.h"
 
+#include "gt/intel_gt.h"
+
 void __i915_gem_object_set_pages(struct drm_i915_gem_object *obj,
                                 struct sg_table *pages,
                                 unsigned int sg_page_sizes)
@@ -221,6 +223,14 @@ __i915_gem_object_unset_pages(struct drm_i915_gem_object *obj)
        __i915_gem_object_reset_page_iter(obj);
        obj->mm.page_sizes.phys = obj->mm.page_sizes.sg = 0;
 
+       if (test_and_clear_bit(I915_BO_WAS_BOUND_BIT, &obj->flags)) {
+               struct drm_i915_private *i915 = to_i915(obj->base.dev);
+               intel_wakeref_t wakeref;
+
+               with_intel_runtime_pm_if_active(&i915->runtime_pm, wakeref)
+                       intel_gt_invalidate_tlbs(to_gt(i915));
+       }
+
        return pages;
 }
 
index f98f0fb..35d0fcd 100644 (file)
@@ -29,6 +29,8 @@ void __intel_gt_init_early(struct intel_gt *gt, struct drm_i915_private *i915)
 {
        spin_lock_init(&gt->irq_lock);
 
+       mutex_init(&gt->tlb_invalidate_lock);
+
        INIT_LIST_HEAD(&gt->closed_vma);
        spin_lock_init(&gt->closed_lock);
 
@@ -912,3 +914,109 @@ void intel_gt_info_print(const struct intel_gt_info *info,
 
        intel_sseu_dump(&info->sseu, p);
 }
+
+struct reg_and_bit {
+       i915_reg_t reg;
+       u32 bit;
+};
+
+static struct reg_and_bit
+get_reg_and_bit(const struct intel_engine_cs *engine, const bool gen8,
+               const i915_reg_t *regs, const unsigned int num)
+{
+       const unsigned int class = engine->class;
+       struct reg_and_bit rb = { };
+
+       if (drm_WARN_ON_ONCE(&engine->i915->drm,
+                            class >= num || !regs[class].reg))
+               return rb;
+
+       rb.reg = regs[class];
+       if (gen8 && class == VIDEO_DECODE_CLASS)
+               rb.reg.reg += 4 * engine->instance; /* GEN8_M2TCR */
+       else
+               rb.bit = engine->instance;
+
+       rb.bit = BIT(rb.bit);
+
+       return rb;
+}
+
+void intel_gt_invalidate_tlbs(struct intel_gt *gt)
+{
+       static const i915_reg_t gen8_regs[] = {
+               [RENDER_CLASS]                  = GEN8_RTCR,
+               [VIDEO_DECODE_CLASS]            = GEN8_M1TCR, /* , GEN8_M2TCR */
+               [VIDEO_ENHANCEMENT_CLASS]       = GEN8_VTCR,
+               [COPY_ENGINE_CLASS]             = GEN8_BTCR,
+       };
+       static const i915_reg_t gen12_regs[] = {
+               [RENDER_CLASS]                  = GEN12_GFX_TLB_INV_CR,
+               [VIDEO_DECODE_CLASS]            = GEN12_VD_TLB_INV_CR,
+               [VIDEO_ENHANCEMENT_CLASS]       = GEN12_VE_TLB_INV_CR,
+               [COPY_ENGINE_CLASS]             = GEN12_BLT_TLB_INV_CR,
+       };
+       struct drm_i915_private *i915 = gt->i915;
+       struct intel_uncore *uncore = gt->uncore;
+       struct intel_engine_cs *engine;
+       enum intel_engine_id id;
+       const i915_reg_t *regs;
+       unsigned int num = 0;
+
+       if (I915_SELFTEST_ONLY(gt->awake == -ENODEV))
+               return;
+
+       if (GRAPHICS_VER(i915) == 12) {
+               regs = gen12_regs;
+               num = ARRAY_SIZE(gen12_regs);
+       } else if (GRAPHICS_VER(i915) >= 8 && GRAPHICS_VER(i915) <= 11) {
+               regs = gen8_regs;
+               num = ARRAY_SIZE(gen8_regs);
+       } else if (GRAPHICS_VER(i915) < 8) {
+               return;
+       }
+
+       if (drm_WARN_ONCE(&i915->drm, !num,
+                         "Platform does not implement TLB invalidation!"))
+               return;
+
+       GEM_TRACE("\n");
+
+       assert_rpm_wakelock_held(&i915->runtime_pm);
+
+       mutex_lock(&gt->tlb_invalidate_lock);
+       intel_uncore_forcewake_get(uncore, FORCEWAKE_ALL);
+
+       for_each_engine(engine, gt, id) {
+               /*
+                * HW architecture suggest typical invalidation time at 40us,
+                * with pessimistic cases up to 100us and a recommendation to
+                * cap at 1ms. We go a bit higher just in case.
+                */
+               const unsigned int timeout_us = 100;
+               const unsigned int timeout_ms = 4;
+               struct reg_and_bit rb;
+
+               rb = get_reg_and_bit(engine, regs == gen8_regs, regs, num);
+               if (!i915_mmio_reg_offset(rb.reg))
+                       continue;
+
+               intel_uncore_write_fw(uncore, rb.reg, rb.bit);
+               if (__intel_wait_for_register_fw(uncore,
+                                                rb.reg, rb.bit, 0,
+                                                timeout_us, timeout_ms,
+                                                NULL))
+                       drm_err_ratelimited(&gt->i915->drm,
+                                           "%s TLB invalidation did not complete in %ums!\n",
+                                           engine->name, timeout_ms);
+       }
+
+       /*
+        * Use delayed put since a) we mostly expect a flurry of TLB
+        * invalidations so it is good to avoid paying the forcewake cost and
+        * b) it works around a bug in Icelake which cannot cope with too rapid
+        * transitions.
+        */
+       intel_uncore_forcewake_put_delayed(uncore, FORCEWAKE_ALL);
+       mutex_unlock(&gt->tlb_invalidate_lock);
+}
index 3ace129..a913fb6 100644 (file)
@@ -91,4 +91,6 @@ void intel_gt_info_print(const struct intel_gt_info *info,
 
 void intel_gt_watchdog_work(struct work_struct *work);
 
+void intel_gt_invalidate_tlbs(struct intel_gt *gt);
+
 #endif /* __INTEL_GT_H__ */
index 14216cc..f206877 100644 (file)
@@ -73,6 +73,8 @@ struct intel_gt {
 
        struct intel_uc uc;
 
+       struct mutex tlb_invalidate_lock;
+
        struct i915_wa_list wa_list;
 
        struct intel_gt_timelines {
index f9240d4..3aabe16 100644 (file)
@@ -206,6 +206,11 @@ struct intel_guc {
                 * context usage for overflows.
                 */
                struct delayed_work work;
+
+               /**
+                * @shift: Right shift value for the gpm timestamp
+                */
+               u32 shift;
        } timestamp;
 
 #ifdef CONFIG_DRM_I915_SELFTEST
index e751720..154ad72 100644 (file)
@@ -1113,6 +1113,19 @@ __extend_last_switch(struct intel_guc *guc, u64 *prev_start, u32 new_start)
        if (new_start == lower_32_bits(*prev_start))
                return;
 
+       /*
+        * When gt is unparked, we update the gt timestamp and start the ping
+        * worker that updates the gt_stamp every POLL_TIME_CLKS. As long as gt
+        * is unparked, all switched in contexts will have a start time that is
+        * within +/- POLL_TIME_CLKS of the most recent gt_stamp.
+        *
+        * If neither gt_stamp nor new_start has rolled over, then the
+        * gt_stamp_hi does not need to be adjusted, however if one of them has
+        * rolled over, we need to adjust gt_stamp_hi accordingly.
+        *
+        * The below conditions address the cases of new_start rollover and
+        * gt_stamp_last rollover respectively.
+        */
        if (new_start < gt_stamp_last &&
            (new_start - gt_stamp_last) <= POLL_TIME_CLKS)
                gt_stamp_hi++;
@@ -1124,17 +1137,45 @@ __extend_last_switch(struct intel_guc *guc, u64 *prev_start, u32 new_start)
        *prev_start = ((u64)gt_stamp_hi << 32) | new_start;
 }
 
-static void guc_update_engine_gt_clks(struct intel_engine_cs *engine)
+/*
+ * GuC updates shared memory and KMD reads it. Since this is not synchronized,
+ * we run into a race where the value read is inconsistent. Sometimes the
+ * inconsistency is in reading the upper MSB bytes of the last_in value when
+ * this race occurs. 2 types of cases are seen - upper 8 bits are zero and upper
+ * 24 bits are zero. Since these are non-zero values, it is non-trivial to
+ * determine validity of these values. Instead we read the values multiple times
+ * until they are consistent. In test runs, 3 attempts results in consistent
+ * values. The upper bound is set to 6 attempts and may need to be tuned as per
+ * any new occurences.
+ */
+static void __get_engine_usage_record(struct intel_engine_cs *engine,
+                                     u32 *last_in, u32 *id, u32 *total)
 {
        struct guc_engine_usage_record *rec = intel_guc_engine_usage(engine);
+       int i = 0;
+
+       do {
+               *last_in = READ_ONCE(rec->last_switch_in_stamp);
+               *id = READ_ONCE(rec->current_context_index);
+               *total = READ_ONCE(rec->total_runtime);
+
+               if (READ_ONCE(rec->last_switch_in_stamp) == *last_in &&
+                   READ_ONCE(rec->current_context_index) == *id &&
+                   READ_ONCE(rec->total_runtime) == *total)
+                       break;
+       } while (++i < 6);
+}
+
+static void guc_update_engine_gt_clks(struct intel_engine_cs *engine)
+{
        struct intel_engine_guc_stats *stats = &engine->stats.guc;
        struct intel_guc *guc = &engine->gt->uc.guc;
-       u32 last_switch = rec->last_switch_in_stamp;
-       u32 ctx_id = rec->current_context_index;
-       u32 total = rec->total_runtime;
+       u32 last_switch, ctx_id, total;
 
        lockdep_assert_held(&guc->timestamp.lock);
 
+       __get_engine_usage_record(engine, &last_switch, &ctx_id, &total);
+
        stats->running = ctx_id != ~0U && last_switch;
        if (stats->running)
                __extend_last_switch(guc, &stats->start_gt_clk, last_switch);
@@ -1149,23 +1190,51 @@ static void guc_update_engine_gt_clks(struct intel_engine_cs *engine)
        }
 }
 
-static void guc_update_pm_timestamp(struct intel_guc *guc,
-                                   struct intel_engine_cs *engine,
-                                   ktime_t *now)
+static u32 gpm_timestamp_shift(struct intel_gt *gt)
+{
+       intel_wakeref_t wakeref;
+       u32 reg, shift;
+
+       with_intel_runtime_pm(gt->uncore->rpm, wakeref)
+               reg = intel_uncore_read(gt->uncore, RPM_CONFIG0);
+
+       shift = (reg & GEN10_RPM_CONFIG0_CTC_SHIFT_PARAMETER_MASK) >>
+               GEN10_RPM_CONFIG0_CTC_SHIFT_PARAMETER_SHIFT;
+
+       return 3 - shift;
+}
+
+static u64 gpm_timestamp(struct intel_gt *gt)
+{
+       u32 lo, hi, old_hi, loop = 0;
+
+       hi = intel_uncore_read(gt->uncore, MISC_STATUS1);
+       do {
+               lo = intel_uncore_read(gt->uncore, MISC_STATUS0);
+               old_hi = hi;
+               hi = intel_uncore_read(gt->uncore, MISC_STATUS1);
+       } while (old_hi != hi && loop++ < 2);
+
+       return ((u64)hi << 32) | lo;
+}
+
+static void guc_update_pm_timestamp(struct intel_guc *guc, ktime_t *now)
 {
-       u32 gt_stamp_now, gt_stamp_hi;
+       struct intel_gt *gt = guc_to_gt(guc);
+       u32 gt_stamp_lo, gt_stamp_hi;
+       u64 gpm_ts;
 
        lockdep_assert_held(&guc->timestamp.lock);
 
        gt_stamp_hi = upper_32_bits(guc->timestamp.gt_stamp);
-       gt_stamp_now = intel_uncore_read(engine->uncore,
-                                        RING_TIMESTAMP(engine->mmio_base));
+       gpm_ts = gpm_timestamp(gt) >> guc->timestamp.shift;
+       gt_stamp_lo = lower_32_bits(gpm_ts);
        *now = ktime_get();
 
-       if (gt_stamp_now < lower_32_bits(guc->timestamp.gt_stamp))
+       if (gt_stamp_lo < lower_32_bits(guc->timestamp.gt_stamp))
                gt_stamp_hi++;
 
-       guc->timestamp.gt_stamp = ((u64)gt_stamp_hi << 32) | gt_stamp_now;
+       guc->timestamp.gt_stamp = ((u64)gt_stamp_hi << 32) | gt_stamp_lo;
 }
 
 /*
@@ -1208,8 +1277,12 @@ static ktime_t guc_engine_busyness(struct intel_engine_cs *engine, ktime_t *now)
        if (!in_reset && intel_gt_pm_get_if_awake(gt)) {
                stats_saved = *stats;
                gt_stamp_saved = guc->timestamp.gt_stamp;
+               /*
+                * Update gt_clks, then gt timestamp to simplify the 'gt_stamp -
+                * start_gt_clk' calculation below for active engines.
+                */
                guc_update_engine_gt_clks(engine);
-               guc_update_pm_timestamp(guc, engine, now);
+               guc_update_pm_timestamp(guc, now);
                intel_gt_pm_put_async(gt);
                if (i915_reset_count(gpu_error) != reset_count) {
                        *stats = stats_saved;
@@ -1241,8 +1314,8 @@ static void __reset_guc_busyness_stats(struct intel_guc *guc)
 
        spin_lock_irqsave(&guc->timestamp.lock, flags);
 
+       guc_update_pm_timestamp(guc, &unused);
        for_each_engine(engine, gt, id) {
-               guc_update_pm_timestamp(guc, engine, &unused);
                guc_update_engine_gt_clks(engine);
                engine->stats.guc.prev_total = 0;
        }
@@ -1259,10 +1332,11 @@ static void __update_guc_busyness_stats(struct intel_guc *guc)
        ktime_t unused;
 
        spin_lock_irqsave(&guc->timestamp.lock, flags);
-       for_each_engine(engine, gt, id) {
-               guc_update_pm_timestamp(guc, engine, &unused);
+
+       guc_update_pm_timestamp(guc, &unused);
+       for_each_engine(engine, gt, id)
                guc_update_engine_gt_clks(engine);
-       }
+
        spin_unlock_irqrestore(&guc->timestamp.lock, flags);
 }
 
@@ -1335,10 +1409,15 @@ void intel_guc_busyness_park(struct intel_gt *gt)
 void intel_guc_busyness_unpark(struct intel_gt *gt)
 {
        struct intel_guc *guc = &gt->uc.guc;
+       unsigned long flags;
+       ktime_t unused;
 
        if (!guc_submission_initialized(guc))
                return;
 
+       spin_lock_irqsave(&guc->timestamp.lock, flags);
+       guc_update_pm_timestamp(guc, &unused);
+       spin_unlock_irqrestore(&guc->timestamp.lock, flags);
        mod_delayed_work(system_highpri_wq, &guc->timestamp.work,
                         guc->timestamp.ping_delay);
 }
@@ -1783,6 +1862,7 @@ int intel_guc_submission_init(struct intel_guc *guc)
        spin_lock_init(&guc->timestamp.lock);
        INIT_DELAYED_WORK(&guc->timestamp.work, guc_timestamp_ping);
        guc->timestamp.ping_delay = (POLL_TIME_CLKS / gt->clock_frequency + 1) * HZ;
+       guc->timestamp.shift = gpm_timestamp_shift(gt);
 
        return 0;
 }
index 5ae812d..0633888 100644 (file)
@@ -1522,7 +1522,7 @@ capture_engine(struct intel_engine_cs *engine,
        struct i915_request *rq = NULL;
        unsigned long flags;
 
-       ee = intel_engine_coredump_alloc(engine, GFP_KERNEL);
+       ee = intel_engine_coredump_alloc(engine, ALLOW_FAIL);
        if (!ee)
                return NULL;
 
index 971d601..c2bb33f 100644 (file)
@@ -2684,7 +2684,8 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
 #define   RING_WAIT            (1 << 11) /* gen3+, PRBx_CTL */
 #define   RING_WAIT_SEMAPHORE  (1 << 10) /* gen6+ */
 
-#define GUCPMTIMESTAMP          _MMIO(0xC3E8)
+#define MISC_STATUS0           _MMIO(0xA500)
+#define MISC_STATUS1           _MMIO(0xA504)
 
 /* There are 16 64-bit CS General Purpose Registers per-engine on Gen8+ */
 #define GEN8_RING_CS_GPR(base, n)      _MMIO((base) + 0x600 + (n) * 8)
@@ -2721,6 +2722,12 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
 #define   GAMT_CHKN_DISABLE_DYNAMIC_CREDIT_SHARING     (1 << 28)
 #define   GAMT_CHKN_DISABLE_I2M_CYCLE_ON_WR_PORT       (1 << 24)
 
+#define GEN8_RTCR      _MMIO(0x4260)
+#define GEN8_M1TCR     _MMIO(0x4264)
+#define GEN8_M2TCR     _MMIO(0x4268)
+#define GEN8_BTCR      _MMIO(0x426c)
+#define GEN8_VTCR      _MMIO(0x4270)
+
 #if 0
 #define PRB0_TAIL      _MMIO(0x2030)
 #define PRB0_HEAD      _MMIO(0x2034)
@@ -2819,6 +2826,11 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
 #define   FAULT_VA_HIGH_BITS           (0xf << 0)
 #define   FAULT_GTT_SEL                        (1 << 4)
 
+#define GEN12_GFX_TLB_INV_CR   _MMIO(0xced8)
+#define GEN12_VD_TLB_INV_CR    _MMIO(0xcedc)
+#define GEN12_VE_TLB_INV_CR    _MMIO(0xcee0)
+#define GEN12_BLT_TLB_INV_CR   _MMIO(0xcee4)
+
 #define GEN12_AUX_ERR_DBG              _MMIO(0x43f4)
 
 #define FPGA_DBG               _MMIO(0x42300)
index 29a858c..c0d6d55 100644 (file)
@@ -457,6 +457,9 @@ int i915_vma_bind(struct i915_vma *vma,
                vma->ops->bind_vma(vma->vm, NULL, vma, cache_level, bind_flags);
        }
 
+       if (vma->obj)
+               set_bit(I915_BO_WAS_BOUND_BIT, &vma->obj->flags);
+
        atomic_or(bind_flags, &vma->flags);
        return 0;
 }
index fc25ebf..778da31 100644 (file)
@@ -724,7 +724,8 @@ void intel_uncore_forcewake_get__locked(struct intel_uncore *uncore,
 }
 
 static void __intel_uncore_forcewake_put(struct intel_uncore *uncore,
-                                        enum forcewake_domains fw_domains)
+                                        enum forcewake_domains fw_domains,
+                                        bool delayed)
 {
        struct intel_uncore_forcewake_domain *domain;
        unsigned int tmp;
@@ -739,7 +740,11 @@ static void __intel_uncore_forcewake_put(struct intel_uncore *uncore,
                        continue;
                }
 
-               fw_domains_put(uncore, domain->mask);
+               if (delayed &&
+                   !(domain->uncore->fw_domains_timer & domain->mask))
+                       fw_domain_arm_timer(domain);
+               else
+                       fw_domains_put(uncore, domain->mask);
        }
 }
 
@@ -760,7 +765,20 @@ void intel_uncore_forcewake_put(struct intel_uncore *uncore,
                return;
 
        spin_lock_irqsave(&uncore->lock, irqflags);
-       __intel_uncore_forcewake_put(uncore, fw_domains);
+       __intel_uncore_forcewake_put(uncore, fw_domains, false);
+       spin_unlock_irqrestore(&uncore->lock, irqflags);
+}
+
+void intel_uncore_forcewake_put_delayed(struct intel_uncore *uncore,
+                                       enum forcewake_domains fw_domains)
+{
+       unsigned long irqflags;
+
+       if (!uncore->fw_get_funcs)
+               return;
+
+       spin_lock_irqsave(&uncore->lock, irqflags);
+       __intel_uncore_forcewake_put(uncore, fw_domains, true);
        spin_unlock_irqrestore(&uncore->lock, irqflags);
 }
 
@@ -802,7 +820,7 @@ void intel_uncore_forcewake_put__locked(struct intel_uncore *uncore,
        if (!uncore->fw_get_funcs)
                return;
 
-       __intel_uncore_forcewake_put(uncore, fw_domains);
+       __intel_uncore_forcewake_put(uncore, fw_domains, false);
 }
 
 void assert_forcewakes_inactive(struct intel_uncore *uncore)
index 210fe2a..2a15b2b 100644 (file)
@@ -246,6 +246,8 @@ void intel_uncore_forcewake_get(struct intel_uncore *uncore,
                                enum forcewake_domains domains);
 void intel_uncore_forcewake_put(struct intel_uncore *uncore,
                                enum forcewake_domains domains);
+void intel_uncore_forcewake_put_delayed(struct intel_uncore *uncore,
+                                       enum forcewake_domains domains);
 void intel_uncore_forcewake_flush(struct intel_uncore *uncore,
                                  enum forcewake_domains fw_domains);
 
index 00404ba..2735b8e 100644 (file)
@@ -158,12 +158,6 @@ static void kmb_plane_atomic_disable(struct drm_plane *plane,
        case LAYER_1:
                kmb->plane_status[plane_id].ctrl = LCD_CTRL_VL2_ENABLE;
                break;
-       case LAYER_2:
-               kmb->plane_status[plane_id].ctrl = LCD_CTRL_GL1_ENABLE;
-               break;
-       case LAYER_3:
-               kmb->plane_status[plane_id].ctrl = LCD_CTRL_GL2_ENABLE;
-               break;
        }
 
        kmb->plane_status[plane_id].disable = true;
index 51b8377..17cfad6 100644 (file)
@@ -1560,6 +1560,8 @@ static int a6xx_pm_suspend(struct msm_gpu *gpu)
                for (i = 0; i < gpu->nr_rings; i++)
                        a6xx_gpu->shadow[i] = 0;
 
+       gpu->suspend_count++;
+
        return 0;
 }
 
index 9300583..fb26193 100644 (file)
@@ -608,9 +608,27 @@ static int adreno_resume(struct device *dev)
        return gpu->funcs->pm_resume(gpu);
 }
 
+static int active_submits(struct msm_gpu *gpu)
+{
+       int active_submits;
+       mutex_lock(&gpu->active_lock);
+       active_submits = gpu->active_submits;
+       mutex_unlock(&gpu->active_lock);
+       return active_submits;
+}
+
 static int adreno_suspend(struct device *dev)
 {
        struct msm_gpu *gpu = dev_to_gpu(dev);
+       int remaining;
+
+       remaining = wait_event_timeout(gpu->retire_event,
+                                      active_submits(gpu) == 0,
+                                      msecs_to_jiffies(1000));
+       if (remaining == 0) {
+               dev_err(dev, "Timeout waiting for GPU to suspend\n");
+               return -EBUSY;
+       }
 
        return gpu->funcs->pm_suspend(gpu);
 }
index a98e964..355894a 100644 (file)
@@ -26,9 +26,16 @@ static void dpu_setup_dspp_pcc(struct dpu_hw_dspp *ctx,
                struct dpu_hw_pcc_cfg *cfg)
 {
 
-       u32 base = ctx->cap->sblk->pcc.base;
+       u32 base;
 
-       if (!ctx || !base) {
+       if (!ctx) {
+               DRM_ERROR("invalid ctx %pK\n", ctx);
+               return;
+       }
+
+       base = ctx->cap->sblk->pcc.base;
+
+       if (!base) {
                DRM_ERROR("invalid ctx %pK pcc base 0x%x\n", ctx, base);
                return;
        }
index 0525488..0fe0252 100644 (file)
@@ -40,7 +40,12 @@ static int dsi_get_phy(struct msm_dsi *msm_dsi)
 
        of_node_put(phy_node);
 
-       if (!phy_pdev || !msm_dsi->phy) {
+       if (!phy_pdev) {
+               DRM_DEV_ERROR(&pdev->dev, "%s: phy driver is not ready\n", __func__);
+               return -EPROBE_DEFER;
+       }
+       if (!msm_dsi->phy) {
+               put_device(&phy_pdev->dev);
                DRM_DEV_ERROR(&pdev->dev, "%s: phy driver is not ready\n", __func__);
                return -EPROBE_DEFER;
        }
index c2ed177..2027b38 100644 (file)
@@ -808,12 +808,14 @@ int msm_dsi_phy_enable(struct msm_dsi_phy *phy,
                        struct msm_dsi_phy_clk_request *clk_req,
                        struct msm_dsi_phy_shared_timings *shared_timings)
 {
-       struct device *dev = &phy->pdev->dev;
+       struct device *dev;
        int ret;
 
        if (!phy || !phy->cfg->ops.enable)
                return -EINVAL;
 
+       dev = &phy->pdev->dev;
+
        ret = dsi_phy_enable_resource(phy);
        if (ret) {
                DRM_DEV_ERROR(dev, "%s: resource enable failed, %d\n",
index 3acdeae..7197207 100644 (file)
@@ -97,10 +97,15 @@ static int msm_hdmi_get_phy(struct hdmi *hdmi)
 
        of_node_put(phy_node);
 
-       if (!phy_pdev || !hdmi->phy) {
+       if (!phy_pdev) {
                DRM_DEV_ERROR(&pdev->dev, "phy driver is not ready\n");
                return -EPROBE_DEFER;
        }
+       if (!hdmi->phy) {
+               DRM_DEV_ERROR(&pdev->dev, "phy driver is not ready\n");
+               put_device(&phy_pdev->dev);
+               return -EPROBE_DEFER;
+       }
 
        hdmi->phy_dev = get_device(&phy_pdev->dev);
 
index ad35a5d..555666e 100644 (file)
@@ -461,7 +461,7 @@ static int msm_init_vram(struct drm_device *dev)
                of_node_put(node);
                if (ret)
                        return ret;
-               size = r.end - r.start;
+               size = r.end - r.start + 1;
                DRM_INFO("using VRAM carveout: %lx@%pa\n", size, &r.start);
 
                /* if we have no IOMMU, then we need to use carveout allocator.
@@ -510,7 +510,6 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv)
        struct msm_drm_private *priv = dev_get_drvdata(dev);
        struct drm_device *ddev;
        struct msm_kms *kms;
-       struct msm_mdss *mdss;
        int ret, i;
 
        ddev = drm_dev_alloc(drv, dev);
@@ -521,8 +520,6 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv)
        ddev->dev_private = priv;
        priv->dev = ddev;
 
-       mdss = priv->mdss;
-
        priv->wq = alloc_ordered_workqueue("msm", 0);
        priv->hangcheck_period = DRM_MSM_HANGCHECK_DEFAULT_PERIOD;
 
index 0f78c26..2c1049c 100644 (file)
@@ -703,6 +703,8 @@ static void retire_submits(struct msm_gpu *gpu)
                        }
                }
        }
+
+       wake_up_all(&gpu->retire_event);
 }
 
 static void retire_worker(struct kthread_work *work)
@@ -848,6 +850,7 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
        INIT_LIST_HEAD(&gpu->active_list);
        mutex_init(&gpu->active_lock);
        mutex_init(&gpu->lock);
+       init_waitqueue_head(&gpu->retire_event);
        kthread_init_work(&gpu->retire_work, retire_worker);
        kthread_init_work(&gpu->recover_work, recover_worker);
        kthread_init_work(&gpu->fault_work, fault_worker);
index 445c6bf..92aa1e9 100644 (file)
@@ -230,6 +230,9 @@ struct msm_gpu {
        /* work for handling GPU recovery: */
        struct kthread_work recover_work;
 
+       /** retire_event: notified when submits are retired: */
+       wait_queue_head_t retire_event;
+
        /* work for handling active-list retiring: */
        struct kthread_work retire_work;
 
index 62405e9..9bf319b 100644 (file)
@@ -133,6 +133,18 @@ void msm_devfreq_init(struct msm_gpu *gpu)
                              CLOCK_MONOTONIC, HRTIMER_MODE_REL);
 }
 
+static void cancel_idle_work(struct msm_gpu_devfreq *df)
+{
+       hrtimer_cancel(&df->idle_work.timer);
+       kthread_cancel_work_sync(&df->idle_work.work);
+}
+
+static void cancel_boost_work(struct msm_gpu_devfreq *df)
+{
+       hrtimer_cancel(&df->boost_work.timer);
+       kthread_cancel_work_sync(&df->boost_work.work);
+}
+
 void msm_devfreq_cleanup(struct msm_gpu *gpu)
 {
        struct msm_gpu_devfreq *df = &gpu->devfreq;
@@ -152,7 +164,12 @@ void msm_devfreq_resume(struct msm_gpu *gpu)
 
 void msm_devfreq_suspend(struct msm_gpu *gpu)
 {
-       devfreq_suspend_device(gpu->devfreq.devfreq);
+       struct msm_gpu_devfreq *df = &gpu->devfreq;
+
+       devfreq_suspend_device(df->devfreq);
+
+       cancel_idle_work(df);
+       cancel_boost_work(df);
 }
 
 static void msm_devfreq_boost_work(struct kthread_work *work)
@@ -196,7 +213,7 @@ void msm_devfreq_active(struct msm_gpu *gpu)
        /*
         * Cancel any pending transition to idle frequency:
         */
-       hrtimer_cancel(&df->idle_work.timer);
+       cancel_idle_work(df);
 
        idle_time = ktime_to_ms(ktime_sub(ktime_get(), df->idle_time));
 
index 0655582..4cfb6c0 100644 (file)
@@ -361,7 +361,11 @@ static void mxsfb_crtc_atomic_enable(struct drm_crtc *crtc,
                bridge_state =
                        drm_atomic_get_new_bridge_state(state,
                                                        mxsfb->bridge);
-               bus_format = bridge_state->input_bus_cfg.format;
+               if (!bridge_state)
+                       bus_format = MEDIA_BUS_FMT_FIXED;
+               else
+                       bus_format = bridge_state->input_bus_cfg.format;
+
                if (bus_format == MEDIA_BUS_FMT_FIXED) {
                        dev_warn_once(drm->dev,
                                      "Bridge does not provide bus format, assuming MEDIA_BUS_FMT_RGB888_1X24.\n"
index d0f52d5..64e423d 100644 (file)
@@ -38,7 +38,7 @@ nvbios_addr(struct nvkm_bios *bios, u32 *addr, u8 size)
                *addr += bios->imaged_addr;
        }
 
-       if (unlikely(*addr + size >= bios->size)) {
+       if (unlikely(*addr + size > bios->size)) {
                nvkm_error(&bios->subdev, "OOB %d %08x %08x\n", size, p, *addr);
                return false;
        }
index a229da5..9300d33 100644 (file)
@@ -1262,7 +1262,6 @@ static int vc4_dsi_host_attach(struct mipi_dsi_host *host,
                               struct mipi_dsi_device *device)
 {
        struct vc4_dsi *dsi = host_to_dsi(host);
-       int ret;
 
        dsi->lanes = device->lanes;
        dsi->channel = device->channel;
@@ -1297,18 +1296,15 @@ static int vc4_dsi_host_attach(struct mipi_dsi_host *host,
                return 0;
        }
 
-       ret = component_add(&dsi->pdev->dev, &vc4_dsi_ops);
-       if (ret) {
-               mipi_dsi_host_unregister(&dsi->dsi_host);
-               return ret;
-       }
-
-       return 0;
+       return component_add(&dsi->pdev->dev, &vc4_dsi_ops);
 }
 
 static int vc4_dsi_host_detach(struct mipi_dsi_host *host,
                               struct mipi_dsi_device *device)
 {
+       struct vc4_dsi *dsi = host_to_dsi(host);
+
+       component_del(&dsi->pdev->dev, &vc4_dsi_ops);
        return 0;
 }
 
@@ -1686,9 +1682,7 @@ static int vc4_dsi_dev_remove(struct platform_device *pdev)
        struct device *dev = &pdev->dev;
        struct vc4_dsi *dsi = dev_get_drvdata(dev);
 
-       component_del(&pdev->dev, &vc4_dsi_ops);
        mipi_dsi_host_unregister(&dsi->dsi_host);
-
        return 0;
 }
 
index d6b6663..ea3ecdd 100644 (file)
@@ -1140,15 +1140,14 @@ extern int vmw_execbuf_fence_commands(struct drm_file *file_priv,
                                      struct vmw_private *dev_priv,
                                      struct vmw_fence_obj **p_fence,
                                      uint32_t *p_handle);
-extern void vmw_execbuf_copy_fence_user(struct vmw_private *dev_priv,
+extern int vmw_execbuf_copy_fence_user(struct vmw_private *dev_priv,
                                        struct vmw_fpriv *vmw_fp,
                                        int ret,
                                        struct drm_vmw_fence_rep __user
                                        *user_fence_rep,
                                        struct vmw_fence_obj *fence,
                                        uint32_t fence_handle,
-                                       int32_t out_fence_fd,
-                                       struct sync_file *sync_file);
+                                       int32_t out_fence_fd);
 bool vmw_cmd_describe(const void *buf, u32 *size, char const **cmd);
 
 /**
index 44ca23b..dd2ff44 100644 (file)
@@ -3879,17 +3879,17 @@ int vmw_execbuf_fence_commands(struct drm_file *file_priv,
  * Also if copying fails, user-space will be unable to signal the fence object
  * so we wait for it immediately, and then unreference the user-space reference.
  */
-void
+int
 vmw_execbuf_copy_fence_user(struct vmw_private *dev_priv,
                            struct vmw_fpriv *vmw_fp, int ret,
                            struct drm_vmw_fence_rep __user *user_fence_rep,
                            struct vmw_fence_obj *fence, uint32_t fence_handle,
-                           int32_t out_fence_fd, struct sync_file *sync_file)
+                           int32_t out_fence_fd)
 {
        struct drm_vmw_fence_rep fence_rep;
 
        if (user_fence_rep == NULL)
-               return;
+               return 0;
 
        memset(&fence_rep, 0, sizeof(fence_rep));
 
@@ -3917,19 +3917,13 @@ vmw_execbuf_copy_fence_user(struct vmw_private *dev_priv,
         * handle.
         */
        if (unlikely(ret != 0) && (fence_rep.error == 0)) {
-               if (sync_file)
-                       fput(sync_file->file);
-
-               if (fence_rep.fd != -1) {
-                       put_unused_fd(fence_rep.fd);
-                       fence_rep.fd = -1;
-               }
-
                ttm_ref_object_base_unref(vmw_fp->tfile, fence_handle);
                VMW_DEBUG_USER("Fence copy error. Syncing.\n");
                (void) vmw_fence_obj_wait(fence, false, false,
                                          VMW_FENCE_WAIT_TIMEOUT);
        }
+
+       return ret ? -EFAULT : 0;
 }
 
 /**
@@ -4266,16 +4260,23 @@ int vmw_execbuf_process(struct drm_file *file_priv,
 
                        (void) vmw_fence_obj_wait(fence, false, false,
                                                  VMW_FENCE_WAIT_TIMEOUT);
+               }
+       }
+
+       ret = vmw_execbuf_copy_fence_user(dev_priv, vmw_fpriv(file_priv), ret,
+                                   user_fence_rep, fence, handle, out_fence_fd);
+
+       if (sync_file) {
+               if (ret) {
+                       /* usercopy of fence failed, put the file object */
+                       fput(sync_file->file);
+                       put_unused_fd(out_fence_fd);
                } else {
                        /* Link the fence with the FD created earlier */
                        fd_install(out_fence_fd, sync_file->file);
                }
        }
 
-       vmw_execbuf_copy_fence_user(dev_priv, vmw_fpriv(file_priv), ret,
-                                   user_fence_rep, fence, handle, out_fence_fd,
-                                   sync_file);
-
        /* Don't unreference when handing fence out */
        if (unlikely(out_fence != NULL)) {
                *out_fence = fence;
@@ -4293,7 +4294,7 @@ int vmw_execbuf_process(struct drm_file *file_priv,
         */
        vmw_validation_unref_lists(&val_ctx);
 
-       return 0;
+       return ret;
 
 out_unlock_binding:
        mutex_unlock(&dev_priv->binding_mutex);
index c60d395..5001b87 100644 (file)
@@ -1128,7 +1128,7 @@ int vmw_fence_event_ioctl(struct drm_device *dev, void *data,
        }
 
        vmw_execbuf_copy_fence_user(dev_priv, vmw_fp, 0, user_fence_rep, fence,
-                                   handle, -1, NULL);
+                                   handle, -1);
        vmw_fence_obj_unreference(&fence);
        return 0;
 out_no_create:
index 4e693e8..bbd2f4e 100644 (file)
@@ -2501,7 +2501,7 @@ void vmw_kms_helper_validation_finish(struct vmw_private *dev_priv,
        if (file_priv)
                vmw_execbuf_copy_fence_user(dev_priv, vmw_fpriv(file_priv),
                                            ret, user_fence_rep, fence,
-                                           handle, -1, NULL);
+                                           handle, -1);
        if (out_fence)
                *out_fence = fence;
        else
index ca873a3..f2d05bf 100644 (file)
@@ -1660,6 +1660,13 @@ static int balloon_connect_vsp(struct hv_device *dev)
        unsigned long t;
        int ret;
 
+       /*
+        * max_pkt_size should be large enough for one vmbus packet header plus
+        * our receive buffer size. Hyper-V sends messages up to
+        * HV_HYP_PAGE_SIZE bytes long on balloon channel.
+        */
+       dev->channel->max_pkt_size = HV_HYP_PAGE_SIZE * 2;
+
        ret = vmbus_open(dev->channel, dm_ring_size, dm_ring_size, NULL, 0,
                         balloon_onchannelcallback, dev);
        if (ret)
index d519aca..fb6d14d 100644 (file)
@@ -662,6 +662,9 @@ static int adt7470_fan_write(struct device *dev, u32 attr, int channel, long val
        struct adt7470_data *data = dev_get_drvdata(dev);
        int err;
 
+       if (val <= 0)
+               return -EINVAL;
+
        val = FAN_RPM_TO_PERIOD(val);
        val = clamp_val(val, 1, 65534);
 
index 74019df..1c9493c 100644 (file)
@@ -373,7 +373,7 @@ static const struct lm90_params lm90_params[] = {
                .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
                  | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_CRIT,
                .alert_alarms = 0x7c,
-               .max_convrate = 8,
+               .max_convrate = 7,
        },
        [lm86] = {
                .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
@@ -394,12 +394,13 @@ static const struct lm90_params lm90_params[] = {
                .max_convrate = 9,
        },
        [max6646] = {
-               .flags = LM90_HAVE_CRIT,
+               .flags = LM90_HAVE_CRIT | LM90_HAVE_BROKEN_ALERT,
                .alert_alarms = 0x7c,
                .max_convrate = 6,
                .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL,
        },
        [max6654] = {
+               .flags = LM90_HAVE_BROKEN_ALERT,
                .alert_alarms = 0x7c,
                .max_convrate = 7,
                .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL,
@@ -418,7 +419,7 @@ static const struct lm90_params lm90_params[] = {
        },
        [max6680] = {
                .flags = LM90_HAVE_OFFSET | LM90_HAVE_CRIT
-                 | LM90_HAVE_CRIT_ALRM_SWP,
+                 | LM90_HAVE_CRIT_ALRM_SWP | LM90_HAVE_BROKEN_ALERT,
                .alert_alarms = 0x7c,
                .max_convrate = 7,
        },
@@ -848,7 +849,7 @@ static int lm90_update_device(struct device *dev)
                 * Re-enable ALERT# output if it was originally enabled and
                 * relevant alarms are all clear
                 */
-               if (!(data->config_orig & 0x80) &&
+               if ((client->irq || !(data->config_orig & 0x80)) &&
                    !(data->alarms & data->alert_alarms)) {
                        if (data->config & 0x80) {
                                dev_dbg(&client->dev, "Re-enabling ALERT#\n");
@@ -1807,22 +1808,22 @@ static bool lm90_is_tripped(struct i2c_client *client, u16 *status)
 
        if (st & LM90_STATUS_LLOW)
                hwmon_notify_event(data->hwmon_dev, hwmon_temp,
-                                  hwmon_temp_min, 0);
+                                  hwmon_temp_min_alarm, 0);
        if (st & LM90_STATUS_RLOW)
                hwmon_notify_event(data->hwmon_dev, hwmon_temp,
-                                  hwmon_temp_min, 1);
+                                  hwmon_temp_min_alarm, 1);
        if (st2 & MAX6696_STATUS2_R2LOW)
                hwmon_notify_event(data->hwmon_dev, hwmon_temp,
-                                  hwmon_temp_min, 2);
+                                  hwmon_temp_min_alarm, 2);
        if (st & LM90_STATUS_LHIGH)
                hwmon_notify_event(data->hwmon_dev, hwmon_temp,
-                                  hwmon_temp_max, 0);
+                                  hwmon_temp_max_alarm, 0);
        if (st & LM90_STATUS_RHIGH)
                hwmon_notify_event(data->hwmon_dev, hwmon_temp,
-                                  hwmon_temp_max, 1);
+                                  hwmon_temp_max_alarm, 1);
        if (st2 & MAX6696_STATUS2_R2HIGH)
                hwmon_notify_event(data->hwmon_dev, hwmon_temp,
-                                  hwmon_temp_max, 2);
+                                  hwmon_temp_max_alarm, 2);
 
        return true;
 }
index fd3f91c..098d12b 100644 (file)
@@ -1175,7 +1175,7 @@ static inline u8 in_to_reg(u32 val, u8 nr)
 
 struct nct6775_data {
        int addr;       /* IO base of hw monitor block */
-       int sioreg;     /* SIO register address */
+       struct nct6775_sio_data *sio_data;
        enum kinds kind;
        const char *name;
 
@@ -3559,7 +3559,7 @@ clear_caseopen(struct device *dev, struct device_attribute *attr,
               const char *buf, size_t count)
 {
        struct nct6775_data *data = dev_get_drvdata(dev);
-       struct nct6775_sio_data *sio_data = dev_get_platdata(dev);
+       struct nct6775_sio_data *sio_data = data->sio_data;
        int nr = to_sensor_dev_attr(attr)->index - INTRUSION_ALARM_BASE;
        unsigned long val;
        u8 reg;
@@ -3967,7 +3967,7 @@ static int nct6775_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        data->kind = sio_data->kind;
-       data->sioreg = sio_data->sioreg;
+       data->sio_data = sio_data;
 
        if (sio_data->access == access_direct) {
                data->addr = res->start;
index 0ea7e1c..09276e3 100644 (file)
@@ -62,7 +62,7 @@ static const struct i2c_device_id ir38064_id[] = {
 
 MODULE_DEVICE_TABLE(i2c, ir38064_id);
 
-static const struct of_device_id ir38064_of_match[] = {
+static const struct of_device_id __maybe_unused ir38064_of_match[] = {
        { .compatible = "infineon,ir38060" },
        { .compatible = "infineon,ir38064" },
        { .compatible = "infineon,ir38164" },
index c903b74..35f0d5e 100644 (file)
@@ -3322,7 +3322,7 @@ static int cm_lap_handler(struct cm_work *work)
        ret = cm_init_av_by_path(param->alternate_path, NULL, &alt_av);
        if (ret) {
                rdma_destroy_ah_attr(&ah_attr);
-               return -EINVAL;
+               goto deref;
        }
 
        spin_lock_irq(&cm_id_priv->lock);
index 27a00ce..c447526 100644 (file)
@@ -67,8 +67,8 @@ static const char * const cma_events[] = {
        [RDMA_CM_EVENT_TIMEWAIT_EXIT]    = "timewait exit",
 };
 
-static void cma_set_mgid(struct rdma_id_private *id_priv, struct sockaddr *addr,
-                        union ib_gid *mgid);
+static void cma_iboe_set_mgid(struct sockaddr *addr, union ib_gid *mgid,
+                             enum ib_gid_type gid_type);
 
 const char *__attribute_const__ rdma_event_msg(enum rdma_cm_event_type event)
 {
@@ -1846,17 +1846,19 @@ static void destroy_mc(struct rdma_id_private *id_priv,
                if (dev_addr->bound_dev_if)
                        ndev = dev_get_by_index(dev_addr->net,
                                                dev_addr->bound_dev_if);
-               if (ndev) {
+               if (ndev && !send_only) {
+                       enum ib_gid_type gid_type;
                        union ib_gid mgid;
 
-                       cma_set_mgid(id_priv, (struct sockaddr *)&mc->addr,
-                                    &mgid);
-
-                       if (!send_only)
-                               cma_igmp_send(ndev, &mgid, false);
-
-                       dev_put(ndev);
+                       gid_type = id_priv->cma_dev->default_gid_type
+                                          [id_priv->id.port_num -
+                                           rdma_start_port(
+                                                   id_priv->cma_dev->device)];
+                       cma_iboe_set_mgid((struct sockaddr *)&mc->addr, &mgid,
+                                         gid_type);
+                       cma_igmp_send(ndev, &mgid, false);
                }
+               dev_put(ndev);
 
                cancel_work_sync(&mc->iboe_join.work);
        }
index 2b72c4f..9d6ac9d 100644 (file)
@@ -95,6 +95,7 @@ struct ucma_context {
        u64                     uid;
 
        struct list_head        list;
+       struct list_head        mc_list;
        struct work_struct      close_work;
 };
 
@@ -105,6 +106,7 @@ struct ucma_multicast {
 
        u64                     uid;
        u8                      join_state;
+       struct list_head        list;
        struct sockaddr_storage addr;
 };
 
@@ -198,6 +200,7 @@ static struct ucma_context *ucma_alloc_ctx(struct ucma_file *file)
 
        INIT_WORK(&ctx->close_work, ucma_close_id);
        init_completion(&ctx->comp);
+       INIT_LIST_HEAD(&ctx->mc_list);
        /* So list_del() will work if we don't do ucma_finish_ctx() */
        INIT_LIST_HEAD(&ctx->list);
        ctx->file = file;
@@ -484,19 +487,19 @@ err1:
 
 static void ucma_cleanup_multicast(struct ucma_context *ctx)
 {
-       struct ucma_multicast *mc;
-       unsigned long index;
+       struct ucma_multicast *mc, *tmp;
 
-       xa_for_each(&multicast_table, index, mc) {
-               if (mc->ctx != ctx)
-                       continue;
+       xa_lock(&multicast_table);
+       list_for_each_entry_safe(mc, tmp, &ctx->mc_list, list) {
+               list_del(&mc->list);
                /*
                 * At this point mc->ctx->ref is 0 so the mc cannot leave the
                 * lock on the reader and this is enough serialization
                 */
-               xa_erase(&multicast_table, index);
+               __xa_erase(&multicast_table, mc->id);
                kfree(mc);
        }
+       xa_unlock(&multicast_table);
 }
 
 static void ucma_cleanup_mc_events(struct ucma_multicast *mc)
@@ -1469,12 +1472,16 @@ static ssize_t ucma_process_join(struct ucma_file *file,
        mc->uid = cmd->uid;
        memcpy(&mc->addr, addr, cmd->addr_size);
 
-       if (xa_alloc(&multicast_table, &mc->id, NULL, xa_limit_32b,
+       xa_lock(&multicast_table);
+       if (__xa_alloc(&multicast_table, &mc->id, NULL, xa_limit_32b,
                     GFP_KERNEL)) {
                ret = -ENOMEM;
                goto err_free_mc;
        }
 
+       list_add_tail(&mc->list, &ctx->mc_list);
+       xa_unlock(&multicast_table);
+
        mutex_lock(&ctx->mutex);
        ret = rdma_join_multicast(ctx->cm_id, (struct sockaddr *)&mc->addr,
                                  join_state, mc);
@@ -1500,8 +1507,11 @@ err_leave_multicast:
        mutex_unlock(&ctx->mutex);
        ucma_cleanup_mc_events(mc);
 err_xa_erase:
-       xa_erase(&multicast_table, mc->id);
+       xa_lock(&multicast_table);
+       list_del(&mc->list);
+       __xa_erase(&multicast_table, mc->id);
 err_free_mc:
+       xa_unlock(&multicast_table);
        kfree(mc);
 err_put_ctx:
        ucma_put_ctx(ctx);
@@ -1569,15 +1579,17 @@ static ssize_t ucma_leave_multicast(struct ucma_file *file,
                mc = ERR_PTR(-EINVAL);
        else if (!refcount_inc_not_zero(&mc->ctx->ref))
                mc = ERR_PTR(-ENXIO);
-       else
-               __xa_erase(&multicast_table, mc->id);
-       xa_unlock(&multicast_table);
 
        if (IS_ERR(mc)) {
+               xa_unlock(&multicast_table);
                ret = PTR_ERR(mc);
                goto out;
        }
 
+       list_del(&mc->list);
+       __xa_erase(&multicast_table, mc->id);
+       xa_unlock(&multicast_table);
+
        mutex_lock(&mc->ctx->mutex);
        rdma_leave_multicast(mc->ctx->cm_id, (struct sockaddr *) &mc->addr);
        mutex_unlock(&mc->ctx->mutex);
index 9091229..aec60d4 100644 (file)
@@ -55,7 +55,7 @@ union hfi1_ipoib_flow {
  */
 struct ipoib_txreq {
        struct sdma_txreq           txreq;
-       struct hfi1_sdma_header     sdma_hdr;
+       struct hfi1_sdma_header     *sdma_hdr;
        int                         sdma_status;
        int                         complete;
        struct hfi1_ipoib_dev_priv *priv;
index e1a2b02..5d814af 100644 (file)
@@ -22,26 +22,35 @@ static int hfi1_ipoib_dev_init(struct net_device *dev)
        int ret;
 
        dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats);
+       if (!dev->tstats)
+               return -ENOMEM;
 
        ret = priv->netdev_ops->ndo_init(dev);
        if (ret)
-               return ret;
+               goto out_ret;
 
        ret = hfi1_netdev_add_data(priv->dd,
                                   qpn_from_mac(priv->netdev->dev_addr),
                                   dev);
        if (ret < 0) {
                priv->netdev_ops->ndo_uninit(dev);
-               return ret;
+               goto out_ret;
        }
 
        return 0;
+out_ret:
+       free_percpu(dev->tstats);
+       dev->tstats = NULL;
+       return ret;
 }
 
 static void hfi1_ipoib_dev_uninit(struct net_device *dev)
 {
        struct hfi1_ipoib_dev_priv *priv = hfi1_ipoib_priv(dev);
 
+       free_percpu(dev->tstats);
+       dev->tstats = NULL;
+
        hfi1_netdev_remove_data(priv->dd, qpn_from_mac(priv->netdev->dev_addr));
 
        priv->netdev_ops->ndo_uninit(dev);
@@ -166,12 +175,7 @@ static void hfi1_ipoib_netdev_dtor(struct net_device *dev)
        hfi1_ipoib_rxq_deinit(priv->netdev);
 
        free_percpu(dev->tstats);
-}
-
-static void hfi1_ipoib_free_rdma_netdev(struct net_device *dev)
-{
-       hfi1_ipoib_netdev_dtor(dev);
-       free_netdev(dev);
+       dev->tstats = NULL;
 }
 
 static void hfi1_ipoib_set_id(struct net_device *dev, int id)
@@ -211,24 +215,23 @@ static int hfi1_ipoib_setup_rn(struct ib_device *device,
        priv->port_num = port_num;
        priv->netdev_ops = netdev->netdev_ops;
 
-       netdev->netdev_ops = &hfi1_ipoib_netdev_ops;
-
        ib_query_pkey(device, port_num, priv->pkey_index, &priv->pkey);
 
        rc = hfi1_ipoib_txreq_init(priv);
        if (rc) {
                dd_dev_err(dd, "IPoIB netdev TX init - failed(%d)\n", rc);
-               hfi1_ipoib_free_rdma_netdev(netdev);
                return rc;
        }
 
        rc = hfi1_ipoib_rxq_init(netdev);
        if (rc) {
                dd_dev_err(dd, "IPoIB netdev RX init - failed(%d)\n", rc);
-               hfi1_ipoib_free_rdma_netdev(netdev);
+               hfi1_ipoib_txreq_deinit(priv);
                return rc;
        }
 
+       netdev->netdev_ops = &hfi1_ipoib_netdev_ops;
+
        netdev->priv_destructor = hfi1_ipoib_netdev_dtor;
        netdev->needs_free_netdev = true;
 
index f401089..d6bbdb8 100644 (file)
@@ -122,7 +122,7 @@ static void hfi1_ipoib_free_tx(struct ipoib_txreq *tx, int budget)
                dd_dev_warn(priv->dd,
                            "%s: Status = 0x%x pbc 0x%llx txq = %d sde = %d\n",
                            __func__, tx->sdma_status,
-                           le64_to_cpu(tx->sdma_hdr.pbc), tx->txq->q_idx,
+                           le64_to_cpu(tx->sdma_hdr->pbc), tx->txq->q_idx,
                            tx->txq->sde->this_idx);
        }
 
@@ -231,7 +231,7 @@ static int hfi1_ipoib_build_tx_desc(struct ipoib_txreq *tx,
 {
        struct hfi1_devdata *dd = txp->dd;
        struct sdma_txreq *txreq = &tx->txreq;
-       struct hfi1_sdma_header *sdma_hdr = &tx->sdma_hdr;
+       struct hfi1_sdma_header *sdma_hdr = tx->sdma_hdr;
        u16 pkt_bytes =
                sizeof(sdma_hdr->pbc) + (txp->hdr_dwords << 2) + tx->skb->len;
        int ret;
@@ -256,7 +256,7 @@ static void hfi1_ipoib_build_ib_tx_headers(struct ipoib_txreq *tx,
                                           struct ipoib_txparms *txp)
 {
        struct hfi1_ipoib_dev_priv *priv = tx->txq->priv;
-       struct hfi1_sdma_header *sdma_hdr = &tx->sdma_hdr;
+       struct hfi1_sdma_header *sdma_hdr = tx->sdma_hdr;
        struct sk_buff *skb = tx->skb;
        struct hfi1_pportdata *ppd = ppd_from_ibp(txp->ibp);
        struct rdma_ah_attr *ah_attr = txp->ah_attr;
@@ -483,7 +483,7 @@ static int hfi1_ipoib_send_dma_single(struct net_device *dev,
        if (likely(!ret)) {
 tx_ok:
                trace_sdma_output_ibhdr(txq->priv->dd,
-                                       &tx->sdma_hdr.hdr,
+                                       &tx->sdma_hdr->hdr,
                                        ib_is_sc5(txp->flow.sc5));
                hfi1_ipoib_check_queue_depth(txq);
                return NETDEV_TX_OK;
@@ -547,7 +547,7 @@ static int hfi1_ipoib_send_dma_list(struct net_device *dev,
        hfi1_ipoib_check_queue_depth(txq);
 
        trace_sdma_output_ibhdr(txq->priv->dd,
-                               &tx->sdma_hdr.hdr,
+                               &tx->sdma_hdr->hdr,
                                ib_is_sc5(txp->flow.sc5));
 
        if (!netdev_xmit_more())
@@ -683,7 +683,8 @@ int hfi1_ipoib_txreq_init(struct hfi1_ipoib_dev_priv *priv)
 {
        struct net_device *dev = priv->netdev;
        u32 tx_ring_size, tx_item_size;
-       int i;
+       struct hfi1_ipoib_circ_buf *tx_ring;
+       int i, j;
 
        /*
         * Ring holds 1 less than tx_ring_size
@@ -701,7 +702,9 @@ int hfi1_ipoib_txreq_init(struct hfi1_ipoib_dev_priv *priv)
 
        for (i = 0; i < dev->num_tx_queues; i++) {
                struct hfi1_ipoib_txq *txq = &priv->txqs[i];
+               struct ipoib_txreq *tx;
 
+               tx_ring = &txq->tx_ring;
                iowait_init(&txq->wait,
                            0,
                            hfi1_ipoib_flush_txq,
@@ -725,14 +728,19 @@ int hfi1_ipoib_txreq_init(struct hfi1_ipoib_dev_priv *priv)
                                             priv->dd->node);
 
                txq->tx_ring.items =
-                       kcalloc_node(tx_ring_size, tx_item_size,
-                                    GFP_KERNEL, priv->dd->node);
+                       kvzalloc_node(array_size(tx_ring_size, tx_item_size),
+                                     GFP_KERNEL, priv->dd->node);
                if (!txq->tx_ring.items)
                        goto free_txqs;
 
                txq->tx_ring.max_items = tx_ring_size;
-               txq->tx_ring.shift = ilog2(tx_ring_size);
+               txq->tx_ring.shift = ilog2(tx_item_size);
                txq->tx_ring.avail = hfi1_ipoib_ring_hwat(txq);
+               tx_ring = &txq->tx_ring;
+               for (j = 0; j < tx_ring_size; j++)
+                       hfi1_txreq_from_idx(tx_ring, j)->sdma_hdr =
+                               kzalloc_node(sizeof(*tx->sdma_hdr),
+                                            GFP_KERNEL, priv->dd->node);
 
                netif_tx_napi_add(dev, &txq->napi,
                                  hfi1_ipoib_poll_tx_ring,
@@ -746,7 +754,10 @@ free_txqs:
                struct hfi1_ipoib_txq *txq = &priv->txqs[i];
 
                netif_napi_del(&txq->napi);
-               kfree(txq->tx_ring.items);
+               tx_ring = &txq->tx_ring;
+               for (j = 0; j < tx_ring_size; j++)
+                       kfree(hfi1_txreq_from_idx(tx_ring, j)->sdma_hdr);
+               kvfree(tx_ring->items);
        }
 
        kfree(priv->txqs);
@@ -780,17 +791,20 @@ static void hfi1_ipoib_drain_tx_list(struct hfi1_ipoib_txq *txq)
 
 void hfi1_ipoib_txreq_deinit(struct hfi1_ipoib_dev_priv *priv)
 {
-       int i;
+       int i, j;
 
        for (i = 0; i < priv->netdev->num_tx_queues; i++) {
                struct hfi1_ipoib_txq *txq = &priv->txqs[i];
+               struct hfi1_ipoib_circ_buf *tx_ring = &txq->tx_ring;
 
                iowait_cancel_work(&txq->wait);
                iowait_sdma_drain(&txq->wait);
                hfi1_ipoib_drain_tx_list(txq);
                netif_napi_del(&txq->napi);
                hfi1_ipoib_drain_tx_ring(txq);
-               kfree(txq->tx_ring.items);
+               for (j = 0; j < tx_ring->max_items; j++)
+                       kfree(hfi1_txreq_from_idx(tx_ring, j)->sdma_hdr);
+               kvfree(tx_ring->items);
        }
 
        kfree(priv->txqs);
index 1c3d972..93b1650 100644 (file)
@@ -3237,7 +3237,7 @@ static void mlx4_ib_event(struct mlx4_dev *dev, void *ibdev_ptr,
        case MLX4_DEV_EVENT_PORT_MGMT_CHANGE:
                ew = kmalloc(sizeof *ew, GFP_ATOMIC);
                if (!ew)
-                       break;
+                       return;
 
                INIT_WORK(&ew->work, handle_port_mgmt_change_event);
                memcpy(&ew->ib_eqe, eqe, sizeof *eqe);
index 3305f27..ae50b56 100644 (file)
@@ -3073,6 +3073,8 @@ do_write:
        case IB_WR_ATOMIC_FETCH_AND_ADD:
                if (unlikely(!(qp->qp_access_flags & IB_ACCESS_REMOTE_ATOMIC)))
                        goto inv_err;
+               if (unlikely(wqe->atomic_wr.remote_addr & (sizeof(u64) - 1)))
+                       goto inv_err;
                if (unlikely(!rvt_rkey_ok(qp, &qp->r_sge.sge, sizeof(u64),
                                          wqe->atomic_wr.remote_addr,
                                          wqe->atomic_wr.rkey,
index 368959a..df03d84 100644 (file)
@@ -644,14 +644,9 @@ static inline struct siw_sqe *orq_get_current(struct siw_qp *qp)
        return &qp->orq[qp->orq_get % qp->attrs.orq_size];
 }
 
-static inline struct siw_sqe *orq_get_tail(struct siw_qp *qp)
-{
-       return &qp->orq[qp->orq_put % qp->attrs.orq_size];
-}
-
 static inline struct siw_sqe *orq_get_free(struct siw_qp *qp)
 {
-       struct siw_sqe *orq_e = orq_get_tail(qp);
+       struct siw_sqe *orq_e = &qp->orq[qp->orq_put % qp->attrs.orq_size];
 
        if (READ_ONCE(orq_e->flags) == 0)
                return orq_e;
index 60116f2..875ea6f 100644 (file)
@@ -1153,11 +1153,12 @@ static int siw_check_tx_fence(struct siw_qp *qp)
 
        spin_lock_irqsave(&qp->orq_lock, flags);
 
-       rreq = orq_get_current(qp);
-
        /* free current orq entry */
+       rreq = orq_get_current(qp);
        WRITE_ONCE(rreq->flags, 0);
 
+       qp->orq_get++;
+
        if (qp->tx_ctx.orq_fence) {
                if (unlikely(tx_waiting->wr_status != SIW_WR_QUEUED)) {
                        pr_warn("siw: [QP %u]: fence resume: bad status %d\n",
@@ -1165,10 +1166,12 @@ static int siw_check_tx_fence(struct siw_qp *qp)
                        rv = -EPROTO;
                        goto out;
                }
-               /* resume SQ processing */
+               /* resume SQ processing, if possible */
                if (tx_waiting->sqe.opcode == SIW_OP_READ ||
                    tx_waiting->sqe.opcode == SIW_OP_READ_LOCAL_INV) {
-                       rreq = orq_get_tail(qp);
+
+                       /* SQ processing was stopped because of a full ORQ */
+                       rreq = orq_get_free(qp);
                        if (unlikely(!rreq)) {
                                pr_warn("siw: [QP %u]: no ORQE\n", qp_id(qp));
                                rv = -EPROTO;
@@ -1181,15 +1184,14 @@ static int siw_check_tx_fence(struct siw_qp *qp)
                        resume_tx = 1;
 
                } else if (siw_orq_empty(qp)) {
+                       /*
+                        * SQ processing was stopped by fenced work request.
+                        * Resume since all previous Read's are now completed.
+                        */
                        qp->tx_ctx.orq_fence = 0;
                        resume_tx = 1;
-               } else {
-                       pr_warn("siw: [QP %u]: fence resume: orq idx: %d:%d\n",
-                               qp_id(qp), qp->orq_get, qp->orq_put);
-                       rv = -EPROTO;
                }
        }
-       qp->orq_get++;
 out:
        spin_unlock_irqrestore(&qp->orq_lock, flags);
 
index a3dd2cb..54ef367 100644 (file)
@@ -313,7 +313,8 @@ int siw_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *attrs,
 
        if (atomic_inc_return(&sdev->num_qp) > SIW_MAX_QP) {
                siw_dbg(base_dev, "too many QP's\n");
-               return -ENOMEM;
+               rv = -ENOMEM;
+               goto err_atomic;
        }
        if (attrs->qp_type != IB_QPT_RC) {
                siw_dbg(base_dev, "only RC QP's supported\n");
index 78d2ee9..1b58611 100644 (file)
@@ -615,10 +615,9 @@ static int wm97xx_register_touch(struct wm97xx *wm)
         * extensions)
         */
        wm->touch_dev = platform_device_alloc("wm97xx-touch", -1);
-       if (!wm->touch_dev) {
-               ret = -ENOMEM;
-               goto touch_err;
-       }
+       if (!wm->touch_dev)
+               return -ENOMEM;
+
        platform_set_drvdata(wm->touch_dev, wm);
        wm->touch_dev->dev.parent = wm->dev;
        wm->touch_dev->dev.platform_data = pdata;
@@ -629,9 +628,6 @@ static int wm97xx_register_touch(struct wm97xx *wm)
        return 0;
 touch_reg_err:
        platform_device_put(wm->touch_dev);
-touch_err:
-       input_unregister_device(wm->input_dev);
-       wm->input_dev = NULL;
 
        return ret;
 }
@@ -639,8 +635,6 @@ touch_err:
 static void wm97xx_unregister_touch(struct wm97xx *wm)
 {
        platform_device_unregister(wm->touch_dev);
-       input_unregister_device(wm->input_dev);
-       wm->input_dev = NULL;
 }
 
 static int _wm97xx_probe(struct wm97xx *wm)
index dc338ac..b10fb52 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/export.h>
 #include <linux/kmemleak.h>
 #include <linux/cc_platform.h>
+#include <linux/iopoll.h>
 #include <asm/pci-direct.h>
 #include <asm/iommu.h>
 #include <asm/apic.h>
@@ -834,6 +835,7 @@ static int iommu_ga_log_enable(struct amd_iommu *iommu)
                status = readl(iommu->mmio_base + MMIO_STATUS_OFFSET);
                if (status & (MMIO_STATUS_GALOG_RUN_MASK))
                        break;
+               udelay(10);
        }
 
        if (WARN_ON(i >= LOOP_TIMEOUT))
index f912fe4..a673195 100644 (file)
@@ -569,9 +569,8 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu)
                                            fn, &intel_ir_domain_ops,
                                            iommu);
        if (!iommu->ir_domain) {
-               irq_domain_free_fwnode(fn);
                pr_err("IR%d: failed to allocate irqdomain\n", iommu->seq_id);
-               goto out_free_bitmap;
+               goto out_free_fwnode;
        }
        iommu->ir_msi_domain =
                arch_create_remap_msi_irq_domain(iommu->ir_domain,
@@ -595,7 +594,7 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu)
 
                if (dmar_enable_qi(iommu)) {
                        pr_err("Failed to enable queued invalidation\n");
-                       goto out_free_bitmap;
+                       goto out_free_ir_domain;
                }
        }
 
@@ -619,6 +618,14 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu)
 
        return 0;
 
+out_free_ir_domain:
+       if (iommu->ir_msi_domain)
+               irq_domain_remove(iommu->ir_msi_domain);
+       iommu->ir_msi_domain = NULL;
+       irq_domain_remove(iommu->ir_domain);
+       iommu->ir_domain = NULL;
+out_free_fwnode:
+       irq_domain_free_fwnode(fn);
 out_free_bitmap:
        bitmap_free(bitmap);
 out_free_pages:
index 50ee27b..06fee74 100644 (file)
@@ -349,6 +349,7 @@ EXPORT_SYMBOL_GPL(ioasid_alloc);
 
 /**
  * ioasid_get - obtain a reference to the IOASID
+ * @ioasid: the ID to get
  */
 void ioasid_get(ioasid_t ioasid)
 {
index 8b86406..107dcf5 100644 (file)
@@ -207,9 +207,14 @@ static struct dev_iommu *dev_iommu_get(struct device *dev)
 
 static void dev_iommu_free(struct device *dev)
 {
-       iommu_fwspec_free(dev);
-       kfree(dev->iommu);
+       struct dev_iommu *param = dev->iommu;
+
        dev->iommu = NULL;
+       if (param->fwspec) {
+               fwnode_handle_put(param->fwspec->iommu_fwnode);
+               kfree(param->fwspec);
+       }
+       kfree(param);
 }
 
 static int __iommu_probe_device(struct device *dev, struct list_head *group_list)
@@ -980,17 +985,6 @@ static int iommu_group_device_count(struct iommu_group *group)
        return ret;
 }
 
-/**
- * iommu_group_for_each_dev - iterate over each device in the group
- * @group: the group
- * @data: caller opaque data to be passed to callback function
- * @fn: caller supplied callback function
- *
- * This function is called by group users to iterate over group devices.
- * Callers should hold a reference count to the group during callback.
- * The group->mutex is held across callbacks, which will block calls to
- * iommu_group_add/remove_device.
- */
 static int __iommu_group_for_each_dev(struct iommu_group *group, void *data,
                                      int (*fn)(struct device *, void *))
 {
@@ -1005,7 +999,17 @@ static int __iommu_group_for_each_dev(struct iommu_group *group, void *data,
        return ret;
 }
 
-
+/**
+ * iommu_group_for_each_dev - iterate over each device in the group
+ * @group: the group
+ * @data: caller opaque data to be passed to callback function
+ * @fn: caller supplied callback function
+ *
+ * This function is called by group users to iterate over group devices.
+ * Callers should hold a reference count to the group during callback.
+ * The group->mutex is held across callbacks, which will block calls to
+ * iommu_group_add/remove_device.
+ */
 int iommu_group_for_each_dev(struct iommu_group *group, void *data,
                             int (*fn)(struct device *, void *))
 {
@@ -3032,6 +3036,7 @@ EXPORT_SYMBOL_GPL(iommu_aux_get_pasid);
  * iommu_sva_bind_device() - Bind a process address space to a device
  * @dev: the device
  * @mm: the mm to bind, caller must hold a reference to it
+ * @drvdata: opaque data pointer to pass to bind callback
  *
  * Create a bond between device and address space, allowing the device to access
  * the mm using the returned PASID. If a bond already exists between @device and
index 9174965..980e4af 100644 (file)
@@ -1085,7 +1085,7 @@ static __maybe_unused int omap_iommu_runtime_resume(struct device *dev)
 }
 
 /**
- * omap_iommu_suspend_prepare - prepare() dev_pm_ops implementation
+ * omap_iommu_prepare - prepare() dev_pm_ops implementation
  * @dev:       iommu device
  *
  * This function performs the necessary checks to determine if the IOMMU
index 2543ef6..38091eb 100644 (file)
@@ -178,7 +178,6 @@ struct aic_irq_chip {
        struct irq_domain *hw_domain;
        struct irq_domain *ipi_domain;
        int nr_hw;
-       int ipi_hwirq;
 };
 
 static DEFINE_PER_CPU(uint32_t, aic_fiq_unmasked);
index d25b7a8..9e93ff2 100644 (file)
@@ -4856,6 +4856,38 @@ static struct syscore_ops its_syscore_ops = {
        .resume = its_restore_enable,
 };
 
+static void __init __iomem *its_map_one(struct resource *res, int *err)
+{
+       void __iomem *its_base;
+       u32 val;
+
+       its_base = ioremap(res->start, SZ_64K);
+       if (!its_base) {
+               pr_warn("ITS@%pa: Unable to map ITS registers\n", &res->start);
+               *err = -ENOMEM;
+               return NULL;
+       }
+
+       val = readl_relaxed(its_base + GITS_PIDR2) & GIC_PIDR2_ARCH_MASK;
+       if (val != 0x30 && val != 0x40) {
+               pr_warn("ITS@%pa: No ITS detected, giving up\n", &res->start);
+               *err = -ENODEV;
+               goto out_unmap;
+       }
+
+       *err = its_force_quiescent(its_base);
+       if (*err) {
+               pr_warn("ITS@%pa: Failed to quiesce, giving up\n", &res->start);
+               goto out_unmap;
+       }
+
+       return its_base;
+
+out_unmap:
+       iounmap(its_base);
+       return NULL;
+}
+
 static int its_init_domain(struct fwnode_handle *handle, struct its_node *its)
 {
        struct irq_domain *inner_domain;
@@ -4963,29 +4995,14 @@ static int __init its_probe_one(struct resource *res,
 {
        struct its_node *its;
        void __iomem *its_base;
-       u32 val, ctlr;
        u64 baser, tmp, typer;
        struct page *page;
+       u32 ctlr;
        int err;
 
-       its_base = ioremap(res->start, SZ_64K);
-       if (!its_base) {
-               pr_warn("ITS@%pa: Unable to map ITS registers\n", &res->start);
-               return -ENOMEM;
-       }
-
-       val = readl_relaxed(its_base + GITS_PIDR2) & GIC_PIDR2_ARCH_MASK;
-       if (val != 0x30 && val != 0x40) {
-               pr_warn("ITS@%pa: No ITS detected, giving up\n", &res->start);
-               err = -ENODEV;
-               goto out_unmap;
-       }
-
-       err = its_force_quiescent(its_base);
-       if (err) {
-               pr_warn("ITS@%pa: Failed to quiesce, giving up\n", &res->start);
-               goto out_unmap;
-       }
+       its_base = its_map_one(res, &err);
+       if (!its_base)
+               return err;
 
        pr_info("ITS %pR\n", res);
 
@@ -5241,13 +5258,31 @@ static int its_cpu_memreserve_lpi(unsigned int cpu)
 
 out:
        /* Last CPU being brought up gets to issue the cleanup */
-       if (cpumask_equal(&cpus_booted_once_mask, cpu_possible_mask))
+       if (!IS_ENABLED(CONFIG_SMP) ||
+           cpumask_equal(&cpus_booted_once_mask, cpu_possible_mask))
                schedule_work(&rdist_memreserve_cpuhp_cleanup_work);
 
        gic_data_rdist()->flags |= RD_LOCAL_MEMRESERVE_DONE;
        return ret;
 }
 
+/* Mark all the BASER registers as invalid before they get reprogrammed */
+static int __init its_reset_one(struct resource *res)
+{
+       void __iomem *its_base;
+       int err, i;
+
+       its_base = its_map_one(res, &err);
+       if (!its_base)
+               return err;
+
+       for (i = 0; i < GITS_BASER_NR_REGS; i++)
+               gits_write_baser(0, its_base + GITS_BASER + (i << 3));
+
+       iounmap(its_base);
+       return 0;
+}
+
 static const struct of_device_id its_device_id[] = {
        {       .compatible     = "arm,gic-v3-its",     },
        {},
@@ -5258,6 +5293,26 @@ static int __init its_of_probe(struct device_node *node)
        struct device_node *np;
        struct resource res;
 
+       /*
+        * Make sure *all* the ITS are reset before we probe any, as
+        * they may be sharing memory. If any of the ITS fails to
+        * reset, don't even try to go any further, as this could
+        * result in something even worse.
+        */
+       for (np = of_find_matching_node(node, its_device_id); np;
+            np = of_find_matching_node(np, its_device_id)) {
+               int err;
+
+               if (!of_device_is_available(np) ||
+                   !of_property_read_bool(np, "msi-controller") ||
+                   of_address_to_resource(np, 0, &res))
+                       continue;
+
+               err = its_reset_one(&res);
+               if (err)
+                       return err;
+       }
+
        for (np = of_find_matching_node(node, its_device_id); np;
             np = of_find_matching_node(np, its_device_id)) {
                if (!of_device_is_available(np))
@@ -5420,11 +5475,35 @@ dom_err:
        return err;
 }
 
+static int __init its_acpi_reset(union acpi_subtable_headers *header,
+                                const unsigned long end)
+{
+       struct acpi_madt_generic_translator *its_entry;
+       struct resource res;
+
+       its_entry = (struct acpi_madt_generic_translator *)header;
+       res = (struct resource) {
+               .start  = its_entry->base_address,
+               .end    = its_entry->base_address + ACPI_GICV3_ITS_MEM_SIZE - 1,
+               .flags  = IORESOURCE_MEM,
+       };
+
+       return its_reset_one(&res);
+}
+
 static void __init its_acpi_probe(void)
 {
        acpi_table_parse_srat_its();
-       acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_TRANSLATOR,
-                             gic_acpi_parse_madt_its, 0);
+       /*
+        * Make sure *all* the ITS are reset before we probe any, as
+        * they may be sharing memory. If any of the ITS fails to
+        * reset, don't even try to go any further, as this could
+        * result in something even worse.
+        */
+       if (acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_TRANSLATOR,
+                                 its_acpi_reset, 0) > 0)
+               acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_TRANSLATOR,
+                                     gic_acpi_parse_madt_its, 0);
        acpi_its_srat_maps_free();
 }
 #else
index 32562b7..e3801c4 100644 (file)
@@ -241,7 +241,7 @@ static int pch_msi_init(struct device_node *node,
        return 0;
 
 err_map:
-       kfree(priv->msi_map);
+       bitmap_free(priv->msi_map);
 err_priv:
        kfree(priv);
        return ret;
index fd9f275..50a5682 100644 (file)
@@ -62,7 +62,7 @@ static struct irq_chip realtek_ictl_irq = {
 
 static int intc_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw)
 {
-       irq_set_chip_and_handler(hw, &realtek_ictl_irq, handle_level_irq);
+       irq_set_chip_and_handler(irq, &realtek_ictl_irq, handle_level_irq);
 
        return 0;
 }
@@ -76,16 +76,20 @@ static void realtek_irq_dispatch(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        struct irq_domain *domain;
-       unsigned int pending;
+       unsigned long pending;
+       unsigned int soc_int;
 
        chained_irq_enter(chip, desc);
        pending = readl(REG(RTL_ICTL_GIMR)) & readl(REG(RTL_ICTL_GISR));
+
        if (unlikely(!pending)) {
                spurious_interrupt();
                goto out;
        }
+
        domain = irq_desc_get_handler_data(desc);
-       generic_handle_domain_irq(domain, __ffs(pending));
+       for_each_set_bit(soc_int, &pending, 32)
+               generic_handle_domain_irq(domain, soc_int);
 
 out:
        chained_irq_exit(chip, desc);
@@ -95,7 +99,8 @@ out:
  * SoC interrupts are cascaded to MIPS CPU interrupts according to the
  * interrupt-map in the device tree. Each SoC interrupt gets 4 bits for
  * the CPU interrupt in an Interrupt Routing Register. Max 32 SoC interrupts
- * thus go into 4 IRRs.
+ * thus go into 4 IRRs. A routing value of '0' means the interrupt is left
+ * disconnected. Routing values {1..15} connect to output lines {0..14}.
  */
 static int __init map_interrupts(struct device_node *node, struct irq_domain *domain)
 {
@@ -134,7 +139,7 @@ static int __init map_interrupts(struct device_node *node, struct irq_domain *do
                of_node_put(cpu_ictl);
 
                cpu_int = be32_to_cpup(imap + 2);
-               if (cpu_int > 7)
+               if (cpu_int > 7 || cpu_int < 2)
                        return -EINVAL;
 
                if (!(mips_irqs_set & BIT(cpu_int))) {
@@ -143,7 +148,8 @@ static int __init map_interrupts(struct device_node *node, struct irq_domain *do
                        mips_irqs_set |= BIT(cpu_int);
                }
 
-               regs[(soc_int * 4) / 32] |= cpu_int << (soc_int * 4) % 32;
+               /* Use routing values (1..6) for CPU interrupts (2..7) */
+               regs[(soc_int * 4) / 32] |= (cpu_int - 1) << (soc_int * 4) % 32;
                imap += 3;
        }
 
index c0ae808..dcbd6d2 100644 (file)
@@ -489,7 +489,7 @@ static void start_io_acct(struct dm_io *io)
        struct mapped_device *md = io->md;
        struct bio *bio = io->orig_bio;
 
-       io->start_time = bio_start_io_acct(bio);
+       bio_start_io_acct_time(bio, io->start_time);
        if (unlikely(dm_stats_used(&md->stats)))
                dm_stats_account_io(&md->stats, bio_data_dir(bio),
                                    bio->bi_iter.bi_sector, bio_sectors(bio),
@@ -535,7 +535,7 @@ static struct dm_io *alloc_io(struct mapped_device *md, struct bio *bio)
        io->md = md;
        spin_lock_init(&io->endio_lock);
 
-       start_io_acct(io);
+       io->start_time = jiffies;
 
        return io;
 }
@@ -1442,9 +1442,6 @@ static void init_clone_info(struct clone_info *ci, struct mapped_device *md,
        ci->sector = bio->bi_iter.bi_sector;
 }
 
-#define __dm_part_stat_sub(part, field, subnd) \
-       (part_stat_get(part, field) -= (subnd))
-
 /*
  * Entry point to split a bio into clones and submit them to the targets.
  */
@@ -1480,23 +1477,12 @@ static void __split_and_process_bio(struct mapped_device *md,
                                                  GFP_NOIO, &md->queue->bio_split);
                        ci.io->orig_bio = b;
 
-                       /*
-                        * Adjust IO stats for each split, otherwise upon queue
-                        * reentry there will be redundant IO accounting.
-                        * NOTE: this is a stop-gap fix, a proper fix involves
-                        * significant refactoring of DM core's bio splitting
-                        * (by eliminating DM's splitting and just using bio_split)
-                        */
-                       part_stat_lock();
-                       __dm_part_stat_sub(dm_disk(md)->part0,
-                                          sectors[op_stat_group(bio_op(bio))], ci.sector_count);
-                       part_stat_unlock();
-
                        bio_chain(b, bio);
                        trace_block_split(b, bio->bi_iter.bi_sector);
                        submit_bio_noacct(bio);
                }
        }
+       start_io_acct(ci.io);
 
        /* drop the extra reference count */
        dm_io_dec_pending(ci.io, errno_to_blk_status(error));
index 5881d05..4d38bd7 100644 (file)
@@ -5869,10 +5869,6 @@ int md_run(struct mddev *mddev)
                nowait = nowait && blk_queue_nowait(bdev_get_queue(rdev->bdev));
        }
 
-       /* Set the NOWAIT flags if all underlying devices support it */
-       if (nowait)
-               blk_queue_flag_set(QUEUE_FLAG_NOWAIT, mddev->queue);
-
        if (!bioset_initialized(&mddev->bio_set)) {
                err = bioset_init(&mddev->bio_set, BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS);
                if (err)
@@ -6010,6 +6006,10 @@ int md_run(struct mddev *mddev)
                else
                        blk_queue_flag_clear(QUEUE_FLAG_NONROT, mddev->queue);
                blk_queue_flag_set(QUEUE_FLAG_IO_STAT, mddev->queue);
+
+               /* Set the NOWAIT flags if all underlying devices support it */
+               if (nowait)
+                       blk_queue_flag_set(QUEUE_FLAG_NOWAIT, mddev->queue);
        }
        if (pers->sync_request) {
                if (mddev->kobj.sd &&
index c3305bd..bee727e 100644 (file)
@@ -440,6 +440,10 @@ static int at25_probe(struct spi_device *spi)
                return -ENXIO;
        }
 
+       at25 = devm_kzalloc(&spi->dev, sizeof(*at25), GFP_KERNEL);
+       if (!at25)
+               return -ENOMEM;
+
        mutex_init(&at25->lock);
        at25->spi = spi;
        spi_set_drvdata(spi, at25);
index ec498ce..238b56d 100644 (file)
@@ -4133,9 +4133,7 @@ static int bond_eth_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cm
 
                fallthrough;
        case SIOCGHWTSTAMP:
-               rcu_read_lock();
                real_dev = bond_option_active_slave_get_rcu(bond);
-               rcu_read_unlock();
                if (!real_dev)
                        return -EOPNOTSUPP;
 
@@ -5382,9 +5380,7 @@ static int bond_ethtool_get_ts_info(struct net_device *bond_dev,
        struct net_device *real_dev;
        struct phy_device *phydev;
 
-       rcu_read_lock();
        real_dev = bond_option_active_slave_get_rcu(bond);
-       rcu_read_unlock();
        if (real_dev) {
                ops = real_dev->ethtool_ops;
                phydev = real_dev->phydev;
index 0bff188..74d7fcb 100644 (file)
@@ -296,6 +296,7 @@ static_assert(sizeof(struct flexcan_regs) ==  0x4 * 18 + 0xfb8);
 static const struct flexcan_devtype_data fsl_mcf5441x_devtype_data = {
        .quirks = FLEXCAN_QUIRK_BROKEN_PERR_STATE |
                FLEXCAN_QUIRK_NR_IRQ_3 | FLEXCAN_QUIRK_NR_MB_16 |
+               FLEXCAN_QUIRK_SUPPPORT_RX_MAILBOX |
                FLEXCAN_QUIRK_SUPPPORT_RX_FIFO,
 };
 
index fccdff8..23fc09a 100644 (file)
@@ -21,7 +21,7 @@
  * Below is some version info we got:
  *    SOC   Version   IP-Version  Glitch- [TR]WRN_INT IRQ Err Memory err RTR rece-   FD Mode     MB
  *                                Filter? connected?  Passive detection  ption in MB Supported?
- * MCF5441X FlexCAN2  ?               no       yes        no       no       yes           no     16
+ * MCF5441X FlexCAN2  ?               no       yes        no       no        no           no     16
  *    MX25  FlexCAN2  03.00.00.00     no        no        no       no        no           no     64
  *    MX28  FlexCAN2  03.00.04.00    yes       yes        no       no        no           no     64
  *    MX35  FlexCAN2  03.00.00.00     no        no        no       no        no           no     64
index 5b47cd8..1a4b56f 100644 (file)
@@ -336,6 +336,9 @@ m_can_fifo_read(struct m_can_classdev *cdev,
        u32 addr_offset = cdev->mcfg[MRAM_RXF0].off + fgi * RXF0_ELEMENT_SIZE +
                offset;
 
+       if (val_count == 0)
+               return 0;
+
        return cdev->ops->read_fifo(cdev, addr_offset, val, val_count);
 }
 
@@ -346,6 +349,9 @@ m_can_fifo_write(struct m_can_classdev *cdev,
        u32 addr_offset = cdev->mcfg[MRAM_TXB].off + fpi * TXB_ELEMENT_SIZE +
                offset;
 
+       if (val_count == 0)
+               return 0;
+
        return cdev->ops->write_fifo(cdev, addr_offset, val, val_count);
 }
 
index ca80dba..26e212b 100644 (file)
@@ -12,7 +12,7 @@
 #define TCAN4X5X_SPI_INSTRUCTION_WRITE (0x61 << 24)
 #define TCAN4X5X_SPI_INSTRUCTION_READ (0x41 << 24)
 
-#define TCAN4X5X_MAX_REGISTER 0x8ffc
+#define TCAN4X5X_MAX_REGISTER 0x87fc
 
 static int tcan4x5x_regmap_gather_write(void *context,
                                        const void *reg, size_t reg_len,
index 7b1457a..c0c9144 100644 (file)
@@ -36,6 +36,7 @@ config NET_DSA_LANTIQ_GSWIP
 config NET_DSA_MT7530
        tristate "MediaTek MT753x and MT7621 Ethernet switch support"
        select NET_DSA_TAG_MTK
+       select MEDIATEK_GE_PHY
        help
          This enables support for the MediaTek MT7530, MT7531, and MT7621
          Ethernet switch chips.
index 481f1df..8aec5d9 100644 (file)
@@ -2278,6 +2278,7 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        struct net_device *dev;
        struct typhoon *tp;
        int card_id = (int) ent->driver_data;
+       u8 addr[ETH_ALEN] __aligned(4);
        void __iomem *ioaddr;
        void *shared;
        dma_addr_t shared_dma;
@@ -2409,8 +2410,9 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
                goto error_out_reset;
        }
 
-       *(__be16 *)&dev->dev_addr[0] = htons(le16_to_cpu(xp_resp[0].parm1));
-       *(__be32 *)&dev->dev_addr[2] = htonl(le32_to_cpu(xp_resp[0].parm2));
+       *(__be16 *)&addr[0] = htons(le16_to_cpu(xp_resp[0].parm1));
+       *(__be32 *)&addr[2] = htonl(le32_to_cpu(xp_resp[0].parm2));
+       eth_hw_addr_set(dev, addr);
 
        if (!is_valid_ether_addr(dev->dev_addr)) {
                err_msg = "Could not obtain valid ethernet address, aborting";
index bd22a53..e7b8791 100644 (file)
@@ -655,6 +655,7 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
        struct ei_device *ei_local;
        struct net_device *dev;
        struct etherh_priv *eh;
+       u8 addr[ETH_ALEN];
        int ret;
 
        ret = ecard_request_resources(ec);
@@ -724,12 +725,13 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
        spin_lock_init(&ei_local->page_lock);
 
        if (ec->cid.product == PROD_ANT_ETHERM) {
-               etherm_addr(dev->dev_addr);
+               etherm_addr(addr);
                ei_local->reg_offset = etherm_regoffsets;
        } else {
-               etherh_addr(dev->dev_addr, ec);
+               etherh_addr(addr, ec);
                ei_local->reg_offset = etherh_regoffsets;
        }
+       eth_hw_addr_set(dev, addr);
 
        ei_local->name          = dev->name;
        ei_local->word16        = 1;
index 493b0ce..ec8df05 100644 (file)
@@ -1032,6 +1032,7 @@ static int dec_lance_probe(struct device *bdev, const int type)
        int i, ret;
        unsigned long esar_base;
        unsigned char *esar;
+       u8 addr[ETH_ALEN];
        const char *desc;
 
        if (dec_lance_debug && version_printed++ == 0)
@@ -1228,7 +1229,8 @@ static int dec_lance_probe(struct device *bdev, const int type)
                break;
        }
        for (i = 0; i < 6; i++)
-               dev->dev_addr[i] = esar[i * 4];
+               addr[i] = esar[i * 4];
+       eth_hw_addr_set(dev, addr);
 
        printk("%s: %s, addr = %pM, irq = %d\n",
               name, desc, dev->dev_addr, dev->irq);
index 492ac38..a359329 100644 (file)
@@ -721,7 +721,9 @@ static void xgbe_stop_timers(struct xgbe_prv_data *pdata)
                if (!channel->tx_ring)
                        break;
 
+               /* Deactivate the Tx timer */
                del_timer_sync(&channel->tx_timer);
+               channel->tx_timer_active = 0;
        }
 }
 
@@ -2550,6 +2552,14 @@ read_again:
                        buf2_len = xgbe_rx_buf2_len(rdata, packet, len);
                        len += buf2_len;
 
+                       if (buf2_len > rdata->rx.buf.dma_len) {
+                               /* Hardware inconsistency within the descriptors
+                                * that has resulted in a length underflow.
+                                */
+                               error = 1;
+                               goto skip_data;
+                       }
+
                        if (!skb) {
                                skb = xgbe_create_skb(pdata, napi, rdata,
                                                      buf1_len);
@@ -2579,8 +2589,10 @@ skip_data:
                if (!last || context_next)
                        goto read_again;
 
-               if (!skb)
+               if (!skb || error) {
+                       dev_kfree_skb(skb);
                        goto next_packet;
+               }
 
                /* Be sure we don't exceed the configured MTU */
                max_len = netdev->mtu + ETH_HLEN;
index 1bc4d33..30a573d 100644 (file)
@@ -826,7 +826,6 @@ int aq_filters_vlans_update(struct aq_nic_s *aq_nic)
        struct aq_hw_s *aq_hw = aq_nic->aq_hw;
        int hweight = 0;
        int err = 0;
-       int i;
 
        if (unlikely(!aq_hw_ops->hw_filter_vlan_set))
                return -EOPNOTSUPP;
@@ -837,8 +836,7 @@ int aq_filters_vlans_update(struct aq_nic_s *aq_nic)
                         aq_nic->aq_hw_rx_fltrs.fl2.aq_vlans);
 
        if (aq_nic->ndev->features & NETIF_F_HW_VLAN_CTAG_FILTER) {
-               for (i = 0; i < BITS_TO_LONGS(VLAN_N_VID); i++)
-                       hweight += hweight_long(aq_nic->active_vlans[i]);
+               hweight = bitmap_weight(aq_nic->active_vlans, VLAN_N_VID);
 
                err = aq_hw_ops->hw_filter_vlan_ctrl(aq_hw, false);
                if (err)
@@ -871,7 +869,7 @@ int aq_filters_vlan_offload_off(struct aq_nic_s *aq_nic)
        struct aq_hw_s *aq_hw = aq_nic->aq_hw;
        int err = 0;
 
-       memset(aq_nic->active_vlans, 0, sizeof(aq_nic->active_vlans));
+       bitmap_zero(aq_nic->active_vlans, VLAN_N_VID);
        aq_fvlan_rebuild(aq_nic, aq_nic->active_vlans,
                         aq_nic->aq_hw_rx_fltrs.fl2.aq_vlans);
 
index f38f40e..a1a3845 100644 (file)
@@ -2183,9 +2183,7 @@ static int sbmac_init(struct platform_device *pldev, long long base)
                ea_reg >>= 8;
        }
 
-       for (i = 0; i < 6; i++) {
-               dev->dev_addr[i] = eaddr[i];
-       }
+       eth_hw_addr_set(dev, eaddr);
 
        /*
         * Initialize context (get pointers to registers and stuff), then
index bbbde9f..be0bd4b 100644 (file)
@@ -99,13 +99,13 @@ static void mpc52xx_fec_tx_timeout(struct net_device *dev, unsigned int txqueue)
        netif_wake_queue(dev);
 }
 
-static void mpc52xx_fec_set_paddr(struct net_device *dev, u8 *mac)
+static void mpc52xx_fec_set_paddr(struct net_device *dev, const u8 *mac)
 {
        struct mpc52xx_fec_priv *priv = netdev_priv(dev);
        struct mpc52xx_fec __iomem *fec = priv->fec;
 
-       out_be32(&fec->paddr1, *(u32 *)(&mac[0]));
-       out_be32(&fec->paddr2, (*(u16 *)(&mac[4]) << 16) | FEC_PADDR2_TYPE);
+       out_be32(&fec->paddr1, *(const u32 *)(&mac[0]));
+       out_be32(&fec->paddr2, (*(const u16 *)(&mac[4]) << 16) | FEC_PADDR2_TYPE);
 }
 
 static int mpc52xx_fec_set_mac_address(struct net_device *dev, void *addr)
@@ -893,13 +893,15 @@ static int mpc52xx_fec_probe(struct platform_device *op)
        rv = of_get_ethdev_address(np, ndev);
        if (rv) {
                struct mpc52xx_fec __iomem *fec = priv->fec;
+               u8 addr[ETH_ALEN] __aligned(4);
 
                /*
                 * If the MAC addresse is not provided via DT then read
                 * it back from the controller regs
                 */
-               *(u32 *)(&ndev->dev_addr[0]) = in_be32(&fec->paddr1);
-               *(u16 *)(&ndev->dev_addr[4]) = in_be32(&fec->paddr2) >> 16;
+               *(u32 *)(&addr[0]) = in_be32(&fec->paddr1);
+               *(u16 *)(&addr[4]) = in_be32(&fec->paddr2) >> 16;
+               eth_hw_addr_set(ndev, addr);
        }
 
        /*
index 5f5d4f7..1607354 100644 (file)
@@ -843,7 +843,7 @@ static inline bool gve_is_gqi(struct gve_priv *priv)
 /* buffers */
 int gve_alloc_page(struct gve_priv *priv, struct device *dev,
                   struct page **page, dma_addr_t *dma,
-                  enum dma_data_direction);
+                  enum dma_data_direction, gfp_t gfp_flags);
 void gve_free_page(struct device *dev, struct page *page, dma_addr_t dma,
                   enum dma_data_direction);
 /* tx handling */
index 2ad7f57..f7621ab 100644 (file)
@@ -301,7 +301,7 @@ static int gve_adminq_parse_err(struct gve_priv *priv, u32 status)
  */
 static int gve_adminq_kick_and_wait(struct gve_priv *priv)
 {
-       u32 tail, head;
+       int tail, head;
        int i;
 
        tail = ioread32be(&priv->reg_bar0->adminq_event_counter);
index f7f65c4..54e51c8 100644 (file)
@@ -766,9 +766,9 @@ static void gve_free_rings(struct gve_priv *priv)
 
 int gve_alloc_page(struct gve_priv *priv, struct device *dev,
                   struct page **page, dma_addr_t *dma,
-                  enum dma_data_direction dir)
+                  enum dma_data_direction dir, gfp_t gfp_flags)
 {
-       *page = alloc_page(GFP_KERNEL);
+       *page = alloc_page(gfp_flags);
        if (!*page) {
                priv->page_alloc_fail++;
                return -ENOMEM;
@@ -811,7 +811,7 @@ static int gve_alloc_queue_page_list(struct gve_priv *priv, u32 id,
        for (i = 0; i < pages; i++) {
                err = gve_alloc_page(priv, &priv->pdev->dev, &qpl->pages[i],
                                     &qpl->page_buses[i],
-                                    gve_qpl_dma_dir(priv, id));
+                                    gve_qpl_dma_dir(priv, id), GFP_KERNEL);
                /* caller handles clean up */
                if (err)
                        return -ENOMEM;
index 9ddcc49..2068199 100644 (file)
@@ -86,7 +86,8 @@ static int gve_rx_alloc_buffer(struct gve_priv *priv, struct device *dev,
        dma_addr_t dma;
        int err;
 
-       err = gve_alloc_page(priv, dev, &page, &dma, DMA_FROM_DEVICE);
+       err = gve_alloc_page(priv, dev, &page, &dma, DMA_FROM_DEVICE,
+                            GFP_ATOMIC);
        if (err)
                return err;
 
index beb8bb0..8c93962 100644 (file)
@@ -157,7 +157,7 @@ static int gve_alloc_page_dqo(struct gve_priv *priv,
        int err;
 
        err = gve_alloc_page(priv, &priv->pdev->dev, &buf_state->page_info.page,
-                            &buf_state->addr, DMA_FROM_DEVICE);
+                            &buf_state->addr, DMA_FROM_DEVICE, GFP_KERNEL);
        if (err)
                return err;
 
index 7df8761..21442a9 100644 (file)
@@ -2043,8 +2043,7 @@ static irqreturn_t hclgevf_misc_irq_handle(int irq, void *data)
                break;
        }
 
-       if (event_cause != HCLGEVF_VECTOR0_EVENT_OTHER)
-               hclgevf_enable_vector(&hdev->misc_vector, true);
+       hclgevf_enable_vector(&hdev->misc_vector, true);
 
        return IRQ_HANDLED;
 }
index c612ef5..3e7d7c4 100644 (file)
@@ -986,6 +986,7 @@ static int
 ether1_probe(struct expansion_card *ec, const struct ecard_id *id)
 {
        struct net_device *dev;
+       u8 addr[ETH_ALEN];
        int i, ret = 0;
 
        ether1_banner();
@@ -1015,7 +1016,8 @@ ether1_probe(struct expansion_card *ec, const struct ecard_id *id)
        }
 
        for (i = 0; i < 6; i++)
-               dev->dev_addr[i] = readb(IDPROM_ADDRESS + (i << 2));
+               addr[i] = readb(IDPROM_ADDRESS + (i << 2));
+       eth_hw_addr_set(dev, addr);
 
        if (ether1_init_2(dev)) {
                ret = -ENODEV;
index 59536bd..bda7a2a 100644 (file)
@@ -2602,6 +2602,7 @@ static void __ibmvnic_reset(struct work_struct *work)
        struct ibmvnic_rwi *rwi;
        unsigned long flags;
        u32 reset_state;
+       int num_fails = 0;
        int rc = 0;
 
        adapter = container_of(work, struct ibmvnic_adapter, ibmvnic_reset);
@@ -2655,11 +2656,23 @@ static void __ibmvnic_reset(struct work_struct *work)
                                rc = do_hard_reset(adapter, rwi, reset_state);
                                rtnl_unlock();
                        }
-                       if (rc) {
-                               /* give backing device time to settle down */
+                       if (rc)
+                               num_fails++;
+                       else
+                               num_fails = 0;
+
+                       /* If auto-priority-failover is enabled we can get
+                        * back to back failovers during resets, resulting
+                        * in at least two failed resets (from high-priority
+                        * backing device to low-priority one and then back)
+                        * If resets continue to fail beyond that, give the
+                        * adapter some time to settle down before retrying.
+                        */
+                       if (num_fails >= 3) {
                                netdev_dbg(adapter->netdev,
-                                          "[S:%s] Hard reset failed, waiting 60 secs\n",
-                                          adapter_state_to_string(adapter->state));
+                                          "[S:%s] Hard reset failed %d times, waiting 60 secs\n",
+                                          adapter_state_to_string(adapter->state),
+                                          num_fails);
                                set_current_state(TASK_UNINTERRUPTIBLE);
                                schedule_timeout(60 * HZ);
                        }
@@ -3844,11 +3857,25 @@ static void send_request_cap(struct ibmvnic_adapter *adapter, int retry)
        struct device *dev = &adapter->vdev->dev;
        union ibmvnic_crq crq;
        int max_entries;
+       int cap_reqs;
+
+       /* We send out 6 or 7 REQUEST_CAPABILITY CRQs below (depending on
+        * the PROMISC flag). Initialize this count upfront. When the tasklet
+        * receives a response to all of these, it will send the next protocol
+        * message (QUERY_IP_OFFLOAD).
+        */
+       if (!(adapter->netdev->flags & IFF_PROMISC) ||
+           adapter->promisc_supported)
+               cap_reqs = 7;
+       else
+               cap_reqs = 6;
 
        if (!retry) {
                /* Sub-CRQ entries are 32 byte long */
                int entries_page = 4 * PAGE_SIZE / (sizeof(u64) * 4);
 
+               atomic_set(&adapter->running_cap_crqs, cap_reqs);
+
                if (adapter->min_tx_entries_per_subcrq > entries_page ||
                    adapter->min_rx_add_entries_per_subcrq > entries_page) {
                        dev_err(dev, "Fatal, invalid entries per sub-crq\n");
@@ -3909,44 +3936,45 @@ static void send_request_cap(struct ibmvnic_adapter *adapter, int retry)
                                        adapter->opt_rx_comp_queues;
 
                adapter->req_rx_add_queues = adapter->max_rx_add_queues;
+       } else {
+               atomic_add(cap_reqs, &adapter->running_cap_crqs);
        }
-
        memset(&crq, 0, sizeof(crq));
        crq.request_capability.first = IBMVNIC_CRQ_CMD;
        crq.request_capability.cmd = REQUEST_CAPABILITY;
 
        crq.request_capability.capability = cpu_to_be16(REQ_TX_QUEUES);
        crq.request_capability.number = cpu_to_be64(adapter->req_tx_queues);
-       atomic_inc(&adapter->running_cap_crqs);
+       cap_reqs--;
        ibmvnic_send_crq(adapter, &crq);
 
        crq.request_capability.capability = cpu_to_be16(REQ_RX_QUEUES);
        crq.request_capability.number = cpu_to_be64(adapter->req_rx_queues);
-       atomic_inc(&adapter->running_cap_crqs);
+       cap_reqs--;
        ibmvnic_send_crq(adapter, &crq);
 
        crq.request_capability.capability = cpu_to_be16(REQ_RX_ADD_QUEUES);
        crq.request_capability.number = cpu_to_be64(adapter->req_rx_add_queues);
-       atomic_inc(&adapter->running_cap_crqs);
+       cap_reqs--;
        ibmvnic_send_crq(adapter, &crq);
 
        crq.request_capability.capability =
            cpu_to_be16(REQ_TX_ENTRIES_PER_SUBCRQ);
        crq.request_capability.number =
            cpu_to_be64(adapter->req_tx_entries_per_subcrq);
-       atomic_inc(&adapter->running_cap_crqs);
+       cap_reqs--;
        ibmvnic_send_crq(adapter, &crq);
 
        crq.request_capability.capability =
            cpu_to_be16(REQ_RX_ADD_ENTRIES_PER_SUBCRQ);
        crq.request_capability.number =
            cpu_to_be64(adapter->req_rx_add_entries_per_subcrq);
-       atomic_inc(&adapter->running_cap_crqs);
+       cap_reqs--;
        ibmvnic_send_crq(adapter, &crq);
 
        crq.request_capability.capability = cpu_to_be16(REQ_MTU);
        crq.request_capability.number = cpu_to_be64(adapter->req_mtu);
-       atomic_inc(&adapter->running_cap_crqs);
+       cap_reqs--;
        ibmvnic_send_crq(adapter, &crq);
 
        if (adapter->netdev->flags & IFF_PROMISC) {
@@ -3954,16 +3982,21 @@ static void send_request_cap(struct ibmvnic_adapter *adapter, int retry)
                        crq.request_capability.capability =
                            cpu_to_be16(PROMISC_REQUESTED);
                        crq.request_capability.number = cpu_to_be64(1);
-                       atomic_inc(&adapter->running_cap_crqs);
+                       cap_reqs--;
                        ibmvnic_send_crq(adapter, &crq);
                }
        } else {
                crq.request_capability.capability =
                    cpu_to_be16(PROMISC_REQUESTED);
                crq.request_capability.number = cpu_to_be64(0);
-               atomic_inc(&adapter->running_cap_crqs);
+               cap_reqs--;
                ibmvnic_send_crq(adapter, &crq);
        }
+
+       /* Keep at end to catch any discrepancy between expected and actual
+        * CRQs sent.
+        */
+       WARN_ON(cap_reqs != 0);
 }
 
 static int pending_scrq(struct ibmvnic_adapter *adapter,
@@ -4357,118 +4390,132 @@ static void send_query_map(struct ibmvnic_adapter *adapter)
 static void send_query_cap(struct ibmvnic_adapter *adapter)
 {
        union ibmvnic_crq crq;
+       int cap_reqs;
+
+       /* We send out 25 QUERY_CAPABILITY CRQs below.  Initialize this count
+        * upfront. When the tasklet receives a response to all of these, it
+        * can send out the next protocol messaage (REQUEST_CAPABILITY).
+        */
+       cap_reqs = 25;
+
+       atomic_set(&adapter->running_cap_crqs, cap_reqs);
 
-       atomic_set(&adapter->running_cap_crqs, 0);
        memset(&crq, 0, sizeof(crq));
        crq.query_capability.first = IBMVNIC_CRQ_CMD;
        crq.query_capability.cmd = QUERY_CAPABILITY;
 
        crq.query_capability.capability = cpu_to_be16(MIN_TX_QUEUES);
-       atomic_inc(&adapter->running_cap_crqs);
        ibmvnic_send_crq(adapter, &crq);
+       cap_reqs--;
 
        crq.query_capability.capability = cpu_to_be16(MIN_RX_QUEUES);
-       atomic_inc(&adapter->running_cap_crqs);
        ibmvnic_send_crq(adapter, &crq);
+       cap_reqs--;
 
        crq.query_capability.capability = cpu_to_be16(MIN_RX_ADD_QUEUES);
-       atomic_inc(&adapter->running_cap_crqs);
        ibmvnic_send_crq(adapter, &crq);
+       cap_reqs--;
 
        crq.query_capability.capability = cpu_to_be16(MAX_TX_QUEUES);
-       atomic_inc(&adapter->running_cap_crqs);
        ibmvnic_send_crq(adapter, &crq);
+       cap_reqs--;
 
        crq.query_capability.capability = cpu_to_be16(MAX_RX_QUEUES);
-       atomic_inc(&adapter->running_cap_crqs);
        ibmvnic_send_crq(adapter, &crq);
+       cap_reqs--;
 
        crq.query_capability.capability = cpu_to_be16(MAX_RX_ADD_QUEUES);
-       atomic_inc(&adapter->running_cap_crqs);
        ibmvnic_send_crq(adapter, &crq);
+       cap_reqs--;
 
        crq.query_capability.capability =
            cpu_to_be16(MIN_TX_ENTRIES_PER_SUBCRQ);
-       atomic_inc(&adapter->running_cap_crqs);
        ibmvnic_send_crq(adapter, &crq);
+       cap_reqs--;
 
        crq.query_capability.capability =
            cpu_to_be16(MIN_RX_ADD_ENTRIES_PER_SUBCRQ);
-       atomic_inc(&adapter->running_cap_crqs);
        ibmvnic_send_crq(adapter, &crq);
+       cap_reqs--;
 
        crq.query_capability.capability =
            cpu_to_be16(MAX_TX_ENTRIES_PER_SUBCRQ);
-       atomic_inc(&adapter->running_cap_crqs);
        ibmvnic_send_crq(adapter, &crq);
+       cap_reqs--;
 
        crq.query_capability.capability =
            cpu_to_be16(MAX_RX_ADD_ENTRIES_PER_SUBCRQ);
-       atomic_inc(&adapter->running_cap_crqs);
        ibmvnic_send_crq(adapter, &crq);
+       cap_reqs--;
 
        crq.query_capability.capability = cpu_to_be16(TCP_IP_OFFLOAD);
-       atomic_inc(&adapter->running_cap_crqs);
        ibmvnic_send_crq(adapter, &crq);
+       cap_reqs--;
 
        crq.query_capability.capability = cpu_to_be16(PROMISC_SUPPORTED);
-       atomic_inc(&adapter->running_cap_crqs);
        ibmvnic_send_crq(adapter, &crq);
+       cap_reqs--;
 
        crq.query_capability.capability = cpu_to_be16(MIN_MTU);
-       atomic_inc(&adapter->running_cap_crqs);
        ibmvnic_send_crq(adapter, &crq);
+       cap_reqs--;
 
        crq.query_capability.capability = cpu_to_be16(MAX_MTU);
-       atomic_inc(&adapter->running_cap_crqs);
        ibmvnic_send_crq(adapter, &crq);
+       cap_reqs--;
 
        crq.query_capability.capability = cpu_to_be16(MAX_MULTICAST_FILTERS);
-       atomic_inc(&adapter->running_cap_crqs);
        ibmvnic_send_crq(adapter, &crq);
+       cap_reqs--;
 
        crq.query_capability.capability = cpu_to_be16(VLAN_HEADER_INSERTION);
-       atomic_inc(&adapter->running_cap_crqs);
        ibmvnic_send_crq(adapter, &crq);
+       cap_reqs--;
 
        crq.query_capability.capability = cpu_to_be16(RX_VLAN_HEADER_INSERTION);
-       atomic_inc(&adapter->running_cap_crqs);
        ibmvnic_send_crq(adapter, &crq);
+       cap_reqs--;
 
        crq.query_capability.capability = cpu_to_be16(MAX_TX_SG_ENTRIES);
-       atomic_inc(&adapter->running_cap_crqs);
        ibmvnic_send_crq(adapter, &crq);
+       cap_reqs--;
 
        crq.query_capability.capability = cpu_to_be16(RX_SG_SUPPORTED);
-       atomic_inc(&adapter->running_cap_crqs);
        ibmvnic_send_crq(adapter, &crq);
+       cap_reqs--;
 
        crq.query_capability.capability = cpu_to_be16(OPT_TX_COMP_SUB_QUEUES);
-       atomic_inc(&adapter->running_cap_crqs);
        ibmvnic_send_crq(adapter, &crq);
+       cap_reqs--;
 
        crq.query_capability.capability = cpu_to_be16(OPT_RX_COMP_QUEUES);
-       atomic_inc(&adapter->running_cap_crqs);
        ibmvnic_send_crq(adapter, &crq);
+       cap_reqs--;
 
        crq.query_capability.capability =
                        cpu_to_be16(OPT_RX_BUFADD_Q_PER_RX_COMP_Q);
-       atomic_inc(&adapter->running_cap_crqs);
        ibmvnic_send_crq(adapter, &crq);
+       cap_reqs--;
 
        crq.query_capability.capability =
                        cpu_to_be16(OPT_TX_ENTRIES_PER_SUBCRQ);
-       atomic_inc(&adapter->running_cap_crqs);
        ibmvnic_send_crq(adapter, &crq);
+       cap_reqs--;
 
        crq.query_capability.capability =
                        cpu_to_be16(OPT_RXBA_ENTRIES_PER_SUBCRQ);
-       atomic_inc(&adapter->running_cap_crqs);
        ibmvnic_send_crq(adapter, &crq);
+       cap_reqs--;
 
        crq.query_capability.capability = cpu_to_be16(TX_RX_DESC_REQ);
-       atomic_inc(&adapter->running_cap_crqs);
+
        ibmvnic_send_crq(adapter, &crq);
+       cap_reqs--;
+
+       /* Keep at end to catch any discrepancy between expected and actual
+        * CRQs sent.
+        */
+       WARN_ON(cap_reqs != 0);
 }
 
 static void send_query_ip_offload(struct ibmvnic_adapter *adapter)
@@ -4772,6 +4819,8 @@ static void handle_request_cap_rsp(union ibmvnic_crq *crq,
        char *name;
 
        atomic_dec(&adapter->running_cap_crqs);
+       netdev_dbg(adapter->netdev, "Outstanding request-caps: %d\n",
+                  atomic_read(&adapter->running_cap_crqs));
        switch (be16_to_cpu(crq->request_capability_rsp.capability)) {
        case REQ_TX_QUEUES:
                req_value = &adapter->req_tx_queues;
@@ -4835,10 +4884,8 @@ static void handle_request_cap_rsp(union ibmvnic_crq *crq,
        }
 
        /* Done receiving requested capabilities, query IP offload support */
-       if (atomic_read(&adapter->running_cap_crqs) == 0) {
-               adapter->wait_capability = false;
+       if (atomic_read(&adapter->running_cap_crqs) == 0)
                send_query_ip_offload(adapter);
-       }
 }
 
 static int handle_login_rsp(union ibmvnic_crq *login_rsp_crq,
@@ -5136,10 +5183,8 @@ static void handle_query_cap_rsp(union ibmvnic_crq *crq,
        }
 
 out:
-       if (atomic_read(&adapter->running_cap_crqs) == 0) {
-               adapter->wait_capability = false;
+       if (atomic_read(&adapter->running_cap_crqs) == 0)
                send_request_cap(adapter, 0);
-       }
 }
 
 static int send_query_phys_parms(struct ibmvnic_adapter *adapter)
@@ -5435,33 +5480,21 @@ static void ibmvnic_tasklet(struct tasklet_struct *t)
        struct ibmvnic_crq_queue *queue = &adapter->crq;
        union ibmvnic_crq *crq;
        unsigned long flags;
-       bool done = false;
 
        spin_lock_irqsave(&queue->lock, flags);
-       while (!done) {
-               /* Pull all the valid messages off the CRQ */
-               while ((crq = ibmvnic_next_crq(adapter)) != NULL) {
-                       /* This barrier makes sure ibmvnic_next_crq()'s
-                        * crq->generic.first & IBMVNIC_CRQ_CMD_RSP is loaded
-                        * before ibmvnic_handle_crq()'s
-                        * switch(gen_crq->first) and switch(gen_crq->cmd).
-                        */
-                       dma_rmb();
-                       ibmvnic_handle_crq(crq, adapter);
-                       crq->generic.first = 0;
-               }
 
-               /* remain in tasklet until all
-                * capabilities responses are received
+       /* Pull all the valid messages off the CRQ */
+       while ((crq = ibmvnic_next_crq(adapter)) != NULL) {
+               /* This barrier makes sure ibmvnic_next_crq()'s
+                * crq->generic.first & IBMVNIC_CRQ_CMD_RSP is loaded
+                * before ibmvnic_handle_crq()'s
+                * switch(gen_crq->first) and switch(gen_crq->cmd).
                 */
-               if (!adapter->wait_capability)
-                       done = true;
+               dma_rmb();
+               ibmvnic_handle_crq(crq, adapter);
+               crq->generic.first = 0;
        }
-       /* if capabilities CRQ's were sent in this tasklet, the following
-        * tasklet must wait until all responses are received
-        */
-       if (atomic_read(&adapter->running_cap_crqs) != 0)
-               adapter->wait_capability = true;
+
        spin_unlock_irqrestore(&queue->lock, flags);
 }
 
index 4a8f36e..4a7a56f 100644 (file)
@@ -919,7 +919,6 @@ struct ibmvnic_adapter {
        int login_rsp_buf_sz;
 
        atomic_t running_cap_crqs;
-       bool wait_capability;
 
        struct ibmvnic_sub_crq_queue **tx_scrq ____cacheline_aligned;
        struct ibmvnic_sub_crq_queue **rx_scrq ____cacheline_aligned;
index c3def0e..8d06c9d 100644 (file)
@@ -115,7 +115,8 @@ enum e1000_boards {
        board_pch_lpt,
        board_pch_spt,
        board_pch_cnp,
-       board_pch_tgp
+       board_pch_tgp,
+       board_pch_adp
 };
 
 struct e1000_ps_page {
@@ -502,6 +503,7 @@ extern const struct e1000_info e1000_pch_lpt_info;
 extern const struct e1000_info e1000_pch_spt_info;
 extern const struct e1000_info e1000_pch_cnp_info;
 extern const struct e1000_info e1000_pch_tgp_info;
+extern const struct e1000_info e1000_pch_adp_info;
 extern const struct e1000_info e1000_es2_info;
 
 void e1000e_ptp_init(struct e1000_adapter *adapter);
index 5e4fc9b..c908c84 100644 (file)
@@ -6021,3 +6021,23 @@ const struct e1000_info e1000_pch_tgp_info = {
        .phy_ops                = &ich8_phy_ops,
        .nvm_ops                = &spt_nvm_ops,
 };
+
+const struct e1000_info e1000_pch_adp_info = {
+       .mac                    = e1000_pch_adp,
+       .flags                  = FLAG_IS_ICH
+                                 | FLAG_HAS_WOL
+                                 | FLAG_HAS_HW_TIMESTAMP
+                                 | FLAG_HAS_CTRLEXT_ON_LOAD
+                                 | FLAG_HAS_AMT
+                                 | FLAG_HAS_FLASH
+                                 | FLAG_HAS_JUMBO_FRAMES
+                                 | FLAG_APME_IN_WUC,
+       .flags2                 = FLAG2_HAS_PHY_STATS
+                                 | FLAG2_HAS_EEE,
+       .pba                    = 26,
+       .max_hw_frame_size      = 9022,
+       .get_variants           = e1000_get_variants_ich8lan,
+       .mac_ops                = &ich8_mac_ops,
+       .phy_ops                = &ich8_phy_ops,
+       .nvm_ops                = &spt_nvm_ops,
+};
index 635a959..a42aeb5 100644 (file)
@@ -52,6 +52,7 @@ static const struct e1000_info *e1000_info_tbl[] = {
        [board_pch_spt]         = &e1000_pch_spt_info,
        [board_pch_cnp]         = &e1000_pch_cnp_info,
        [board_pch_tgp]         = &e1000_pch_tgp_info,
+       [board_pch_adp]         = &e1000_pch_adp_info,
 };
 
 struct e1000_reg_info {
@@ -6341,7 +6342,8 @@ static void e1000e_s0ix_entry_flow(struct e1000_adapter *adapter)
        u32 mac_data;
        u16 phy_data;
 
-       if (er32(FWSM) & E1000_ICH_FWSM_FW_VALID) {
+       if (er32(FWSM) & E1000_ICH_FWSM_FW_VALID &&
+           hw->mac.type >= e1000_pch_adp) {
                /* Request ME configure the device for S0ix */
                mac_data = er32(H2ME);
                mac_data |= E1000_H2ME_START_DPG;
@@ -6490,7 +6492,8 @@ static void e1000e_s0ix_exit_flow(struct e1000_adapter *adapter)
        u16 phy_data;
        u32 i = 0;
 
-       if (er32(FWSM) & E1000_ICH_FWSM_FW_VALID) {
+       if (er32(FWSM) & E1000_ICH_FWSM_FW_VALID &&
+           hw->mac.type >= e1000_pch_adp) {
                /* Request ME unconfigure the device from S0ix */
                mac_data = er32(H2ME);
                mac_data &= ~E1000_H2ME_START_DPG;
@@ -7898,22 +7901,22 @@ static const struct pci_device_id e1000_pci_tbl[] = {
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_V14), board_pch_tgp },
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_LM15), board_pch_tgp },
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_V15), board_pch_tgp },
-       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_LM23), board_pch_tgp },
-       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_V23), board_pch_tgp },
-       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_LM16), board_pch_tgp },
-       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_V16), board_pch_tgp },
-       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_LM17), board_pch_tgp },
-       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_V17), board_pch_tgp },
-       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_LM22), board_pch_tgp },
-       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_V22), board_pch_tgp },
-       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_LM18), board_pch_tgp },
-       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_V18), board_pch_tgp },
-       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_LM19), board_pch_tgp },
-       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_V19), board_pch_tgp },
-       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_LM20), board_pch_tgp },
-       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_V20), board_pch_tgp },
-       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_LM21), board_pch_tgp },
-       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_V21), board_pch_tgp },
+       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_LM23), board_pch_adp },
+       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_V23), board_pch_adp },
+       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_LM16), board_pch_adp },
+       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_V16), board_pch_adp },
+       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_LM17), board_pch_adp },
+       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_V17), board_pch_adp },
+       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_LM22), board_pch_adp },
+       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_V22), board_pch_adp },
+       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_LM18), board_pch_adp },
+       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_V18), board_pch_adp },
+       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_LM19), board_pch_adp },
+       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_V19), board_pch_adp },
+       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_LM20), board_pch_adp },
+       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_V20), board_pch_adp },
+       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_LM21), board_pch_adp },
+       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_V21), board_pch_adp },
 
        { 0, 0, 0, 0, 0, 0, 0 } /* terminate list */
 };
index 4d939af..80c5cec 100644 (file)
@@ -144,6 +144,7 @@ enum i40e_state_t {
        __I40E_VIRTCHNL_OP_PENDING,
        __I40E_RECOVERY_MODE,
        __I40E_VF_RESETS_DISABLED,      /* disable resets during i40e_remove */
+       __I40E_IN_REMOVE,
        __I40E_VFS_RELEASING,
        /* This must be last as it determines the size of the BITMAP */
        __I40E_STATE_SIZE__,
@@ -174,7 +175,6 @@ enum i40e_interrupt_policy {
 
 struct i40e_lump_tracking {
        u16 num_entries;
-       u16 search_hint;
        u16 list[0];
 #define I40E_PILE_VALID_BIT  0x8000
 #define I40E_IWARP_IRQ_PILE_ID  (I40E_PILE_VALID_BIT - 2)
@@ -848,12 +848,12 @@ struct i40e_vsi {
        struct rtnl_link_stats64 net_stats_offsets;
        struct i40e_eth_stats eth_stats;
        struct i40e_eth_stats eth_stats_offsets;
-       u32 tx_restart;
-       u32 tx_busy;
+       u64 tx_restart;
+       u64 tx_busy;
        u64 tx_linearize;
        u64 tx_force_wb;
-       u32 rx_buf_failed;
-       u32 rx_page_failed;
+       u64 rx_buf_failed;
+       u64 rx_page_failed;
 
        /* These are containers of ring pointers, allocated at run-time */
        struct i40e_ring **rx_rings;
index 2c1b1da..1e57cc8 100644 (file)
@@ -240,7 +240,7 @@ static void i40e_dbg_dump_vsi_seid(struct i40e_pf *pf, int seid)
                 (unsigned long int)vsi->net_stats_offsets.rx_compressed,
                 (unsigned long int)vsi->net_stats_offsets.tx_compressed);
        dev_info(&pf->pdev->dev,
-                "    tx_restart = %d, tx_busy = %d, rx_buf_failed = %d, rx_page_failed = %d\n",
+                "    tx_restart = %llu, tx_busy = %llu, rx_buf_failed = %llu, rx_page_failed = %llu\n",
                 vsi->tx_restart, vsi->tx_busy,
                 vsi->rx_buf_failed, vsi->rx_page_failed);
        rcu_read_lock();
index 2a3d8ae..0c4b7df 100644 (file)
@@ -196,10 +196,6 @@ int i40e_free_virt_mem_d(struct i40e_hw *hw, struct i40e_virt_mem *mem)
  * @id: an owner id to stick on the items assigned
  *
  * Returns the base item index of the lump, or negative for error
- *
- * The search_hint trick and lack of advanced fit-finding only work
- * because we're highly likely to have all the same size lump requests.
- * Linear search time and any fragmentation should be minimal.
  **/
 static int i40e_get_lump(struct i40e_pf *pf, struct i40e_lump_tracking *pile,
                         u16 needed, u16 id)
@@ -214,8 +210,21 @@ static int i40e_get_lump(struct i40e_pf *pf, struct i40e_lump_tracking *pile,
                return -EINVAL;
        }
 
-       /* start the linear search with an imperfect hint */
-       i = pile->search_hint;
+       /* Allocate last queue in the pile for FDIR VSI queue
+        * so it doesn't fragment the qp_pile
+        */
+       if (pile == pf->qp_pile && pf->vsi[id]->type == I40E_VSI_FDIR) {
+               if (pile->list[pile->num_entries - 1] & I40E_PILE_VALID_BIT) {
+                       dev_err(&pf->pdev->dev,
+                               "Cannot allocate queue %d for I40E_VSI_FDIR\n",
+                               pile->num_entries - 1);
+                       return -ENOMEM;
+               }
+               pile->list[pile->num_entries - 1] = id | I40E_PILE_VALID_BIT;
+               return pile->num_entries - 1;
+       }
+
+       i = 0;
        while (i < pile->num_entries) {
                /* skip already allocated entries */
                if (pile->list[i] & I40E_PILE_VALID_BIT) {
@@ -234,7 +243,6 @@ static int i40e_get_lump(struct i40e_pf *pf, struct i40e_lump_tracking *pile,
                        for (j = 0; j < needed; j++)
                                pile->list[i+j] = id | I40E_PILE_VALID_BIT;
                        ret = i;
-                       pile->search_hint = i + j;
                        break;
                }
 
@@ -257,7 +265,7 @@ static int i40e_put_lump(struct i40e_lump_tracking *pile, u16 index, u16 id)
 {
        int valid_id = (id | I40E_PILE_VALID_BIT);
        int count = 0;
-       int i;
+       u16 i;
 
        if (!pile || index >= pile->num_entries)
                return -EINVAL;
@@ -269,8 +277,6 @@ static int i40e_put_lump(struct i40e_lump_tracking *pile, u16 index, u16 id)
                count++;
        }
 
-       if (count && index < pile->search_hint)
-               pile->search_hint = index;
 
        return count;
 }
@@ -772,9 +778,9 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi)
        struct rtnl_link_stats64 *ns;   /* netdev stats */
        struct i40e_eth_stats *oes;
        struct i40e_eth_stats *es;     /* device's eth stats */
-       u32 tx_restart, tx_busy;
+       u64 tx_restart, tx_busy;
        struct i40e_ring *p;
-       u32 rx_page, rx_buf;
+       u64 rx_page, rx_buf;
        u64 bytes, packets;
        unsigned int start;
        u64 tx_linearize;
@@ -5366,7 +5372,15 @@ static int i40e_vsi_configure_bw_alloc(struct i40e_vsi *vsi, u8 enabled_tc,
        /* There is no need to reset BW when mqprio mode is on.  */
        if (pf->flags & I40E_FLAG_TC_MQPRIO)
                return 0;
-       if (!vsi->mqprio_qopt.qopt.hw && !(pf->flags & I40E_FLAG_DCB_ENABLED)) {
+
+       if (!vsi->mqprio_qopt.qopt.hw) {
+               if (pf->flags & I40E_FLAG_DCB_ENABLED)
+                       goto skip_reset;
+
+               if (IS_ENABLED(CONFIG_I40E_DCB) &&
+                   i40e_dcb_hw_get_num_tc(&pf->hw) == 1)
+                       goto skip_reset;
+
                ret = i40e_set_bw_limit(vsi, vsi->seid, 0);
                if (ret)
                        dev_info(&pf->pdev->dev,
@@ -5374,6 +5388,8 @@ static int i40e_vsi_configure_bw_alloc(struct i40e_vsi *vsi, u8 enabled_tc,
                                 vsi->seid);
                return ret;
        }
+
+skip_reset:
        memset(&bw_data, 0, sizeof(bw_data));
        bw_data.tc_valid_bits = enabled_tc;
        for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++)
@@ -10574,15 +10590,9 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
        }
        i40e_get_oem_version(&pf->hw);
 
-       if (test_bit(__I40E_EMP_RESET_INTR_RECEIVED, pf->state) &&
-           ((hw->aq.fw_maj_ver == 4 && hw->aq.fw_min_ver <= 33) ||
-            hw->aq.fw_maj_ver < 4) && hw->mac.type == I40E_MAC_XL710) {
-               /* The following delay is necessary for 4.33 firmware and older
-                * to recover after EMP reset. 200 ms should suffice but we
-                * put here 300 ms to be sure that FW is ready to operate
-                * after reset.
-                */
-               mdelay(300);
+       if (test_and_clear_bit(__I40E_EMP_RESET_INTR_RECEIVED, pf->state)) {
+               /* The following delay is necessary for firmware update. */
+               mdelay(1000);
        }
 
        /* re-verify the eeprom if we just had an EMP reset */
@@ -10853,6 +10863,9 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit,
                                   bool lock_acquired)
 {
        int ret;
+
+       if (test_bit(__I40E_IN_REMOVE, pf->state))
+               return;
        /* Now we wait for GRST to settle out.
         * We don't have to delete the VEBs or VSIs from the hw switch
         * because the reset will make them disappear.
@@ -11792,7 +11805,6 @@ static int i40e_init_interrupt_scheme(struct i40e_pf *pf)
                return -ENOMEM;
 
        pf->irq_pile->num_entries = vectors;
-       pf->irq_pile->search_hint = 0;
 
        /* track first vector for misc interrupts, ignore return */
        (void)i40e_get_lump(pf, pf->irq_pile, 1, I40E_PILE_VALID_BIT - 1);
@@ -12213,6 +12225,8 @@ int i40e_reconfig_rss_queues(struct i40e_pf *pf, int queue_count)
 
                vsi->req_queue_pairs = queue_count;
                i40e_prep_for_reset(pf);
+               if (test_bit(__I40E_IN_REMOVE, pf->state))
+                       return pf->alloc_rss_size;
 
                pf->alloc_rss_size = new_rss_size;
 
@@ -12595,7 +12609,6 @@ static int i40e_sw_init(struct i40e_pf *pf)
                goto sw_init_done;
        }
        pf->qp_pile->num_entries = pf->hw.func_caps.num_tx_qp;
-       pf->qp_pile->search_hint = 0;
 
        pf->tx_timeout_recovery_level = 1;
 
@@ -13040,6 +13053,10 @@ static int i40e_xdp_setup(struct i40e_vsi *vsi, struct bpf_prog *prog,
        if (need_reset)
                i40e_prep_for_reset(pf);
 
+       /* VSI shall be deleted in a moment, just return EINVAL */
+       if (test_bit(__I40E_IN_REMOVE, pf->state))
+               return -EINVAL;
+
        old_prog = xchg(&vsi->xdp_prog, prog);
 
        if (need_reset) {
@@ -15930,8 +15947,13 @@ static void i40e_remove(struct pci_dev *pdev)
        i40e_write_rx_ctl(hw, I40E_PFQF_HENA(0), 0);
        i40e_write_rx_ctl(hw, I40E_PFQF_HENA(1), 0);
 
-       while (test_bit(__I40E_RESET_RECOVERY_PENDING, pf->state))
+       /* Grab __I40E_RESET_RECOVERY_PENDING and set __I40E_IN_REMOVE
+        * flags, once they are set, i40e_rebuild should not be called as
+        * i40e_prep_for_reset always returns early.
+        */
+       while (test_and_set_bit(__I40E_RESET_RECOVERY_PENDING, pf->state))
                usleep_range(1000, 2000);
+       set_bit(__I40E_IN_REMOVE, pf->state);
 
        if (pf->flags & I40E_FLAG_SRIOV_ENABLED) {
                set_bit(__I40E_VF_RESETS_DISABLED, pf->state);
@@ -16130,6 +16152,9 @@ static void i40e_pci_error_reset_done(struct pci_dev *pdev)
 {
        struct i40e_pf *pf = pci_get_drvdata(pdev);
 
+       if (test_bit(__I40E_IN_REMOVE, pf->state))
+               return;
+
        i40e_reset_and_rebuild(pf, false, false);
 }
 
index 8d0588a..1908eed 100644 (file)
 #define I40E_VFINT_DYN_CTLN(_INTVF) (0x00024800 + ((_INTVF) * 4)) /* _i=0...511 */ /* Reset: VFR */
 #define I40E_VFINT_DYN_CTLN_CLEARPBA_SHIFT 1
 #define I40E_VFINT_DYN_CTLN_CLEARPBA_MASK I40E_MASK(0x1, I40E_VFINT_DYN_CTLN_CLEARPBA_SHIFT)
+#define I40E_VFINT_ICR0_ADMINQ_SHIFT 30
+#define I40E_VFINT_ICR0_ADMINQ_MASK I40E_MASK(0x1, I40E_VFINT_ICR0_ADMINQ_SHIFT)
+#define I40E_VFINT_ICR0_ENA(_VF) (0x0002C000 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: CORER */
 #define I40E_VPINT_AEQCTL(_VF) (0x0002B800 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: CORER */
 #define I40E_VPINT_AEQCTL_MSIX_INDX_SHIFT 0
 #define I40E_VPINT_AEQCTL_ITR_INDX_SHIFT 11
index b785d09..dfdb6e7 100644 (file)
@@ -1377,6 +1377,32 @@ static i40e_status i40e_config_vf_promiscuous_mode(struct i40e_vf *vf,
 }
 
 /**
+ * i40e_sync_vfr_reset
+ * @hw: pointer to hw struct
+ * @vf_id: VF identifier
+ *
+ * Before trigger hardware reset, we need to know if no other process has
+ * reserved the hardware for any reset operations. This check is done by
+ * examining the status of the RSTAT1 register used to signal the reset.
+ **/
+static int i40e_sync_vfr_reset(struct i40e_hw *hw, int vf_id)
+{
+       u32 reg;
+       int i;
+
+       for (i = 0; i < I40E_VFR_WAIT_COUNT; i++) {
+               reg = rd32(hw, I40E_VFINT_ICR0_ENA(vf_id)) &
+                          I40E_VFINT_ICR0_ADMINQ_MASK;
+               if (reg)
+                       return 0;
+
+               usleep_range(100, 200);
+       }
+
+       return -EAGAIN;
+}
+
+/**
  * i40e_trigger_vf_reset
  * @vf: pointer to the VF structure
  * @flr: VFLR was issued or not
@@ -1390,9 +1416,11 @@ static void i40e_trigger_vf_reset(struct i40e_vf *vf, bool flr)
        struct i40e_pf *pf = vf->pf;
        struct i40e_hw *hw = &pf->hw;
        u32 reg, reg_idx, bit_idx;
+       bool vf_active;
+       u32 radq;
 
        /* warn the VF */
-       clear_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states);
+       vf_active = test_and_clear_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states);
 
        /* Disable VF's configuration API during reset. The flag is re-enabled
         * in i40e_alloc_vf_res(), when it's safe again to access VF's VSI.
@@ -1406,7 +1434,19 @@ static void i40e_trigger_vf_reset(struct i40e_vf *vf, bool flr)
         * just need to clean up, so don't hit the VFRTRIG register.
         */
        if (!flr) {
-               /* reset VF using VPGEN_VFRTRIG reg */
+               /* Sync VFR reset before trigger next one */
+               radq = rd32(hw, I40E_VFINT_ICR0_ENA(vf->vf_id)) &
+                           I40E_VFINT_ICR0_ADMINQ_MASK;
+               if (vf_active && !radq)
+                       /* waiting for finish reset by virtual driver */
+                       if (i40e_sync_vfr_reset(hw, vf->vf_id))
+                               dev_info(&pf->pdev->dev,
+                                        "Reset VF %d never finished\n",
+                               vf->vf_id);
+
+               /* Reset VF using VPGEN_VFRTRIG reg. It is also setting
+                * in progress state in rstat1 register.
+                */
                reg = rd32(hw, I40E_VPGEN_VFRTRIG(vf->vf_id));
                reg |= I40E_VPGEN_VFRTRIG_VFSWR_MASK;
                wr32(hw, I40E_VPGEN_VFRTRIG(vf->vf_id), reg);
@@ -2618,6 +2658,59 @@ error_param:
 }
 
 /**
+ * i40e_check_enough_queue - find big enough queue number
+ * @vf: pointer to the VF info
+ * @needed: the number of items needed
+ *
+ * Returns the base item index of the queue, or negative for error
+ **/
+static int i40e_check_enough_queue(struct i40e_vf *vf, u16 needed)
+{
+       unsigned int  i, cur_queues, more, pool_size;
+       struct i40e_lump_tracking *pile;
+       struct i40e_pf *pf = vf->pf;
+       struct i40e_vsi *vsi;
+
+       vsi = pf->vsi[vf->lan_vsi_idx];
+       cur_queues = vsi->alloc_queue_pairs;
+
+       /* if current allocated queues are enough for need */
+       if (cur_queues >= needed)
+               return vsi->base_queue;
+
+       pile = pf->qp_pile;
+       if (cur_queues > 0) {
+               /* if the allocated queues are not zero
+                * just check if there are enough queues for more
+                * behind the allocated queues.
+                */
+               more = needed - cur_queues;
+               for (i = vsi->base_queue + cur_queues;
+                       i < pile->num_entries; i++) {
+                       if (pile->list[i] & I40E_PILE_VALID_BIT)
+                               break;
+
+                       if (more-- == 1)
+                               /* there is enough */
+                               return vsi->base_queue;
+               }
+       }
+
+       pool_size = 0;
+       for (i = 0; i < pile->num_entries; i++) {
+               if (pile->list[i] & I40E_PILE_VALID_BIT) {
+                       pool_size = 0;
+                       continue;
+               }
+               if (needed <= ++pool_size)
+                       /* there is enough */
+                       return i;
+       }
+
+       return -ENOMEM;
+}
+
+/**
  * i40e_vc_request_queues_msg
  * @vf: pointer to the VF info
  * @msg: pointer to the msg buffer
@@ -2651,6 +2744,12 @@ static int i40e_vc_request_queues_msg(struct i40e_vf *vf, u8 *msg)
                         req_pairs - cur_pairs,
                         pf->queues_left);
                vfres->num_queue_pairs = pf->queues_left + cur_pairs;
+       } else if (i40e_check_enough_queue(vf, req_pairs) < 0) {
+               dev_warn(&pf->pdev->dev,
+                        "VF %d requested %d more queues, but there is not enough for it.\n",
+                        vf->vf_id,
+                        req_pairs - cur_pairs);
+               vfres->num_queue_pairs = cur_pairs;
        } else {
                /* successful request */
                vf->num_req_queues = req_pairs;
index 49575a6..03c42fd 100644 (file)
@@ -19,6 +19,7 @@
 #define I40E_MAX_VF_PROMISC_FLAGS      3
 
 #define I40E_VF_STATE_WAIT_COUNT       20
+#define I40E_VFR_WAIT_COUNT            100
 
 /* Various queue ctrls */
 enum i40e_queue_ctrl {
index 186d00a..3631d61 100644 (file)
@@ -1570,6 +1570,8 @@ static struct mac_ops     cgx_mac_ops    = {
        .mac_enadis_pause_frm =         cgx_lmac_enadis_pause_frm,
        .mac_pause_frm_config =         cgx_lmac_pause_frm_config,
        .mac_enadis_ptp_config =        cgx_lmac_ptp_config,
+       .mac_rx_tx_enable =             cgx_lmac_rx_tx_enable,
+       .mac_tx_enable =                cgx_lmac_tx_enable,
 };
 
 static int cgx_probe(struct pci_dev *pdev, const struct pci_device_id *id)
index fc6e742..b33e7d1 100644 (file)
@@ -107,6 +107,9 @@ struct mac_ops {
        void                    (*mac_enadis_ptp_config)(void  *cgxd,
                                                         int lmac_id,
                                                         bool enable);
+
+       int                     (*mac_rx_tx_enable)(void *cgxd, int lmac_id, bool enable);
+       int                     (*mac_tx_enable)(void *cgxd, int lmac_id, bool enable);
 };
 
 struct cgx {
index 4e79e91..58e2aee 100644 (file)
@@ -732,6 +732,7 @@ enum nix_af_status {
        NIX_AF_ERR_BANDPROF_INVAL_REQ  = -428,
        NIX_AF_ERR_CQ_CTX_WRITE_ERR  = -429,
        NIX_AF_ERR_AQ_CTX_RETRY_WRITE  = -430,
+       NIX_AF_ERR_LINK_CREDITS  = -431,
 };
 
 /* For NIX RX vtag action  */
index 0fe7ad3..4180376 100644 (file)
@@ -185,7 +185,6 @@ enum npc_kpu_parser_state {
        NPC_S_KPU2_QINQ,
        NPC_S_KPU2_ETAG,
        NPC_S_KPU2_EXDSA,
-       NPC_S_KPU2_NGIO,
        NPC_S_KPU2_CPT_CTAG,
        NPC_S_KPU2_CPT_QINQ,
        NPC_S_KPU3_CTAG,
@@ -212,6 +211,7 @@ enum npc_kpu_parser_state {
        NPC_S_KPU5_NSH,
        NPC_S_KPU5_CPT_IP,
        NPC_S_KPU5_CPT_IP6,
+       NPC_S_KPU5_NGIO,
        NPC_S_KPU6_IP6_EXT,
        NPC_S_KPU6_IP6_HOP_DEST,
        NPC_S_KPU6_IP6_ROUT,
@@ -1124,15 +1124,6 @@ static struct npc_kpu_profile_cam kpu1_cam_entries[] = {
                NPC_S_KPU1_ETHER, 0xff,
                NPC_ETYPE_CTAG,
                0xffff,
-               NPC_ETYPE_NGIO,
-               0xffff,
-               0x0000,
-               0x0000,
-       },
-       {
-               NPC_S_KPU1_ETHER, 0xff,
-               NPC_ETYPE_CTAG,
-               0xffff,
                NPC_ETYPE_CTAG,
                0xffff,
                0x0000,
@@ -1968,6 +1959,15 @@ static struct npc_kpu_profile_cam kpu2_cam_entries[] = {
        },
        {
                NPC_S_KPU2_CTAG, 0xff,
+               NPC_ETYPE_NGIO,
+               0xffff,
+               0x0000,
+               0x0000,
+               0x0000,
+               0x0000,
+       },
+       {
+               NPC_S_KPU2_CTAG, 0xff,
                NPC_ETYPE_PPPOE,
                0xffff,
                0x0000,
@@ -2750,15 +2750,6 @@ static struct npc_kpu_profile_cam kpu2_cam_entries[] = {
                0x0000,
        },
        {
-               NPC_S_KPU2_NGIO, 0xff,
-               0x0000,
-               0x0000,
-               0x0000,
-               0x0000,
-               0x0000,
-               0x0000,
-       },
-       {
                NPC_S_KPU2_CPT_CTAG, 0xff,
                NPC_ETYPE_IP,
                0xffff,
@@ -5090,6 +5081,15 @@ static struct npc_kpu_profile_cam kpu5_cam_entries[] = {
                0x0000,
        },
        {
+               NPC_S_KPU5_NGIO, 0xff,
+               0x0000,
+               0x0000,
+               0x0000,
+               0x0000,
+               0x0000,
+               0x0000,
+       },
+       {
                NPC_S_NA, 0X00,
                0x0000,
                0x0000,
@@ -8425,14 +8425,6 @@ static struct npc_kpu_profile_action kpu1_action_entries[] = {
        {
                NPC_ERRLEV_RE, NPC_EC_NOERR,
                8, 12, 0, 0, 0,
-               NPC_S_KPU2_NGIO, 12, 1,
-               NPC_LID_LA, NPC_LT_LA_ETHER,
-               0,
-               0, 0, 0, 0,
-       },
-       {
-               NPC_ERRLEV_RE, NPC_EC_NOERR,
-               8, 12, 0, 0, 0,
                NPC_S_KPU2_CTAG2, 12, 1,
                NPC_LID_LA, NPC_LT_LA_ETHER,
                NPC_F_LA_U_HAS_TAG | NPC_F_LA_L_WITH_VLAN,
@@ -9196,6 +9188,14 @@ static struct npc_kpu_profile_action kpu2_action_entries[] = {
        },
        {
                NPC_ERRLEV_RE, NPC_EC_NOERR,
+               0, 0, 0, 2, 0,
+               NPC_S_KPU5_NGIO, 6, 1,
+               NPC_LID_LB, NPC_LT_LB_CTAG,
+               0,
+               0, 0, 0, 0,
+       },
+       {
+               NPC_ERRLEV_RE, NPC_EC_NOERR,
                8, 0, 6, 2, 0,
                NPC_S_KPU5_IP, 14, 1,
                NPC_LID_LB, NPC_LT_LB_PPPOE,
@@ -9892,14 +9892,6 @@ static struct npc_kpu_profile_action kpu2_action_entries[] = {
        },
        {
                NPC_ERRLEV_RE, NPC_EC_NOERR,
-               0, 0, 0, 0, 1,
-               NPC_S_NA, 0, 1,
-               NPC_LID_LC, NPC_LT_LC_NGIO,
-               0,
-               0, 0, 0, 0,
-       },
-       {
-               NPC_ERRLEV_RE, NPC_EC_NOERR,
                8, 0, 6, 2, 0,
                NPC_S_KPU5_CPT_IP, 6, 1,
                NPC_LID_LB, NPC_LT_LB_CTAG,
@@ -11974,6 +11966,14 @@ static struct npc_kpu_profile_action kpu5_action_entries[] = {
                0, 0, 0, 0,
        },
        {
+               NPC_ERRLEV_RE, NPC_EC_NOERR,
+               0, 0, 0, 0, 1,
+               NPC_S_NA, 0, 1,
+               NPC_LID_LC, NPC_LT_LC_NGIO,
+               0,
+               0, 0, 0, 0,
+       },
+       {
                NPC_ERRLEV_LC, NPC_EC_UNK,
                0, 0, 0, 0, 1,
                NPC_S_NA, 0, 0,
index e695fa0..9ea2f6a 100644 (file)
@@ -30,6 +30,8 @@ static struct mac_ops rpm_mac_ops   = {
        .mac_enadis_pause_frm =         rpm_lmac_enadis_pause_frm,
        .mac_pause_frm_config =         rpm_lmac_pause_frm_config,
        .mac_enadis_ptp_config =        rpm_lmac_ptp_config,
+       .mac_rx_tx_enable =             rpm_lmac_rx_tx_enable,
+       .mac_tx_enable =                rpm_lmac_tx_enable,
 };
 
 struct mac_ops *rpm_get_mac_ops(void)
@@ -54,6 +56,43 @@ int rpm_get_nr_lmacs(void *rpmd)
        return hweight8(rpm_read(rpm, 0, CGXX_CMRX_RX_LMACS) & 0xFULL);
 }
 
+int rpm_lmac_tx_enable(void *rpmd, int lmac_id, bool enable)
+{
+       rpm_t *rpm = rpmd;
+       u64 cfg, last;
+
+       if (!is_lmac_valid(rpm, lmac_id))
+               return -ENODEV;
+
+       cfg = rpm_read(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG);
+       last = cfg;
+       if (enable)
+               cfg |= RPM_TX_EN;
+       else
+               cfg &= ~(RPM_TX_EN);
+
+       if (cfg != last)
+               rpm_write(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG, cfg);
+       return !!(last & RPM_TX_EN);
+}
+
+int rpm_lmac_rx_tx_enable(void *rpmd, int lmac_id, bool enable)
+{
+       rpm_t *rpm = rpmd;
+       u64 cfg;
+
+       if (!is_lmac_valid(rpm, lmac_id))
+               return -ENODEV;
+
+       cfg = rpm_read(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG);
+       if (enable)
+               cfg |= RPM_RX_EN | RPM_TX_EN;
+       else
+               cfg &= ~(RPM_RX_EN | RPM_TX_EN);
+       rpm_write(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG, cfg);
+       return 0;
+}
+
 void rpm_lmac_enadis_rx_pause_fwding(void *rpmd, int lmac_id, bool enable)
 {
        rpm_t *rpm = rpmd;
@@ -252,23 +291,20 @@ int rpm_lmac_internal_loopback(void *rpmd, int lmac_id, bool enable)
        if (!rpm || lmac_id >= rpm->lmac_count)
                return -ENODEV;
        lmac_type = rpm->mac_ops->get_lmac_type(rpm, lmac_id);
-       if (lmac_type == LMAC_MODE_100G_R) {
-               cfg = rpm_read(rpm, lmac_id, RPMX_MTI_PCS100X_CONTROL1);
-
-               if (enable)
-                       cfg |= RPMX_MTI_PCS_LBK;
-               else
-                       cfg &= ~RPMX_MTI_PCS_LBK;
-               rpm_write(rpm, lmac_id, RPMX_MTI_PCS100X_CONTROL1, cfg);
-       } else {
-               cfg = rpm_read(rpm, lmac_id, RPMX_MTI_LPCSX_CONTROL1);
-               if (enable)
-                       cfg |= RPMX_MTI_PCS_LBK;
-               else
-                       cfg &= ~RPMX_MTI_PCS_LBK;
-               rpm_write(rpm, lmac_id, RPMX_MTI_LPCSX_CONTROL1, cfg);
+
+       if (lmac_type == LMAC_MODE_QSGMII || lmac_type == LMAC_MODE_SGMII) {
+               dev_err(&rpm->pdev->dev, "loopback not supported for LPC mode\n");
+               return 0;
        }
 
+       cfg = rpm_read(rpm, lmac_id, RPMX_MTI_PCS100X_CONTROL1);
+
+       if (enable)
+               cfg |= RPMX_MTI_PCS_LBK;
+       else
+               cfg &= ~RPMX_MTI_PCS_LBK;
+       rpm_write(rpm, lmac_id, RPMX_MTI_PCS100X_CONTROL1, cfg);
+
        return 0;
 }
 
index 57c8a68..ff58031 100644 (file)
@@ -43,6 +43,8 @@
 #define RPMX_MTI_STAT_DATA_HI_CDC            0x10038
 
 #define RPM_LMAC_FWI                   0xa
+#define RPM_TX_EN                      BIT_ULL(0)
+#define RPM_RX_EN                      BIT_ULL(1)
 
 /* Function Declarations */
 int rpm_get_nr_lmacs(void *rpmd);
@@ -57,4 +59,6 @@ int rpm_lmac_enadis_pause_frm(void *rpmd, int lmac_id, u8 tx_pause,
 int rpm_get_tx_stats(void *rpmd, int lmac_id, int idx, u64 *tx_stat);
 int rpm_get_rx_stats(void *rpmd, int lmac_id, int idx, u64 *rx_stat);
 void rpm_lmac_ptp_config(void *rpmd, int lmac_id, bool enable);
+int rpm_lmac_rx_tx_enable(void *rpmd, int lmac_id, bool enable);
+int rpm_lmac_tx_enable(void *rpmd, int lmac_id, bool enable);
 #endif /* RPM_H */
index 3ca6b94..54e1b27 100644 (file)
@@ -520,8 +520,11 @@ static void rvu_block_reset(struct rvu *rvu, int blkaddr, u64 rst_reg)
 
        rvu_write64(rvu, blkaddr, rst_reg, BIT_ULL(0));
        err = rvu_poll_reg(rvu, blkaddr, rst_reg, BIT_ULL(63), true);
-       if (err)
-               dev_err(rvu->dev, "HW block:%d reset failed\n", blkaddr);
+       if (err) {
+               dev_err(rvu->dev, "HW block:%d reset timeout retrying again\n", blkaddr);
+               while (rvu_poll_reg(rvu, blkaddr, rst_reg, BIT_ULL(63), true) == -EBUSY)
+                       ;
+       }
 }
 
 static void rvu_reset_all_blocks(struct rvu *rvu)
index 66e45d7..5ed94cf 100644 (file)
@@ -806,6 +806,7 @@ bool is_mac_feature_supported(struct rvu *rvu, int pf, int feature);
 u32  rvu_cgx_get_fifolen(struct rvu *rvu);
 void *rvu_first_cgx_pdata(struct rvu *rvu);
 int cgxlmac_to_pf(struct rvu *rvu, int cgx_id, int lmac_id);
+int rvu_cgx_config_tx(void *cgxd, int lmac_id, bool enable);
 
 int npc_get_nixlf_mcam_index(struct npc_mcam *mcam, u16 pcifunc, int nixlf,
                             int type);
index 2ca182a..8a7ac5a 100644 (file)
@@ -441,16 +441,26 @@ void rvu_cgx_enadis_rx_bp(struct rvu *rvu, int pf, bool enable)
 int rvu_cgx_config_rxtx(struct rvu *rvu, u16 pcifunc, bool start)
 {
        int pf = rvu_get_pf(pcifunc);
+       struct mac_ops *mac_ops;
        u8 cgx_id, lmac_id;
+       void *cgxd;
 
        if (!is_cgx_config_permitted(rvu, pcifunc))
                return LMAC_AF_ERR_PERM_DENIED;
 
        rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);
+       cgxd = rvu_cgx_pdata(cgx_id, rvu);
+       mac_ops = get_mac_ops(cgxd);
+
+       return mac_ops->mac_rx_tx_enable(cgxd, lmac_id, start);
+}
 
-       cgx_lmac_rx_tx_enable(rvu_cgx_pdata(cgx_id, rvu), lmac_id, start);
+int rvu_cgx_config_tx(void *cgxd, int lmac_id, bool enable)
+{
+       struct mac_ops *mac_ops;
 
-       return 0;
+       mac_ops = get_mac_ops(cgxd);
+       return mac_ops->mac_tx_enable(cgxd, lmac_id, enable);
 }
 
 void rvu_cgx_disable_dmac_entries(struct rvu *rvu, u16 pcifunc)
index a09a507..d1eddb7 100644 (file)
@@ -1224,6 +1224,8 @@ static void print_nix_cn10k_sq_ctx(struct seq_file *m,
        seq_printf(m, "W3: head_offset\t\t\t%d\nW3: smenq_next_sqb_vld\t\t%d\n\n",
                   sq_ctx->head_offset, sq_ctx->smenq_next_sqb_vld);
 
+       seq_printf(m, "W3: smq_next_sq_vld\t\t%d\nW3: smq_pend\t\t\t%d\n",
+                  sq_ctx->smq_next_sq_vld, sq_ctx->smq_pend);
        seq_printf(m, "W4: next_sqb \t\t\t%llx\n\n", sq_ctx->next_sqb);
        seq_printf(m, "W5: tail_sqb \t\t\t%llx\n\n", sq_ctx->tail_sqb);
        seq_printf(m, "W6: smenq_sqb \t\t\t%llx\n\n", sq_ctx->smenq_sqb);
index d8b1948..97fb619 100644 (file)
@@ -512,11 +512,11 @@ static int rvu_nix_get_bpid(struct rvu *rvu, struct nix_bp_cfg_req *req,
        cfg = rvu_read64(rvu, blkaddr, NIX_AF_CONST);
        lmac_chan_cnt = cfg & 0xFF;
 
-       cfg = rvu_read64(rvu, blkaddr, NIX_AF_CONST1);
-       sdp_chan_cnt = cfg & 0xFFF;
-
        cgx_bpid_cnt = hw->cgx_links * lmac_chan_cnt;
        lbk_bpid_cnt = hw->lbk_links * ((cfg >> 16) & 0xFF);
+
+       cfg = rvu_read64(rvu, blkaddr, NIX_AF_CONST1);
+       sdp_chan_cnt = cfg & 0xFFF;
        sdp_bpid_cnt = hw->sdp_links * sdp_chan_cnt;
 
        pfvf = rvu_get_pfvf(rvu, req->hdr.pcifunc);
@@ -2068,8 +2068,8 @@ static int nix_smq_flush(struct rvu *rvu, int blkaddr,
        /* enable cgx tx if disabled */
        if (is_pf_cgxmapped(rvu, pf)) {
                rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);
-               restore_tx_en = !cgx_lmac_tx_enable(rvu_cgx_pdata(cgx_id, rvu),
-                                                   lmac_id, true);
+               restore_tx_en = !rvu_cgx_config_tx(rvu_cgx_pdata(cgx_id, rvu),
+                                                  lmac_id, true);
        }
 
        cfg = rvu_read64(rvu, blkaddr, NIX_AF_SMQX_CFG(smq));
@@ -2092,7 +2092,7 @@ static int nix_smq_flush(struct rvu *rvu, int blkaddr,
        rvu_cgx_enadis_rx_bp(rvu, pf, true);
        /* restore cgx tx state */
        if (restore_tx_en)
-               cgx_lmac_tx_enable(rvu_cgx_pdata(cgx_id, rvu), lmac_id, false);
+               rvu_cgx_config_tx(rvu_cgx_pdata(cgx_id, rvu), lmac_id, false);
        return err;
 }
 
@@ -3878,7 +3878,7 @@ nix_config_link_credits(struct rvu *rvu, int blkaddr, int link,
        /* Enable cgx tx if disabled for credits to be back */
        if (is_pf_cgxmapped(rvu, pf)) {
                rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);
-               restore_tx_en = !cgx_lmac_tx_enable(rvu_cgx_pdata(cgx_id, rvu),
+               restore_tx_en = !rvu_cgx_config_tx(rvu_cgx_pdata(cgx_id, rvu),
                                                    lmac_id, true);
        }
 
@@ -3891,8 +3891,8 @@ nix_config_link_credits(struct rvu *rvu, int blkaddr, int link,
                            NIX_AF_TL1X_SW_XOFF(schq), BIT_ULL(0));
        }
 
-       rc = -EBUSY;
-       poll_tmo = jiffies + usecs_to_jiffies(10000);
+       rc = NIX_AF_ERR_LINK_CREDITS;
+       poll_tmo = jiffies + usecs_to_jiffies(200000);
        /* Wait for credits to return */
        do {
                if (time_after(jiffies, poll_tmo))
@@ -3918,7 +3918,7 @@ exit:
 
        /* Restore state of cgx tx */
        if (restore_tx_en)
-               cgx_lmac_tx_enable(rvu_cgx_pdata(cgx_id, rvu), lmac_id, false);
+               rvu_cgx_config_tx(rvu_cgx_pdata(cgx_id, rvu), lmac_id, false);
 
        mutex_unlock(&rvu->rsrc_lock);
        return rc;
index c0005a1..91f86d7 100644 (file)
@@ -402,6 +402,7 @@ static void npc_fixup_vf_rule(struct rvu *rvu, struct npc_mcam *mcam,
                              int blkaddr, int index, struct mcam_entry *entry,
                              bool *enable)
 {
+       struct rvu_npc_mcam_rule *rule;
        u16 owner, target_func;
        struct rvu_pfvf *pfvf;
        u64 rx_action;
@@ -423,6 +424,12 @@ static void npc_fixup_vf_rule(struct rvu *rvu, struct npc_mcam *mcam,
              test_bit(NIXLF_INITIALIZED, &pfvf->flags)))
                *enable = false;
 
+       /* fix up not needed for the rules added by user(ntuple filters) */
+       list_for_each_entry(rule, &mcam->mcam_rules, list) {
+               if (rule->entry == index)
+                       return;
+       }
+
        /* copy VF default entry action to the VF mcam entry */
        rx_action = npc_get_default_entry_action(rvu, mcam, blkaddr,
                                                 target_func);
@@ -489,8 +496,8 @@ static void npc_config_mcam_entry(struct rvu *rvu, struct npc_mcam *mcam,
        }
 
        /* PF installing VF rule */
-       if (intf == NIX_INTF_RX && actindex < mcam->bmap_entries)
-               npc_fixup_vf_rule(rvu, mcam, blkaddr, index, entry, &enable);
+       if (is_npc_intf_rx(intf) && actindex < mcam->bmap_entries)
+               npc_fixup_vf_rule(rvu, mcam, blkaddr, actindex, entry, &enable);
 
        /* Set 'action' */
        rvu_write64(rvu, blkaddr,
@@ -916,7 +923,8 @@ static void npc_update_vf_flow_entry(struct rvu *rvu, struct npc_mcam *mcam,
                                     int blkaddr, u16 pcifunc, u64 rx_action)
 {
        int actindex, index, bank, entry;
-       bool enable;
+       struct rvu_npc_mcam_rule *rule;
+       bool enable, update;
 
        if (!(pcifunc & RVU_PFVF_FUNC_MASK))
                return;
@@ -924,6 +932,14 @@ static void npc_update_vf_flow_entry(struct rvu *rvu, struct npc_mcam *mcam,
        mutex_lock(&mcam->lock);
        for (index = 0; index < mcam->bmap_entries; index++) {
                if (mcam->entry2target_pffunc[index] == pcifunc) {
+                       update = true;
+                       /* update not needed for the rules added via ntuple filters */
+                       list_for_each_entry(rule, &mcam->mcam_rules, list) {
+                               if (rule->entry == index)
+                                       update = false;
+                       }
+                       if (!update)
+                               continue;
                        bank = npc_get_bank(mcam, index);
                        actindex = index;
                        entry = index & (mcam->banksize - 1);
index ff2b219..19c53e5 100644 (file)
@@ -1098,14 +1098,6 @@ find_rule:
                write_req.cntr = rule->cntr;
        }
 
-       err = rvu_mbox_handler_npc_mcam_write_entry(rvu, &write_req,
-                                                   &write_rsp);
-       if (err) {
-               rvu_mcam_remove_counter_from_rule(rvu, owner, rule);
-               if (new)
-                       kfree(rule);
-               return err;
-       }
        /* update rule */
        memcpy(&rule->packet, &dummy.packet, sizeof(rule->packet));
        memcpy(&rule->mask, &dummy.mask, sizeof(rule->mask));
@@ -1132,6 +1124,18 @@ find_rule:
        if (req->default_rule)
                pfvf->def_ucast_rule = rule;
 
+       /* write to mcam entry registers */
+       err = rvu_mbox_handler_npc_mcam_write_entry(rvu, &write_req,
+                                                   &write_rsp);
+       if (err) {
+               rvu_mcam_remove_counter_from_rule(rvu, owner, rule);
+               if (new) {
+                       list_del(&rule->list);
+                       kfree(rule);
+               }
+               return err;
+       }
+
        /* VF's MAC address is being changed via PF  */
        if (pf_set_vfs_mac) {
                ether_addr_copy(pfvf->default_mac, req->packet.dmac);
index 61e5281..14509fc 100644 (file)
@@ -603,6 +603,7 @@ static inline void __cn10k_aura_freeptr(struct otx2_nic *pfvf, u64 aura,
                        size++;
                tar_addr |=  ((size - 1) & 0x7) << 4;
        }
+       dma_wmb();
        memcpy((u64 *)lmt_info->lmt_addr, ptrs, sizeof(u64) * num_ptrs);
        /* Perform LMTST flush */
        cn10k_lmt_flush(val, tar_addr);
index 6080ebd..d39341e 100644 (file)
@@ -394,7 +394,12 @@ static int otx2_forward_vf_mbox_msgs(struct otx2_nic *pf,
                dst_mdev->msg_size = mbox_hdr->msg_size;
                dst_mdev->num_msgs = num_msgs;
                err = otx2_sync_mbox_msg(dst_mbox);
-               if (err) {
+               /* Error code -EIO indicate there is a communication failure
+                * to the AF. Rest of the error codes indicate that AF processed
+                * VF messages and set the error codes in response messages
+                * (if any) so simply forward responses to VF.
+                */
+               if (err == -EIO) {
                        dev_warn(pf->dev,
                                 "AF not responding to VF%d messages\n", vf);
                        /* restore PF mbase and exit */
index 812e681..c14e06c 100644 (file)
@@ -224,7 +224,7 @@ static inline int mlx5e_get_max_num_channels(struct mlx5_core_dev *mdev)
 struct mlx5e_tx_wqe {
        struct mlx5_wqe_ctrl_seg ctrl;
        struct mlx5_wqe_eth_seg  eth;
-       struct mlx5_wqe_data_seg data[0];
+       struct mlx5_wqe_data_seg data[];
 };
 
 struct mlx5e_rx_wqe_ll {
@@ -241,8 +241,8 @@ struct mlx5e_umr_wqe {
        struct mlx5_wqe_umr_ctrl_seg   uctrl;
        struct mlx5_mkey_seg           mkc;
        union {
-               struct mlx5_mtt inline_mtts[0];
-               struct mlx5_klm inline_klms[0];
+               DECLARE_FLEX_ARRAY(struct mlx5_mtt, inline_mtts);
+               DECLARE_FLEX_ARRAY(struct mlx5_klm, inline_klms);
        };
 };
 
index 00449df..c1e0749 100644 (file)
@@ -570,7 +570,8 @@ static int mlx5e_htb_convert_rate(struct mlx5e_priv *priv, u64 rate,
 
 static void mlx5e_htb_convert_ceil(struct mlx5e_priv *priv, u64 ceil, u32 *max_average_bw)
 {
-       *max_average_bw = div_u64(ceil, BYTES_IN_MBIT);
+       /* Hardware treats 0 as "unlimited", set at least 1. */
+       *max_average_bw = max_t(u32, div_u64(ceil, BYTES_IN_MBIT), 1);
 
        qos_dbg(priv->mdev, "Convert: ceil %llu -> max_average_bw %u\n",
                ceil, *max_average_bw);
index 9c076aa..b6f5c1b 100644 (file)
@@ -183,18 +183,7 @@ void mlx5e_rep_bond_unslave(struct mlx5_eswitch *esw,
 
 static bool mlx5e_rep_is_lag_netdev(struct net_device *netdev)
 {
-       struct mlx5e_rep_priv *rpriv;
-       struct mlx5e_priv *priv;
-
-       /* A given netdev is not a representor or not a slave of LAG configuration */
-       if (!mlx5e_eswitch_rep(netdev) || !netif_is_lag_port(netdev))
-               return false;
-
-       priv = netdev_priv(netdev);
-       rpriv = priv->ppriv;
-
-       /* Egress acl forward to vport is supported only non-uplink representor */
-       return rpriv->rep->vport != MLX5_VPORT_UPLINK;
+       return netif_is_lag_port(netdev) && mlx5e_eswitch_vf_rep(netdev);
 }
 
 static void mlx5e_rep_changelowerstate_event(struct net_device *netdev, void *ptr)
@@ -210,9 +199,6 @@ static void mlx5e_rep_changelowerstate_event(struct net_device *netdev, void *pt
        u16 fwd_vport_num;
        int err;
 
-       if (!mlx5e_rep_is_lag_netdev(netdev))
-               return;
-
        info = ptr;
        lag_info = info->lower_state_info;
        /* This is not an event of a representor becoming active slave */
@@ -266,9 +252,6 @@ static void mlx5e_rep_changeupper_event(struct net_device *netdev, void *ptr)
        struct net_device *lag_dev;
        struct mlx5e_priv *priv;
 
-       if (!mlx5e_rep_is_lag_netdev(netdev))
-               return;
-
        priv = netdev_priv(netdev);
        rpriv = priv->ppriv;
        lag_dev = info->upper_dev;
@@ -293,6 +276,19 @@ static int mlx5e_rep_esw_bond_netevent(struct notifier_block *nb,
                                       unsigned long event, void *ptr)
 {
        struct net_device *netdev = netdev_notifier_info_to_dev(ptr);
+       struct mlx5e_rep_priv *rpriv;
+       struct mlx5e_rep_bond *bond;
+       struct mlx5e_priv *priv;
+
+       if (!mlx5e_rep_is_lag_netdev(netdev))
+               return NOTIFY_DONE;
+
+       bond = container_of(nb, struct mlx5e_rep_bond, nb);
+       priv = netdev_priv(netdev);
+       rpriv = mlx5_eswitch_get_uplink_priv(priv->mdev->priv.eswitch, REP_ETH);
+       /* Verify VF representor is on the same device of the bond handling the netevent. */
+       if (rpriv->uplink_priv.bond != bond)
+               return NOTIFY_DONE;
 
        switch (event) {
        case NETDEV_CHANGELOWERSTATE:
index c6d2f8c..48dc121 100644 (file)
@@ -491,7 +491,7 @@ void mlx5e_rep_bridge_init(struct mlx5e_priv *priv)
        }
 
        br_offloads->netdev_nb.notifier_call = mlx5_esw_bridge_switchdev_port_event;
-       err = register_netdevice_notifier(&br_offloads->netdev_nb);
+       err = register_netdevice_notifier_net(&init_net, &br_offloads->netdev_nb);
        if (err) {
                esw_warn(mdev, "Failed to register bridge offloads netdevice notifier (err=%d)\n",
                         err);
@@ -509,7 +509,9 @@ err_register_swdev_blk:
 err_register_swdev:
        destroy_workqueue(br_offloads->wq);
 err_alloc_wq:
+       rtnl_lock();
        mlx5_esw_bridge_cleanup(esw);
+       rtnl_unlock();
 }
 
 void mlx5e_rep_bridge_cleanup(struct mlx5e_priv *priv)
@@ -524,7 +526,7 @@ void mlx5e_rep_bridge_cleanup(struct mlx5e_priv *priv)
                return;
 
        cancel_delayed_work_sync(&br_offloads->update_work);
-       unregister_netdevice_notifier(&br_offloads->netdev_nb);
+       unregister_netdevice_notifier_net(&init_net, &br_offloads->netdev_nb);
        unregister_switchdev_blocking_notifier(&br_offloads->nb_blk);
        unregister_switchdev_notifier(&br_offloads->nb);
        destroy_workqueue(br_offloads->wq);
index 4cdf8e5..b789af0 100644 (file)
@@ -167,6 +167,11 @@ static inline u16 mlx5e_txqsq_get_next_pi(struct mlx5e_txqsq *sq, u16 size)
        return pi;
 }
 
+static inline u16 mlx5e_shampo_get_cqe_header_index(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe)
+{
+       return be16_to_cpu(cqe->shampo.header_entry_index) & (rq->mpwqe.shampo->hd_per_wq - 1);
+}
+
 struct mlx5e_shampo_umr {
        u16 len;
 };
index 338d65e..56e10c8 100644 (file)
@@ -341,8 +341,10 @@ mlx5e_xmit_xdp_frame(struct mlx5e_xdpsq *sq, struct mlx5e_xmit_data *xdptxd,
 
        /* copy the inline part if required */
        if (sq->min_inline_mode != MLX5_INLINE_MODE_NONE) {
-               memcpy(eseg->inline_hdr.start, xdptxd->data, MLX5E_XDP_MIN_INLINE);
+               memcpy(eseg->inline_hdr.start, xdptxd->data, sizeof(eseg->inline_hdr.start));
                eseg->inline_hdr.sz = cpu_to_be16(MLX5E_XDP_MIN_INLINE);
+               memcpy(dseg, xdptxd->data + sizeof(eseg->inline_hdr.start),
+                      MLX5E_XDP_MIN_INLINE - sizeof(eseg->inline_hdr.start));
                dma_len  -= MLX5E_XDP_MIN_INLINE;
                dma_addr += MLX5E_XDP_MIN_INLINE;
                dseg++;
index 2db9573..b56fea1 100644 (file)
@@ -157,11 +157,20 @@ static void mlx5e_ipsec_set_swp(struct sk_buff *skb,
        /* Tunnel mode */
        if (mode == XFRM_MODE_TUNNEL) {
                eseg->swp_inner_l3_offset = skb_inner_network_offset(skb) / 2;
-               eseg->swp_inner_l4_offset = skb_inner_transport_offset(skb) / 2;
                if (xo->proto == IPPROTO_IPV6)
                        eseg->swp_flags |= MLX5_ETH_WQE_SWP_INNER_L3_IPV6;
-               if (inner_ip_hdr(skb)->protocol == IPPROTO_UDP)
+
+               switch (xo->inner_ipproto) {
+               case IPPROTO_UDP:
                        eseg->swp_flags |= MLX5_ETH_WQE_SWP_INNER_L4_UDP;
+                       fallthrough;
+               case IPPROTO_TCP:
+                       /* IP | ESP | IP | [TCP | UDP] */
+                       eseg->swp_inner_l4_offset = skb_inner_transport_offset(skb) / 2;
+                       break;
+               default:
+                       break;
+               }
                return;
        }
 
index b98db50..428881e 100644 (file)
@@ -131,14 +131,17 @@ static inline bool
 mlx5e_ipsec_txwqe_build_eseg_csum(struct mlx5e_txqsq *sq, struct sk_buff *skb,
                                  struct mlx5_wqe_eth_seg *eseg)
 {
-       struct xfrm_offload *xo = xfrm_offload(skb);
+       u8 inner_ipproto;
 
        if (!mlx5e_ipsec_eseg_meta(eseg))
                return false;
 
        eseg->cs_flags = MLX5_ETH_WQE_L3_CSUM;
-       if (xo->inner_ipproto) {
-               eseg->cs_flags |= MLX5_ETH_WQE_L4_INNER_CSUM | MLX5_ETH_WQE_L3_INNER_CSUM;
+       inner_ipproto = xfrm_offload(skb)->inner_ipproto;
+       if (inner_ipproto) {
+               eseg->cs_flags |= MLX5_ETH_WQE_L3_INNER_CSUM;
+               if (inner_ipproto == IPPROTO_TCP || inner_ipproto == IPPROTO_UDP)
+                       eseg->cs_flags |= MLX5_ETH_WQE_L4_INNER_CSUM;
        } else if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
                eseg->cs_flags |= MLX5_ETH_WQE_L4_CSUM;
                sq->stats->csum_partial_inner++;
index e86ccc2..ee0a8f5 100644 (file)
@@ -1117,7 +1117,7 @@ static void mlx5e_shampo_update_ipv6_udp_hdr(struct mlx5e_rq *rq, struct ipv6hdr
 static void mlx5e_shampo_update_fin_psh_flags(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe,
                                              struct tcphdr *skb_tcp_hd)
 {
-       u16 header_index = be16_to_cpu(cqe->shampo.header_entry_index);
+       u16 header_index = mlx5e_shampo_get_cqe_header_index(rq, cqe);
        struct tcphdr *last_tcp_hd;
        void *last_hd_addr;
 
@@ -1871,7 +1871,7 @@ mlx5e_skb_from_cqe_mpwrq_linear(struct mlx5e_rq *rq, struct mlx5e_mpw_info *wi,
        return skb;
 }
 
-static void
+static struct sk_buff *
 mlx5e_skb_from_cqe_shampo(struct mlx5e_rq *rq, struct mlx5e_mpw_info *wi,
                          struct mlx5_cqe64 *cqe, u16 header_index)
 {
@@ -1895,7 +1895,7 @@ mlx5e_skb_from_cqe_shampo(struct mlx5e_rq *rq, struct mlx5e_mpw_info *wi,
                skb = mlx5e_build_linear_skb(rq, hdr, frag_size, rx_headroom, head_size);
 
                if (unlikely(!skb))
-                       return;
+                       return NULL;
 
                /* queue up for recycling/reuse */
                page_ref_inc(head->page);
@@ -1907,7 +1907,7 @@ mlx5e_skb_from_cqe_shampo(struct mlx5e_rq *rq, struct mlx5e_mpw_info *wi,
                                     ALIGN(head_size, sizeof(long)));
                if (unlikely(!skb)) {
                        rq->stats->buff_alloc_err++;
-                       return;
+                       return NULL;
                }
 
                prefetchw(skb->data);
@@ -1918,9 +1918,7 @@ mlx5e_skb_from_cqe_shampo(struct mlx5e_rq *rq, struct mlx5e_mpw_info *wi,
                skb->tail += head_size;
                skb->len  += head_size;
        }
-       rq->hw_gro_data->skb = skb;
-       NAPI_GRO_CB(skb)->count = 1;
-       skb_shinfo(skb)->gso_size = mpwrq_get_cqe_byte_cnt(cqe) - head_size;
+       return skb;
 }
 
 static void
@@ -1973,13 +1971,14 @@ mlx5e_free_rx_shampo_hd_entry(struct mlx5e_rq *rq, u16 header_index)
 static void mlx5e_handle_rx_cqe_mpwrq_shampo(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe)
 {
        u16 data_bcnt           = mpwrq_get_cqe_byte_cnt(cqe) - cqe->shampo.header_size;
-       u16 header_index        = be16_to_cpu(cqe->shampo.header_entry_index);
+       u16 header_index        = mlx5e_shampo_get_cqe_header_index(rq, cqe);
        u32 wqe_offset          = be32_to_cpu(cqe->shampo.data_offset);
        u16 cstrides            = mpwrq_get_cqe_consumed_strides(cqe);
        u32 data_offset         = wqe_offset & (PAGE_SIZE - 1);
        u32 cqe_bcnt            = mpwrq_get_cqe_byte_cnt(cqe);
        u16 wqe_id              = be16_to_cpu(cqe->wqe_id);
        u32 page_idx            = wqe_offset >> PAGE_SHIFT;
+       u16 head_size           = cqe->shampo.header_size;
        struct sk_buff **skb    = &rq->hw_gro_data->skb;
        bool flush              = cqe->shampo.flush;
        bool match              = cqe->shampo.match;
@@ -2011,9 +2010,16 @@ static void mlx5e_handle_rx_cqe_mpwrq_shampo(struct mlx5e_rq *rq, struct mlx5_cq
        }
 
        if (!*skb) {
-               mlx5e_skb_from_cqe_shampo(rq, wi, cqe, header_index);
+               if (likely(head_size))
+                       *skb = mlx5e_skb_from_cqe_shampo(rq, wi, cqe, header_index);
+               else
+                       *skb = mlx5e_skb_from_cqe_mpwrq_nonlinear(rq, wi, cqe_bcnt, data_offset,
+                                                                 page_idx);
                if (unlikely(!*skb))
                        goto free_hd_entry;
+
+               NAPI_GRO_CB(*skb)->count = 1;
+               skb_shinfo(*skb)->gso_size = cqe_bcnt - head_size;
        } else {
                NAPI_GRO_CB(*skb)->count++;
                if (NAPI_GRO_CB(*skb)->count == 2 &&
@@ -2027,8 +2033,10 @@ static void mlx5e_handle_rx_cqe_mpwrq_shampo(struct mlx5e_rq *rq, struct mlx5_cq
                }
        }
 
-       di = &wi->umr.dma_info[page_idx];
-       mlx5e_fill_skb_data(*skb, rq, di, data_bcnt, data_offset);
+       if (likely(head_size)) {
+               di = &wi->umr.dma_info[page_idx];
+               mlx5e_fill_skb_data(*skb, rq, di, data_bcnt, data_offset);
+       }
 
        mlx5e_shampo_complete_rx_cqe(rq, cqe, cqe_bcnt, *skb);
        if (flush)
index 3d908a7..2022fa4 100644 (file)
@@ -1414,7 +1414,8 @@ mlx5e_tc_add_fdb_flow(struct mlx5e_priv *priv,
                if (err)
                        goto err_out;
 
-               if (!attr->chain && esw_attr->int_port) {
+               if (!attr->chain && esw_attr->int_port &&
+                   attr->action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) {
                        /* If decap route device is internal port, change the
                         * source vport value in reg_c0 back to uplink just in
                         * case the rule performs goto chain > 0. If we have a miss
@@ -3191,6 +3192,18 @@ actions_match_supported(struct mlx5e_priv *priv,
                return false;
        }
 
+       if (!(~actions &
+             (MLX5_FLOW_CONTEXT_ACTION_FWD_DEST | MLX5_FLOW_CONTEXT_ACTION_DROP))) {
+               NL_SET_ERR_MSG_MOD(extack, "Rule cannot support forward+drop action");
+               return false;
+       }
+
+       if (actions & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR &&
+           actions & MLX5_FLOW_CONTEXT_ACTION_DROP) {
+               NL_SET_ERR_MSG_MOD(extack, "Drop with modify header action is not supported");
+               return false;
+       }
+
        if (actions & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR &&
            !modify_header_match_supported(priv, &parse_attr->spec, flow_action,
                                           actions, ct_flow, ct_clear, extack))
index 7fd33b3..ee7ecb8 100644 (file)
@@ -208,7 +208,7 @@ static inline void mlx5e_insert_vlan(void *start, struct sk_buff *skb, u16 ihs)
        int cpy1_sz = 2 * ETH_ALEN;
        int cpy2_sz = ihs - cpy1_sz;
 
-       memcpy(vhdr, skb->data, cpy1_sz);
+       memcpy(&vhdr->addrs, skb->data, cpy1_sz);
        vhdr->h_vlan_proto = skb->vlan_proto;
        vhdr->h_vlan_TCI = cpu_to_be16(skb_vlan_tag_get(skb));
        memcpy(&vhdr->h_vlan_encapsulated_proto, skb->data + cpy1_sz, cpy2_sz);
index f690f43..05e08ce 100644 (file)
@@ -1574,6 +1574,8 @@ struct mlx5_esw_bridge_offloads *mlx5_esw_bridge_init(struct mlx5_eswitch *esw)
 {
        struct mlx5_esw_bridge_offloads *br_offloads;
 
+       ASSERT_RTNL();
+
        br_offloads = kvzalloc(sizeof(*br_offloads), GFP_KERNEL);
        if (!br_offloads)
                return ERR_PTR(-ENOMEM);
@@ -1590,6 +1592,8 @@ void mlx5_esw_bridge_cleanup(struct mlx5_eswitch *esw)
 {
        struct mlx5_esw_bridge_offloads *br_offloads = esw->br_offloads;
 
+       ASSERT_RTNL();
+
        if (!br_offloads)
                return;
 
index 3401188..51ac24e 100644 (file)
@@ -21,7 +21,7 @@ DECLARE_EVENT_CLASS(mlx5_esw_bridge_fdb_template,
                            __field(unsigned int, used)
                            ),
                    TP_fast_assign(
-                           strncpy(__entry->dev_name,
+                           strscpy(__entry->dev_name,
                                    netdev_name(fdb->dev),
                                    IFNAMSIZ);
                            memcpy(__entry->addr, fdb->key.addr, ETH_ALEN);
index 0b0234f..84dbe46 100644 (file)
@@ -132,7 +132,7 @@ static void mlx5_stop_sync_reset_poll(struct mlx5_core_dev *dev)
 {
        struct mlx5_fw_reset *fw_reset = dev->priv.fw_reset;
 
-       del_timer(&fw_reset->timer);
+       del_timer_sync(&fw_reset->timer);
 }
 
 static void mlx5_sync_reset_clear_reset_requested(struct mlx5_core_dev *dev, bool poll_health)
index d5e4763..df58cba 100644 (file)
@@ -121,12 +121,13 @@ u32 mlx5_chains_get_nf_ft_chain(struct mlx5_fs_chains *chains)
 
 u32 mlx5_chains_get_prio_range(struct mlx5_fs_chains *chains)
 {
-       if (!mlx5_chains_prios_supported(chains))
-               return 1;
-
        if (mlx5_chains_ignore_flow_level_supported(chains))
                return UINT_MAX;
 
+       if (!chains->dev->priv.eswitch ||
+           chains->dev->priv.eswitch->mode != MLX5_ESWITCH_OFFLOADS)
+               return 1;
+
        /* We should get here only for eswitch case */
        return FDB_TC_MAX_PRIO;
 }
@@ -211,7 +212,7 @@ static int
 create_chain_restore(struct fs_chain *chain)
 {
        struct mlx5_eswitch *esw = chain->chains->dev->priv.eswitch;
-       char modact[MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto)];
+       u8 modact[MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto)] = {};
        struct mlx5_fs_chains *chains = chain->chains;
        enum mlx5e_tc_attr_to_reg chain_to_reg;
        struct mlx5_modify_hdr *mod_hdr;
index 1ef2b6a..7b16a11 100644 (file)
@@ -406,23 +406,24 @@ int mlx5_query_module_eeprom(struct mlx5_core_dev *dev,
 
        switch (module_id) {
        case MLX5_MODULE_ID_SFP:
-               mlx5_sfp_eeprom_params_set(&query.i2c_address, &query.page, &query.offset);
+               mlx5_sfp_eeprom_params_set(&query.i2c_address, &query.page, &offset);
                break;
        case MLX5_MODULE_ID_QSFP:
        case MLX5_MODULE_ID_QSFP_PLUS:
        case MLX5_MODULE_ID_QSFP28:
-               mlx5_qsfp_eeprom_params_set(&query.i2c_address, &query.page, &query.offset);
+               mlx5_qsfp_eeprom_params_set(&query.i2c_address, &query.page, &offset);
                break;
        default:
                mlx5_core_err(dev, "Module ID not recognized: 0x%x\n", module_id);
                return -EINVAL;
        }
 
-       if (query.offset + size > MLX5_EEPROM_PAGE_LENGTH)
+       if (offset + size > MLX5_EEPROM_PAGE_LENGTH)
                /* Cross pages read, read until offset 256 in low page */
-               size -= offset + size - MLX5_EEPROM_PAGE_LENGTH;
+               size = MLX5_EEPROM_PAGE_LENGTH - offset;
 
        query.size = size;
+       query.offset = offset;
 
        return mlx5_query_mcia(dev, &query, data);
 }
index ca5f117..ce5970b 100644 (file)
@@ -40,11 +40,12 @@ static int lan966x_mac_wait_for_completion(struct lan966x *lan966x)
 {
        u32 val;
 
-       return readx_poll_timeout(lan966x_mac_get_status,
-               lan966x, val,
-               (ANA_MACACCESS_MAC_TABLE_CMD_GET(val)) ==
-               MACACCESS_CMD_IDLE,
-               TABLE_UPDATE_SLEEP_US, TABLE_UPDATE_TIMEOUT_US);
+       return readx_poll_timeout_atomic(lan966x_mac_get_status,
+                                        lan966x, val,
+                                        (ANA_MACACCESS_MAC_TABLE_CMD_GET(val)) ==
+                                        MACACCESS_CMD_IDLE,
+                                        TABLE_UPDATE_SLEEP_US,
+                                        TABLE_UPDATE_TIMEOUT_US);
 }
 
 static void lan966x_mac_select(struct lan966x *lan966x,
index 2cb70da..1f60fd1 100644 (file)
@@ -182,9 +182,9 @@ static int lan966x_port_inj_ready(struct lan966x *lan966x, u8 grp)
 {
        u32 val;
 
-       return readx_poll_timeout(lan966x_port_inj_status, lan966x, val,
-                                 QS_INJ_STATUS_FIFO_RDY_GET(val) & BIT(grp),
-                                 READL_SLEEP_US, READL_TIMEOUT_US);
+       return readx_poll_timeout_atomic(lan966x_port_inj_status, lan966x, val,
+                                        QS_INJ_STATUS_FIFO_RDY_GET(val) & BIT(grp),
+                                        READL_SLEEP_US, READL_TIMEOUT_US);
 }
 
 static int lan966x_port_ifh_xmit(struct sk_buff *skb,
index dc7e5ea..148d431 100644 (file)
@@ -145,9 +145,9 @@ static void sparx5_xtr_grp(struct sparx5 *sparx5, u8 grp, bool byte_swap)
        skb_put(skb, byte_cnt - ETH_FCS_LEN);
        eth_skb_pad(skb);
        skb->protocol = eth_type_trans(skb, netdev);
-       netif_rx(skb);
        netdev->stats.rx_bytes += skb->len;
        netdev->stats.rx_packets++;
+       netif_rx(skb);
 }
 
 static int sparx5_inject(struct sparx5 *sparx5,
index 16a4cba..c672f92 100644 (file)
@@ -749,6 +749,7 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id)
        const struct ether3_data *data = id->data;
        struct net_device *dev;
        int bus_type, ret;
+       u8 addr[ETH_ALEN];
 
        ether3_banner();
 
@@ -776,7 +777,8 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id)
        priv(dev)->seeq = priv(dev)->base + data->base_offset;
        dev->irq = ec->irq;
 
-       ether3_addr(dev->dev_addr, ec);
+       ether3_addr(addr, ec);
+       eth_hw_addr_set(dev, addr);
 
        priv(dev)->dev = dev;
        timer_setup(&priv(dev)->timer, ether3_ledoff, 0);
index dd6f69c..fc9cef9 100644 (file)
@@ -1648,7 +1648,7 @@ static int smc911x_ethtool_geteeprom(struct net_device *dev,
                        return ret;
                if ((ret=smc911x_ethtool_read_eeprom_byte(dev, &eebuf[i]))!=0)
                        return ret;
-               }
+       }
        memcpy(data, eebuf+eeprom->offset, eeprom->len);
        return 0;
 }
@@ -1667,11 +1667,11 @@ static int smc911x_ethtool_seteeprom(struct net_device *dev,
                        return ret;
                /* write byte */
                if ((ret=smc911x_ethtool_write_eeprom_byte(dev, *data))!=0)
-                        return ret;
+                       return ret;
                if ((ret=smc911x_ethtool_write_eeprom_cmd(dev, E2P_CMD_EPC_CMD_WRITE_, i ))!=0)
                        return ret;
-               }
-        return 0;
+       }
+       return 0;
 }
 
 static int smc911x_ethtool_geteeprom_len(struct net_device *dev)
index 617d0e4..09644ab 100644 (file)
@@ -756,7 +756,7 @@ static int sun8i_dwmac_reset(struct stmmac_priv *priv)
 
        if (err) {
                dev_err(priv->device, "EMAC reset timeout\n");
-               return -EFAULT;
+               return err;
        }
        return 0;
 }
index e2e0f97..c3f10a9 100644 (file)
 #define ETHER_CLK_SEL_RMII_CLK_EN BIT(2)
 #define ETHER_CLK_SEL_RMII_CLK_RST BIT(3)
 #define ETHER_CLK_SEL_DIV_SEL_2 BIT(4)
-#define ETHER_CLK_SEL_DIV_SEL_20 BIT(0)
+#define ETHER_CLK_SEL_DIV_SEL_20 0
 #define ETHER_CLK_SEL_FREQ_SEL_125M    (BIT(9) | BIT(8))
 #define ETHER_CLK_SEL_FREQ_SEL_50M     BIT(9)
 #define ETHER_CLK_SEL_FREQ_SEL_25M     BIT(8)
 #define ETHER_CLK_SEL_FREQ_SEL_2P5M    0
-#define ETHER_CLK_SEL_TX_CLK_EXT_SEL_IN BIT(0)
+#define ETHER_CLK_SEL_TX_CLK_EXT_SEL_IN 0
 #define ETHER_CLK_SEL_TX_CLK_EXT_SEL_TXC BIT(10)
 #define ETHER_CLK_SEL_TX_CLK_EXT_SEL_DIV BIT(11)
-#define ETHER_CLK_SEL_RX_CLK_EXT_SEL_IN  BIT(0)
+#define ETHER_CLK_SEL_RX_CLK_EXT_SEL_IN  0
 #define ETHER_CLK_SEL_RX_CLK_EXT_SEL_RXC BIT(12)
 #define ETHER_CLK_SEL_RX_CLK_EXT_SEL_DIV BIT(13)
-#define ETHER_CLK_SEL_TX_CLK_O_TX_I     BIT(0)
+#define ETHER_CLK_SEL_TX_CLK_O_TX_I     0
 #define ETHER_CLK_SEL_TX_CLK_O_RMII_I   BIT(14)
 #define ETHER_CLK_SEL_TX_O_E_N_IN       BIT(15)
-#define ETHER_CLK_SEL_RMII_CLK_SEL_IN   BIT(0)
+#define ETHER_CLK_SEL_RMII_CLK_SEL_IN   0
 #define ETHER_CLK_SEL_RMII_CLK_SEL_RX_C         BIT(16)
 
 #define ETHER_CLK_SEL_RX_TX_CLK_EN (ETHER_CLK_SEL_RX_CLK_EN | ETHER_CLK_SEL_TX_CLK_EN)
@@ -49,13 +49,15 @@ struct visconti_eth {
        void __iomem *reg;
        u32 phy_intf_sel;
        struct clk *phy_ref_clk;
+       struct device *dev;
        spinlock_t lock; /* lock to protect register update */
 };
 
 static void visconti_eth_fix_mac_speed(void *priv, unsigned int speed)
 {
        struct visconti_eth *dwmac = priv;
-       unsigned int val, clk_sel_val;
+       struct net_device *netdev = dev_get_drvdata(dwmac->dev);
+       unsigned int val, clk_sel_val = 0;
        unsigned long flags;
 
        spin_lock_irqsave(&dwmac->lock, flags);
@@ -85,7 +87,9 @@ static void visconti_eth_fix_mac_speed(void *priv, unsigned int speed)
                break;
        default:
                /* No bit control */
-               break;
+               netdev_err(netdev, "Unsupported speed request (%d)", speed);
+               spin_unlock_irqrestore(&dwmac->lock, flags);
+               return;
        }
 
        writel(val, dwmac->reg + MAC_CTRL_REG);
@@ -96,31 +100,41 @@ static void visconti_eth_fix_mac_speed(void *priv, unsigned int speed)
        val |= ETHER_CLK_SEL_TX_O_E_N_IN;
        writel(val, dwmac->reg + REG_ETHER_CLOCK_SEL);
 
+       /* Set Clock-Mux, Start clock, Set TX_O direction */
        switch (dwmac->phy_intf_sel) {
        case ETHER_CONFIG_INTF_RGMII:
                val = clk_sel_val | ETHER_CLK_SEL_RX_CLK_EXT_SEL_RXC;
+               writel(val, dwmac->reg + REG_ETHER_CLOCK_SEL);
+
+               val |= ETHER_CLK_SEL_RX_TX_CLK_EN;
+               writel(val, dwmac->reg + REG_ETHER_CLOCK_SEL);
+
+               val &= ~ETHER_CLK_SEL_TX_O_E_N_IN;
+               writel(val, dwmac->reg + REG_ETHER_CLOCK_SEL);
                break;
        case ETHER_CONFIG_INTF_RMII:
                val = clk_sel_val | ETHER_CLK_SEL_RX_CLK_EXT_SEL_DIV |
-                       ETHER_CLK_SEL_TX_CLK_EXT_SEL_TXC | ETHER_CLK_SEL_TX_O_E_N_IN |
+                       ETHER_CLK_SEL_TX_CLK_EXT_SEL_DIV | ETHER_CLK_SEL_TX_O_E_N_IN |
                        ETHER_CLK_SEL_RMII_CLK_SEL_RX_C;
+               writel(val, dwmac->reg + REG_ETHER_CLOCK_SEL);
+
+               val |= ETHER_CLK_SEL_RMII_CLK_RST;
+               writel(val, dwmac->reg + REG_ETHER_CLOCK_SEL);
+
+               val |= ETHER_CLK_SEL_RMII_CLK_EN | ETHER_CLK_SEL_RX_TX_CLK_EN;
+               writel(val, dwmac->reg + REG_ETHER_CLOCK_SEL);
                break;
        case ETHER_CONFIG_INTF_MII:
        default:
                val = clk_sel_val | ETHER_CLK_SEL_RX_CLK_EXT_SEL_RXC |
-                       ETHER_CLK_SEL_TX_CLK_EXT_SEL_DIV | ETHER_CLK_SEL_TX_O_E_N_IN |
-                       ETHER_CLK_SEL_RMII_CLK_EN;
+                       ETHER_CLK_SEL_TX_CLK_EXT_SEL_TXC | ETHER_CLK_SEL_TX_O_E_N_IN;
+               writel(val, dwmac->reg + REG_ETHER_CLOCK_SEL);
+
+               val |= ETHER_CLK_SEL_RX_TX_CLK_EN;
+               writel(val, dwmac->reg + REG_ETHER_CLOCK_SEL);
                break;
        }
 
-       /* Start clock */
-       writel(val, dwmac->reg + REG_ETHER_CLOCK_SEL);
-       val |= ETHER_CLK_SEL_RX_TX_CLK_EN;
-       writel(val, dwmac->reg + REG_ETHER_CLOCK_SEL);
-
-       val &= ~ETHER_CLK_SEL_TX_O_E_N_IN;
-       writel(val, dwmac->reg + REG_ETHER_CLOCK_SEL);
-
        spin_unlock_irqrestore(&dwmac->lock, flags);
 }
 
@@ -219,6 +233,7 @@ static int visconti_eth_dwmac_probe(struct platform_device *pdev)
 
        spin_lock_init(&dwmac->lock);
        dwmac->reg = stmmac_res.addr;
+       dwmac->dev = &pdev->dev;
        plat_dat->bsp_priv = dwmac;
        plat_dat->fix_mac_speed = visconti_eth_fix_mac_speed;
 
index 1914ad6..acd70b9 100644 (file)
 
 #define NUM_DWMAC100_DMA_REGS  9
 #define NUM_DWMAC1000_DMA_REGS 23
+#define NUM_DWMAC4_DMA_REGS    27
 
 void dwmac_enable_dma_transmission(void __iomem *ioaddr);
 void dwmac_enable_dma_irq(void __iomem *ioaddr, u32 chan, bool rx, bool tx);
index 40b5ed9..5b195d5 100644 (file)
@@ -194,7 +194,6 @@ struct stmmac_priv {
        u32 tx_coal_timer[MTL_MAX_TX_QUEUES];
        u32 rx_coal_frames[MTL_MAX_TX_QUEUES];
 
-       int tx_coalesce;
        int hwts_tx_en;
        bool tx_path_in_lpi_mode;
        bool tso;
@@ -229,7 +228,6 @@ struct stmmac_priv {
        unsigned int flow_ctrl;
        unsigned int pause;
        struct mii_bus *mii;
-       int mii_irq[PHY_MAX_ADDR];
 
        struct phylink_config phylink_config;
        struct phylink *phylink;
index 164dff5..abfb3cd 100644 (file)
 #include "dwxgmac2.h"
 
 #define REG_SPACE_SIZE 0x1060
+#define GMAC4_REG_SPACE_SIZE   0x116C
 #define MAC100_ETHTOOL_NAME    "st_mac100"
 #define GMAC_ETHTOOL_NAME      "st_gmac"
 #define XGMAC_ETHTOOL_NAME     "st_xgmac"
 
+/* Same as DMA_CHAN_BASE_ADDR defined in dwmac4_dma.h
+ *
+ * It is here because dwmac_dma.h and dwmac4_dam.h can not be included at the
+ * same time due to the conflicting macro names.
+ */
+#define GMAC4_DMA_CHAN_BASE_ADDR  0x00001100
+
 #define ETHTOOL_DMA_OFFSET     55
 
 struct stmmac_stats {
@@ -434,6 +442,8 @@ static int stmmac_ethtool_get_regs_len(struct net_device *dev)
 
        if (priv->plat->has_xgmac)
                return XGMAC_REGSIZE * 4;
+       else if (priv->plat->has_gmac4)
+               return GMAC4_REG_SPACE_SIZE;
        return REG_SPACE_SIZE;
 }
 
@@ -446,8 +456,13 @@ static void stmmac_ethtool_gregs(struct net_device *dev,
        stmmac_dump_mac_regs(priv, priv->hw, reg_space);
        stmmac_dump_dma_regs(priv, priv->ioaddr, reg_space);
 
-       if (!priv->plat->has_xgmac) {
-               /* Copy DMA registers to where ethtool expects them */
+       /* Copy DMA registers to where ethtool expects them */
+       if (priv->plat->has_gmac4) {
+               /* GMAC4 dumps its DMA registers at its DMA_CHAN_BASE_ADDR */
+               memcpy(&reg_space[ETHTOOL_DMA_OFFSET],
+                      &reg_space[GMAC4_DMA_CHAN_BASE_ADDR / 4],
+                      NUM_DWMAC4_DMA_REGS * 4);
+       } else if (!priv->plat->has_xgmac) {
                memcpy(&reg_space[ETHTOOL_DMA_OFFSET],
                       &reg_space[DMA_BUS_MODE / 4],
                       NUM_DWMAC1000_DMA_REGS * 4);
index 074e2cd..a7ec9f4 100644 (file)
@@ -145,15 +145,20 @@ static int adjust_systime(void __iomem *ioaddr, u32 sec, u32 nsec,
 
 static void get_systime(void __iomem *ioaddr, u64 *systime)
 {
-       u64 ns;
-
-       /* Get the TSSS value */
-       ns = readl(ioaddr + PTP_STNSR);
-       /* Get the TSS and convert sec time value to nanosecond */
-       ns += readl(ioaddr + PTP_STSR) * 1000000000ULL;
+       u64 ns, sec0, sec1;
+
+       /* Get the TSS value */
+       sec1 = readl_relaxed(ioaddr + PTP_STSR);
+       do {
+               sec0 = sec1;
+               /* Get the TSSS value */
+               ns = readl_relaxed(ioaddr + PTP_STNSR);
+               /* Get the TSS value */
+               sec1 = readl_relaxed(ioaddr + PTP_STSR);
+       } while (sec0 != sec1);
 
        if (systime)
-               *systime = ns;
+               *systime = ns + (sec1 * 1000000000ULL);
 }
 
 static void get_ptptime(void __iomem *ptpaddr, u64 *ptp_time)
index 6708ca2..bde76ea 100644 (file)
@@ -402,7 +402,7 @@ static void stmmac_lpi_entry_timer_config(struct stmmac_priv *priv, bool en)
  * Description: this function is to verify and enter in LPI mode in case of
  * EEE.
  */
-static void stmmac_enable_eee_mode(struct stmmac_priv *priv)
+static int stmmac_enable_eee_mode(struct stmmac_priv *priv)
 {
        u32 tx_cnt = priv->plat->tx_queues_to_use;
        u32 queue;
@@ -412,13 +412,14 @@ static void stmmac_enable_eee_mode(struct stmmac_priv *priv)
                struct stmmac_tx_queue *tx_q = &priv->tx_queue[queue];
 
                if (tx_q->dirty_tx != tx_q->cur_tx)
-                       return; /* still unfinished work */
+                       return -EBUSY; /* still unfinished work */
        }
 
        /* Check and enter in LPI mode */
        if (!priv->tx_path_in_lpi_mode)
                stmmac_set_eee_mode(priv, priv->hw,
                                priv->plat->en_tx_lpi_clockgating);
+       return 0;
 }
 
 /**
@@ -450,8 +451,8 @@ static void stmmac_eee_ctrl_timer(struct timer_list *t)
 {
        struct stmmac_priv *priv = from_timer(priv, t, eee_ctrl_timer);
 
-       stmmac_enable_eee_mode(priv);
-       mod_timer(&priv->eee_ctrl_timer, STMMAC_LPI_T(priv->tx_lpi_timer));
+       if (stmmac_enable_eee_mode(priv))
+               mod_timer(&priv->eee_ctrl_timer, STMMAC_LPI_T(priv->tx_lpi_timer));
 }
 
 /**
@@ -889,6 +890,9 @@ static int stmmac_init_ptp(struct stmmac_priv *priv)
        bool xmac = priv->plat->has_gmac4 || priv->plat->has_xgmac;
        int ret;
 
+       if (priv->plat->ptp_clk_freq_config)
+               priv->plat->ptp_clk_freq_config(priv);
+
        ret = stmmac_init_tstamp_counter(priv, STMMAC_HWTS_ACTIVE);
        if (ret)
                return ret;
@@ -911,8 +915,6 @@ static int stmmac_init_ptp(struct stmmac_priv *priv)
        priv->hwts_tx_en = 0;
        priv->hwts_rx_en = 0;
 
-       stmmac_ptp_register(priv);
-
        return 0;
 }
 
@@ -2647,8 +2649,8 @@ static int stmmac_tx_clean(struct stmmac_priv *priv, int budget, u32 queue)
 
        if (priv->eee_enabled && !priv->tx_path_in_lpi_mode &&
            priv->eee_sw_timer_en) {
-               stmmac_enable_eee_mode(priv);
-               mod_timer(&priv->eee_ctrl_timer, STMMAC_LPI_T(priv->tx_lpi_timer));
+               if (stmmac_enable_eee_mode(priv))
+                       mod_timer(&priv->eee_ctrl_timer, STMMAC_LPI_T(priv->tx_lpi_timer));
        }
 
        /* We still have pending packets, let's call for a new scheduling */
@@ -3238,7 +3240,7 @@ static int stmmac_fpe_start_wq(struct stmmac_priv *priv)
 /**
  * stmmac_hw_setup - setup mac in a usable state.
  *  @dev : pointer to the device structure.
- *  @init_ptp: initialize PTP if set
+ *  @ptp_register: register PTP if set
  *  Description:
  *  this is the main function to setup the HW in a usable state because the
  *  dma engine is reset, the core registers are configured (e.g. AXI,
@@ -3248,7 +3250,7 @@ static int stmmac_fpe_start_wq(struct stmmac_priv *priv)
  *  0 on success and an appropriate (-)ve integer as defined in errno.h
  *  file on failure.
  */
-static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
+static int stmmac_hw_setup(struct net_device *dev, bool ptp_register)
 {
        struct stmmac_priv *priv = netdev_priv(dev);
        u32 rx_cnt = priv->plat->rx_queues_to_use;
@@ -3305,13 +3307,13 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
 
        stmmac_mmc_setup(priv);
 
-       if (init_ptp) {
-               ret = stmmac_init_ptp(priv);
-               if (ret == -EOPNOTSUPP)
-                       netdev_warn(priv->dev, "PTP not supported by HW\n");
-               else if (ret)
-                       netdev_warn(priv->dev, "PTP init failed\n");
-       }
+       ret = stmmac_init_ptp(priv);
+       if (ret == -EOPNOTSUPP)
+               netdev_warn(priv->dev, "PTP not supported by HW\n");
+       else if (ret)
+               netdev_warn(priv->dev, "PTP init failed\n");
+       else if (ptp_register)
+               stmmac_ptp_register(priv);
 
        priv->eee_tw_timer = STMMAC_DEFAULT_TWT_LS;
 
@@ -7250,6 +7252,10 @@ int stmmac_dvr_remove(struct device *dev)
 
        netdev_info(priv->dev, "%s: removing driver", __func__);
 
+       pm_runtime_get_sync(dev);
+       pm_runtime_disable(dev);
+       pm_runtime_put_noidle(dev);
+
        stmmac_stop_all_dma(priv);
        stmmac_mac_set(priv, priv->ioaddr, false);
        netif_carrier_off(ndev);
@@ -7268,8 +7274,6 @@ int stmmac_dvr_remove(struct device *dev)
        if (priv->plat->stmmac_rst)
                reset_control_assert(priv->plat->stmmac_rst);
        reset_control_assert(priv->plat->stmmac_ahb_rst);
-       pm_runtime_put(dev);
-       pm_runtime_disable(dev);
        if (priv->hw->pcs != STMMAC_PCS_TBI &&
            priv->hw->pcs != STMMAC_PCS_RTBI)
                stmmac_mdio_unregister(ndev);
index 0d24ebd..1c9f02f 100644 (file)
@@ -297,9 +297,6 @@ void stmmac_ptp_register(struct stmmac_priv *priv)
 {
        int i;
 
-       if (priv->plat->ptp_clk_freq_config)
-               priv->plat->ptp_clk_freq_config(priv);
-
        for (i = 0; i < priv->dma_cap.pps_out_num; i++) {
                if (i >= STMMAC_PPS_MAX)
                        break;
index ba22059..8f6817f 100644 (file)
@@ -1146,7 +1146,7 @@ int cpsw_fill_rx_channels(struct cpsw_priv *priv)
 static struct page_pool *cpsw_create_page_pool(struct cpsw_common *cpsw,
                                               int size)
 {
-       struct page_pool_params pp_params;
+       struct page_pool_params pp_params = {};
        struct page_pool *pool;
 
        pp_params.order = 0;
index cf0917b..5251fc3 100644 (file)
@@ -1091,20 +1091,22 @@ static int tsi108_get_mac(struct net_device *dev)
        struct tsi108_prv_data *data = netdev_priv(dev);
        u32 word1 = TSI_READ(TSI108_MAC_ADDR1);
        u32 word2 = TSI_READ(TSI108_MAC_ADDR2);
+       u8 addr[ETH_ALEN];
 
        /* Note that the octets are reversed from what the manual says,
         * producing an even weirder ordering...
         */
        if (word2 == 0 && word1 == 0) {
-               dev->dev_addr[0] = 0x00;
-               dev->dev_addr[1] = 0x06;
-               dev->dev_addr[2] = 0xd2;
-               dev->dev_addr[3] = 0x00;
-               dev->dev_addr[4] = 0x00;
+               addr[0] = 0x00;
+               addr[1] = 0x06;
+               addr[2] = 0xd2;
+               addr[3] = 0x00;
+               addr[4] = 0x00;
                if (0x8 == data->phy)
-                       dev->dev_addr[5] = 0x01;
+                       addr[5] = 0x01;
                else
-                       dev->dev_addr[5] = 0x02;
+                       addr[5] = 0x02;
+               eth_hw_addr_set(dev, addr);
 
                word2 = (dev->dev_addr[0] << 16) | (dev->dev_addr[1] << 24);
 
@@ -1114,12 +1116,13 @@ static int tsi108_get_mac(struct net_device *dev)
                TSI_WRITE(TSI108_MAC_ADDR1, word1);
                TSI_WRITE(TSI108_MAC_ADDR2, word2);
        } else {
-               dev->dev_addr[0] = (word2 >> 16) & 0xff;
-               dev->dev_addr[1] = (word2 >> 24) & 0xff;
-               dev->dev_addr[2] = (word1 >> 0) & 0xff;
-               dev->dev_addr[3] = (word1 >> 8) & 0xff;
-               dev->dev_addr[4] = (word1 >> 16) & 0xff;
-               dev->dev_addr[5] = (word1 >> 24) & 0xff;
+               addr[0] = (word2 >> 16) & 0xff;
+               addr[1] = (word2 >> 24) & 0xff;
+               addr[2] = (word1 >> 0) & 0xff;
+               addr[3] = (word1 >> 8) & 0xff;
+               addr[4] = (word1 >> 16) & 0xff;
+               addr[5] = (word1 >> 24) & 0xff;
+               eth_hw_addr_set(dev, addr);
        }
 
        if (!is_valid_ether_addr(dev->dev_addr)) {
@@ -1136,14 +1139,12 @@ static int tsi108_set_mac(struct net_device *dev, void *addr)
 {
        struct tsi108_prv_data *data = netdev_priv(dev);
        u32 word1, word2;
-       int i;
 
        if (!is_valid_ether_addr(addr))
                return -EADDRNOTAVAIL;
 
-       for (i = 0; i < 6; i++)
-               /* +2 is for the offset of the HW addr type */
-               dev->dev_addr[i] = ((unsigned char *)addr)[i + 2];
+       /* +2 is for the offset of the HW addr type */
+       eth_hw_addr_set(dev, ((unsigned char *)addr) + 2);
 
        word2 = (dev->dev_addr[0] << 16) | (dev->dev_addr[1] << 24);
 
index 6376b84..980f2be 100644 (file)
@@ -950,9 +950,7 @@ static int yam_siocdevprivate(struct net_device *dev, struct ifreq *ifr, void __
                ym = memdup_user(data, sizeof(struct yamdrv_ioctl_mcs));
                if (IS_ERR(ym))
                        return PTR_ERR(ym);
-               if (ym->cmd != SIOCYAMSMCS)
-                       return -EINVAL;
-               if (ym->bitrate > YAM_MAXBITRATE) {
+               if (ym->cmd != SIOCYAMSMCS || ym->bitrate > YAM_MAXBITRATE) {
                        kfree(ym);
                        return -EINVAL;
                }
index 7d67f41..4f5ef8a 100644 (file)
@@ -100,6 +100,7 @@ struct at86rf230_local {
        unsigned long cal_timeout;
        bool is_tx;
        bool is_tx_from_off;
+       bool was_tx;
        u8 tx_retry;
        struct sk_buff *tx_skb;
        struct at86rf230_state_change tx;
@@ -343,7 +344,11 @@ at86rf230_async_error_recover_complete(void *context)
        if (ctx->free)
                kfree(ctx);
 
-       ieee802154_wake_queue(lp->hw);
+       if (lp->was_tx) {
+               lp->was_tx = 0;
+               dev_kfree_skb_any(lp->tx_skb);
+               ieee802154_wake_queue(lp->hw);
+       }
 }
 
 static void
@@ -352,7 +357,11 @@ at86rf230_async_error_recover(void *context)
        struct at86rf230_state_change *ctx = context;
        struct at86rf230_local *lp = ctx->lp;
 
-       lp->is_tx = 0;
+       if (lp->is_tx) {
+               lp->was_tx = 1;
+               lp->is_tx = 0;
+       }
+
        at86rf230_async_state_change(lp, ctx, STATE_RX_AACK_ON,
                                     at86rf230_async_error_recover_complete);
 }
index ece6ff6..f3438d3 100644 (file)
@@ -1771,6 +1771,7 @@ static int ca8210_async_xmit_complete(
                        status
                );
                if (status != MAC_TRANSACTION_OVERFLOW) {
+                       dev_kfree_skb_any(priv->tx_skb);
                        ieee802154_wake_queue(priv->hw);
                        return 0;
                }
index 8caa61e..36f1c5a 100644 (file)
@@ -786,6 +786,7 @@ static int hwsim_add_one(struct genl_info *info, struct device *dev,
                goto err_pib;
        }
 
+       pib->channel = 13;
        rcu_assign_pointer(phy->pib, pib);
        phy->idx = idx;
        INIT_LIST_HEAD(&phy->edges);
index 8dc04e2..383231b 100644 (file)
@@ -976,8 +976,8 @@ static void mcr20a_hw_setup(struct mcr20a_local *lp)
        dev_dbg(printdev(lp), "%s\n", __func__);
 
        phy->symbol_duration = 16;
-       phy->lifs_period = 40;
-       phy->sifs_period = 12;
+       phy->lifs_period = 40 * phy->symbol_duration;
+       phy->sifs_period = 12 * phy->symbol_duration;
 
        hw->flags = IEEE802154_HW_TX_OMIT_CKSUM |
                        IEEE802154_HW_AFILT |
index b1c6c0f..f2989aa 100644 (file)
@@ -11,6 +11,8 @@
 #include <linux/pm_runtime.h>
 #include <linux/bitops.h>
 
+#include "linux/soc/qcom/qcom_aoss.h"
+
 #include "ipa.h"
 #include "ipa_power.h"
 #include "ipa_endpoint.h"
@@ -64,6 +66,7 @@ enum ipa_power_flag {
  * struct ipa_power - IPA power management information
  * @dev:               IPA device pointer
  * @core:              IPA core clock
+ * @qmp:               QMP handle for AOSS communication
  * @spinlock:          Protects modem TX queue enable/disable
  * @flags:             Boolean state flags
  * @interconnect_count:        Number of elements in interconnect[]
@@ -72,6 +75,7 @@ enum ipa_power_flag {
 struct ipa_power {
        struct device *dev;
        struct clk *core;
+       struct qmp *qmp;
        spinlock_t spinlock;    /* used with STOPPED/STARTED power flags */
        DECLARE_BITMAP(flags, IPA_POWER_FLAG_COUNT);
        u32 interconnect_count;
@@ -382,6 +386,47 @@ void ipa_power_modem_queue_active(struct ipa *ipa)
        clear_bit(IPA_POWER_FLAG_STARTED, ipa->power->flags);
 }
 
+static int ipa_power_retention_init(struct ipa_power *power)
+{
+       struct qmp *qmp = qmp_get(power->dev);
+
+       if (IS_ERR(qmp)) {
+               if (PTR_ERR(qmp) == -EPROBE_DEFER)
+                       return -EPROBE_DEFER;
+
+               /* We assume any other error means it's not defined/needed */
+               qmp = NULL;
+       }
+       power->qmp = qmp;
+
+       return 0;
+}
+
+static void ipa_power_retention_exit(struct ipa_power *power)
+{
+       qmp_put(power->qmp);
+       power->qmp = NULL;
+}
+
+/* Control register retention on power collapse */
+void ipa_power_retention(struct ipa *ipa, bool enable)
+{
+       static const char fmt[] = "{ class: bcm, res: ipa_pc, val: %c }";
+       struct ipa_power *power = ipa->power;
+       char buf[36];   /* Exactly enough for fmt[]; size a multiple of 4 */
+       int ret;
+
+       if (!power->qmp)
+               return;         /* Not needed on this platform */
+
+       (void)snprintf(buf, sizeof(buf), fmt, enable ? '1' : '0');
+
+       ret = qmp_send(power->qmp, buf, sizeof(buf));
+       if (ret)
+               dev_err(power->dev, "error %d sending QMP %sable request\n",
+                       ret, enable ? "en" : "dis");
+}
+
 int ipa_power_setup(struct ipa *ipa)
 {
        int ret;
@@ -438,12 +483,18 @@ ipa_power_init(struct device *dev, const struct ipa_power_data *data)
        if (ret)
                goto err_kfree;
 
+       ret = ipa_power_retention_init(power);
+       if (ret)
+               goto err_interconnect_exit;
+
        pm_runtime_set_autosuspend_delay(dev, IPA_AUTOSUSPEND_DELAY);
        pm_runtime_use_autosuspend(dev);
        pm_runtime_enable(dev);
 
        return power;
 
+err_interconnect_exit:
+       ipa_interconnect_exit(power);
 err_kfree:
        kfree(power);
 err_clk_put:
@@ -460,6 +511,7 @@ void ipa_power_exit(struct ipa_power *power)
 
        pm_runtime_disable(dev);
        pm_runtime_dont_use_autosuspend(dev);
+       ipa_power_retention_exit(power);
        ipa_interconnect_exit(power);
        kfree(power);
        clk_put(clk);
index 2151805..6f84f05 100644 (file)
@@ -41,6 +41,13 @@ void ipa_power_modem_queue_wake(struct ipa *ipa);
 void ipa_power_modem_queue_active(struct ipa *ipa);
 
 /**
+ * ipa_power_retention() - Control register retention on power collapse
+ * @ipa:       IPA pointer
+ * @enable:    Whether retention should be enabled or disabled
+ */
+void ipa_power_retention(struct ipa *ipa, bool enable);
+
+/**
  * ipa_power_setup() - Set up IPA power management
  * @ipa:       IPA pointer
  *
index 856e55a..fe11910 100644 (file)
@@ -11,6 +11,7 @@
 
 #include "ipa.h"
 #include "ipa_uc.h"
+#include "ipa_power.h"
 
 /**
  * DOC:  The IPA embedded microcontroller
@@ -154,6 +155,7 @@ static void ipa_uc_response_hdlr(struct ipa *ipa, enum ipa_irq_id irq_id)
        case IPA_UC_RESPONSE_INIT_COMPLETED:
                if (ipa->uc_powered) {
                        ipa->uc_loaded = true;
+                       ipa_power_retention(ipa, true);
                        pm_runtime_mark_last_busy(dev);
                        (void)pm_runtime_put_autosuspend(dev);
                        ipa->uc_powered = false;
@@ -184,6 +186,9 @@ void ipa_uc_deconfig(struct ipa *ipa)
 
        ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_UC_1);
        ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_UC_0);
+       if (ipa->uc_loaded)
+               ipa_power_retention(ipa, false);
+
        if (!ipa->uc_powered)
                return;
 
index 16aa3a4..3d08743 100644 (file)
@@ -3870,6 +3870,18 @@ static void macsec_common_dellink(struct net_device *dev, struct list_head *head
        struct macsec_dev *macsec = macsec_priv(dev);
        struct net_device *real_dev = macsec->real_dev;
 
+       /* If h/w offloading is available, propagate to the device */
+       if (macsec_is_offloaded(macsec)) {
+               const struct macsec_ops *ops;
+               struct macsec_context ctx;
+
+               ops = macsec_get_ops(netdev_priv(dev), &ctx);
+               if (ops) {
+                       ctx.secy = &macsec->secy;
+                       macsec_offload(ops->mdo_del_secy, &ctx);
+               }
+       }
+
        unregister_netdevice_queue(dev, head);
        list_del_rcu(&macsec->secys);
        macsec_del_dev(macsec);
@@ -3884,18 +3896,6 @@ static void macsec_dellink(struct net_device *dev, struct list_head *head)
        struct net_device *real_dev = macsec->real_dev;
        struct macsec_rxh_data *rxd = macsec_data_rtnl(real_dev);
 
-       /* If h/w offloading is available, propagate to the device */
-       if (macsec_is_offloaded(macsec)) {
-               const struct macsec_ops *ops;
-               struct macsec_context ctx;
-
-               ops = macsec_get_ops(netdev_priv(dev), &ctx);
-               if (ops) {
-                       ctx.secy = &macsec->secy;
-                       macsec_offload(ops->mdo_del_secy, &ctx);
-               }
-       }
-
        macsec_common_dellink(dev, head);
 
        if (list_empty(&rxd->secys)) {
@@ -4018,6 +4018,15 @@ static int macsec_newlink(struct net *net, struct net_device *dev,
            !macsec_check_offload(macsec->offload, macsec))
                return -EOPNOTSUPP;
 
+       /* send_sci must be set to true when transmit sci explicitly is set */
+       if ((data && data[IFLA_MACSEC_SCI]) &&
+           (data && data[IFLA_MACSEC_INC_SCI])) {
+               u8 send_sci = !!nla_get_u8(data[IFLA_MACSEC_INC_SCI]);
+
+               if (!send_sci)
+                       return -EINVAL;
+       }
+
        if (data && data[IFLA_MACSEC_ICV_LEN])
                icv_len = nla_get_u8(data[IFLA_MACSEC_ICV_LEN]);
        mtu = real_dev->mtu - icv_len - macsec_extra_len(true);
index 5b6c0d1..29aa811 100644 (file)
@@ -1688,19 +1688,19 @@ static int qca808x_read_status(struct phy_device *phydev)
        if (ret < 0)
                return ret;
 
-       if (phydev->link && phydev->speed == SPEED_2500)
-               phydev->interface = PHY_INTERFACE_MODE_2500BASEX;
-       else
-               phydev->interface = PHY_INTERFACE_MODE_SMII;
-
-       /* generate seed as a lower random value to make PHY linked as SLAVE easily,
-        * except for master/slave configuration fault detected.
-        * the reason for not putting this code into the function link_change_notify is
-        * the corner case where the link partner is also the qca8081 PHY and the seed
-        * value is configured as the same value, the link can't be up and no link change
-        * occurs.
-        */
-       if (!phydev->link) {
+       if (phydev->link) {
+               if (phydev->speed == SPEED_2500)
+                       phydev->interface = PHY_INTERFACE_MODE_2500BASEX;
+               else
+                       phydev->interface = PHY_INTERFACE_MODE_SGMII;
+       } else {
+               /* generate seed as a lower random value to make PHY linked as SLAVE easily,
+                * except for master/slave configuration fault detected.
+                * the reason for not putting this code into the function link_change_notify is
+                * the corner case where the link partner is also the qca8081 PHY and the seed
+                * value is configured as the same value, the link can't be up and no link change
+                * occurs.
+                */
                if (phydev->master_slave_state == MASTER_SLAVE_STATE_ERR) {
                        qca808x_phy_ms_seed_enable(phydev, false);
                } else {
index bb5104a..3c683e0 100644 (file)
@@ -854,6 +854,7 @@ static struct phy_driver broadcom_drivers[] = {
        .phy_id_mask    = 0xfffffff0,
        .name           = "Broadcom BCM54616S",
        /* PHY_GBIT_FEATURES */
+       .soft_reset     = genphy_soft_reset,
        .config_init    = bcm54xx_config_init,
        .config_aneg    = bcm54616s_config_aneg,
        .config_intr    = bcm_phy_config_intr,
index 74d8e1d..ce0bb59 100644 (file)
@@ -1746,6 +1746,9 @@ void phy_detach(struct phy_device *phydev)
            phy_driver_is_genphy_10g(phydev))
                device_release_driver(&phydev->mdio.dev);
 
+       /* Assert the reset signal */
+       phy_device_reset(phydev, 1);
+
        /*
         * The phydev might go away on the put_device() below, so avoid
         * a use-after-free bug by reading the underlying bus first.
@@ -1757,9 +1760,6 @@ void phy_detach(struct phy_device *phydev)
                ndev_owner = dev->dev.parent->driver->owner;
        if (ndev_owner != bus->owner)
                module_put(bus->owner);
-
-       /* Assert the reset signal */
-       phy_device_reset(phydev, 1);
 }
 EXPORT_SYMBOL(phy_detach);
 
index 0c6c0d1..c1512c9 100644 (file)
@@ -651,6 +651,11 @@ struct sfp_bus *sfp_bus_find_fwnode(struct fwnode_handle *fwnode)
        else if (ret < 0)
                return ERR_PTR(ret);
 
+       if (!fwnode_device_is_available(ref.fwnode)) {
+               fwnode_handle_put(ref.fwnode);
+               return NULL;
+       }
+
        bus = sfp_bus_get(ref.fwnode);
        fwnode_handle_put(ref.fwnode);
        if (!bus)
index cd33955..6a769df 100644 (file)
@@ -121,7 +121,7 @@ static int ipheth_alloc_urbs(struct ipheth_device *iphone)
        if (tx_buf == NULL)
                goto free_rx_urb;
 
-       rx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE,
+       rx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE + IPHETH_IP_ALIGN,
                                    GFP_KERNEL, &rx_urb->transfer_dma);
        if (rx_buf == NULL)
                goto free_tx_buf;
@@ -146,7 +146,7 @@ error_nomem:
 
 static void ipheth_free_urbs(struct ipheth_device *iphone)
 {
-       usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->rx_buf,
+       usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE + IPHETH_IP_ALIGN, iphone->rx_buf,
                          iphone->rx_urb->transfer_dma);
        usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->tx_buf,
                          iphone->tx_urb->transfer_dma);
@@ -317,7 +317,7 @@ static int ipheth_rx_submit(struct ipheth_device *dev, gfp_t mem_flags)
 
        usb_fill_bulk_urb(dev->rx_urb, udev,
                          usb_rcvbulkpipe(udev, dev->bulk_in),
-                         dev->rx_buf, IPHETH_BUF_SIZE,
+                         dev->rx_buf, IPHETH_BUF_SIZE + IPHETH_IP_ALIGN,
                          ipheth_rcvbulk_callback,
                          dev);
        dev->rx_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
index 5e0bfda..961a5f8 100644 (file)
@@ -4253,7 +4253,14 @@ static void nvme_async_event_work(struct work_struct *work)
                container_of(work, struct nvme_ctrl, async_event_work);
 
        nvme_aen_uevent(ctrl);
-       ctrl->ops->submit_async_event(ctrl);
+
+       /*
+        * The transport drivers must guarantee AER submission here is safe by
+        * flushing ctrl async_event_work after changing the controller state
+        * from LIVE and before freeing the admin queue.
+       */
+       if (ctrl->state == NVME_CTRL_LIVE)
+               ctrl->ops->submit_async_event(ctrl);
 }
 
 static bool nvme_ctrl_pp_status(struct nvme_ctrl *ctrl)
index 7ae041e..f79a66d 100644 (file)
@@ -1092,7 +1092,6 @@ static void __nvmf_concat_opt_tokens(struct seq_file *seq_file)
 static int nvmf_dev_show(struct seq_file *seq_file, void *private)
 {
        struct nvme_ctrl *ctrl;
-       int ret = 0;
 
        mutex_lock(&nvmf_dev_mutex);
        ctrl = seq_file->private;
@@ -1106,7 +1105,7 @@ static int nvmf_dev_show(struct seq_file *seq_file, void *private)
 
 out_unlock:
        mutex_unlock(&nvmf_dev_mutex);
-       return ret;
+       return 0;
 }
 
 static int nvmf_dev_open(struct inode *inode, struct file *file)
index c3203ff..1e3a09c 100644 (file)
@@ -170,6 +170,7 @@ nvmf_ctlr_matches_baseopts(struct nvme_ctrl *ctrl,
                        struct nvmf_ctrl_options *opts)
 {
        if (ctrl->state == NVME_CTRL_DELETING ||
+           ctrl->state == NVME_CTRL_DELETING_NOIO ||
            ctrl->state == NVME_CTRL_DEAD ||
            strcmp(opts->subsysnqn, ctrl->opts->subsysnqn) ||
            strcmp(opts->host->nqn, ctrl->opts->host->nqn) ||
index d8585df..6a99ed6 100644 (file)
@@ -3391,7 +3391,8 @@ static const struct pci_device_id nvme_id_table[] = {
                                NVME_QUIRK_DEALLOCATE_ZEROES, },
        { PCI_VDEVICE(INTEL, 0x0a54),   /* Intel P4500/P4600 */
                .driver_data = NVME_QUIRK_STRIPE_SIZE |
-                               NVME_QUIRK_DEALLOCATE_ZEROES, },
+                               NVME_QUIRK_DEALLOCATE_ZEROES |
+                               NVME_QUIRK_IGNORE_DEV_SUBNQN, },
        { PCI_VDEVICE(INTEL, 0x0a55),   /* Dell Express Flash P4600 */
                .driver_data = NVME_QUIRK_STRIPE_SIZE |
                                NVME_QUIRK_DEALLOCATE_ZEROES, },
index 850f84d..9c55e4b 100644 (file)
@@ -1200,6 +1200,7 @@ static void nvme_rdma_error_recovery_work(struct work_struct *work)
                        struct nvme_rdma_ctrl, err_work);
 
        nvme_stop_keep_alive(&ctrl->ctrl);
+       flush_work(&ctrl->ctrl.async_event_work);
        nvme_rdma_teardown_io_queues(ctrl, false);
        nvme_start_queues(&ctrl->ctrl);
        nvme_rdma_teardown_admin_queue(ctrl, false);
index 4ceb286..01e24b5 100644 (file)
@@ -2096,6 +2096,7 @@ static void nvme_tcp_error_recovery_work(struct work_struct *work)
        struct nvme_ctrl *ctrl = &tcp_ctrl->ctrl;
 
        nvme_stop_keep_alive(ctrl);
+       flush_work(&ctrl->async_event_work);
        nvme_tcp_teardown_io_queues(ctrl, false);
        /* unquiesce to fail fast pending requests */
        nvme_start_queues(ctrl);
index 489586a..768d33f 100644 (file)
@@ -356,8 +356,8 @@ static int j721e_pcie_probe(struct platform_device *pdev)
        const struct j721e_pcie_data *data;
        struct cdns_pcie *cdns_pcie;
        struct j721e_pcie *pcie;
-       struct cdns_pcie_rc *rc;
-       struct cdns_pcie_ep *ep;
+       struct cdns_pcie_rc *rc = NULL;
+       struct cdns_pcie_ep *ep = NULL;
        struct gpio_desc *gpiod;
        void __iomem *base;
        struct clk *clk;
@@ -376,6 +376,46 @@ static int j721e_pcie_probe(struct platform_device *pdev)
        if (!pcie)
                return -ENOMEM;
 
+       switch (mode) {
+       case PCI_MODE_RC:
+               if (!IS_ENABLED(CONFIG_PCIE_CADENCE_HOST))
+                       return -ENODEV;
+
+               bridge = devm_pci_alloc_host_bridge(dev, sizeof(*rc));
+               if (!bridge)
+                       return -ENOMEM;
+
+               if (!data->byte_access_allowed)
+                       bridge->ops = &cdns_ti_pcie_host_ops;
+               rc = pci_host_bridge_priv(bridge);
+               rc->quirk_retrain_flag = data->quirk_retrain_flag;
+               rc->quirk_detect_quiet_flag = data->quirk_detect_quiet_flag;
+
+               cdns_pcie = &rc->pcie;
+               cdns_pcie->dev = dev;
+               cdns_pcie->ops = &j721e_pcie_ops;
+               pcie->cdns_pcie = cdns_pcie;
+               break;
+       case PCI_MODE_EP:
+               if (!IS_ENABLED(CONFIG_PCIE_CADENCE_EP))
+                       return -ENODEV;
+
+               ep = devm_kzalloc(dev, sizeof(*ep), GFP_KERNEL);
+               if (!ep)
+                       return -ENOMEM;
+
+               ep->quirk_detect_quiet_flag = data->quirk_detect_quiet_flag;
+
+               cdns_pcie = &ep->pcie;
+               cdns_pcie->dev = dev;
+               cdns_pcie->ops = &j721e_pcie_ops;
+               pcie->cdns_pcie = cdns_pcie;
+               break;
+       default:
+               dev_err(dev, "INVALID device type %d\n", mode);
+               return 0;
+       }
+
        pcie->mode = mode;
        pcie->linkdown_irq_regfield = data->linkdown_irq_regfield;
 
@@ -426,28 +466,6 @@ static int j721e_pcie_probe(struct platform_device *pdev)
 
        switch (mode) {
        case PCI_MODE_RC:
-               if (!IS_ENABLED(CONFIG_PCIE_CADENCE_HOST)) {
-                       ret = -ENODEV;
-                       goto err_get_sync;
-               }
-
-               bridge = devm_pci_alloc_host_bridge(dev, sizeof(*rc));
-               if (!bridge) {
-                       ret = -ENOMEM;
-                       goto err_get_sync;
-               }
-
-               if (!data->byte_access_allowed)
-                       bridge->ops = &cdns_ti_pcie_host_ops;
-               rc = pci_host_bridge_priv(bridge);
-               rc->quirk_retrain_flag = data->quirk_retrain_flag;
-               rc->quirk_detect_quiet_flag = data->quirk_detect_quiet_flag;
-
-               cdns_pcie = &rc->pcie;
-               cdns_pcie->dev = dev;
-               cdns_pcie->ops = &j721e_pcie_ops;
-               pcie->cdns_pcie = cdns_pcie;
-
                gpiod = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
                if (IS_ERR(gpiod)) {
                        ret = PTR_ERR(gpiod);
@@ -497,23 +515,6 @@ static int j721e_pcie_probe(struct platform_device *pdev)
 
                break;
        case PCI_MODE_EP:
-               if (!IS_ENABLED(CONFIG_PCIE_CADENCE_EP)) {
-                       ret = -ENODEV;
-                       goto err_get_sync;
-               }
-
-               ep = devm_kzalloc(dev, sizeof(*ep), GFP_KERNEL);
-               if (!ep) {
-                       ret = -ENOMEM;
-                       goto err_get_sync;
-               }
-               ep->quirk_detect_quiet_flag = data->quirk_detect_quiet_flag;
-
-               cdns_pcie = &ep->pcie;
-               cdns_pcie->dev = dev;
-               cdns_pcie->ops = &j721e_pcie_ops;
-               pcie->cdns_pcie = cdns_pcie;
-
                ret = cdns_pcie_init_phy(dev, cdns_pcie);
                if (ret) {
                        dev_err(dev, "Failed to init phy\n");
@@ -525,8 +526,6 @@ static int j721e_pcie_probe(struct platform_device *pdev)
                        goto err_pcie_setup;
 
                break;
-       default:
-               dev_err(dev, "INVALID device type %d\n", mode);
        }
 
        return 0;
index fa6886d..c625fc6 100644 (file)
@@ -756,22 +756,28 @@ static int __exit kirin_pcie_remove(struct platform_device *pdev)
        return 0;
 }
 
+struct kirin_pcie_data {
+       enum pcie_kirin_phy_type        phy_type;
+};
+
+static const struct kirin_pcie_data kirin_960_data = {
+       .phy_type = PCIE_KIRIN_INTERNAL_PHY,
+};
+
+static const struct kirin_pcie_data kirin_970_data = {
+       .phy_type = PCIE_KIRIN_EXTERNAL_PHY,
+};
+
 static const struct of_device_id kirin_pcie_match[] = {
-       {
-               .compatible = "hisilicon,kirin960-pcie",
-               .data = (void *)PCIE_KIRIN_INTERNAL_PHY
-       },
-       {
-               .compatible = "hisilicon,kirin970-pcie",
-               .data = (void *)PCIE_KIRIN_EXTERNAL_PHY
-       },
+       { .compatible = "hisilicon,kirin960-pcie", .data = &kirin_960_data },
+       { .compatible = "hisilicon,kirin970-pcie", .data = &kirin_970_data },
        {},
 };
 
 static int kirin_pcie_probe(struct platform_device *pdev)
 {
-       enum pcie_kirin_phy_type phy_type;
        struct device *dev = &pdev->dev;
+       const struct kirin_pcie_data *data;
        struct kirin_pcie *kirin_pcie;
        struct dw_pcie *pci;
        int ret;
@@ -781,13 +787,12 @@ static int kirin_pcie_probe(struct platform_device *pdev)
                return -EINVAL;
        }
 
-       phy_type = (long)of_device_get_match_data(dev);
-       if (!phy_type) {
+       data = of_device_get_match_data(dev);
+       if (!data) {
                dev_err(dev, "OF data missing\n");
                return -EINVAL;
        }
 
-
        kirin_pcie = devm_kzalloc(dev, sizeof(struct kirin_pcie), GFP_KERNEL);
        if (!kirin_pcie)
                return -ENOMEM;
@@ -800,7 +805,7 @@ static int kirin_pcie_probe(struct platform_device *pdev)
        pci->ops = &kirin_dw_pcie_ops;
        pci->pp.ops = &kirin_pcie_host_ops;
        kirin_pcie->pci = pci;
-       kirin_pcie->type = phy_type;
+       kirin_pcie->type = data->phy_type;
 
        ret = kirin_pcie_get_resource(kirin_pcie, pdev);
        if (ret)
index 3824862..33eb37a 100644 (file)
@@ -109,15 +109,6 @@ static inline void pcie_write(struct mt7621_pcie *pcie, u32 val, u32 reg)
        writel_relaxed(val, pcie->base + reg);
 }
 
-static inline void pcie_rmw(struct mt7621_pcie *pcie, u32 reg, u32 clr, u32 set)
-{
-       u32 val = readl_relaxed(pcie->base + reg);
-
-       val &= ~clr;
-       val |= set;
-       writel_relaxed(val, pcie->base + reg);
-}
-
 static inline u32 pcie_port_read(struct mt7621_pcie_port *port, u32 reg)
 {
        return readl_relaxed(port->base + reg);
@@ -557,7 +548,7 @@ static struct platform_driver mt7621_pcie_driver = {
        .remove = mt7621_pcie_remove,
        .driver = {
                .name = "mt7621-pci",
-               .of_match_table = of_match_ptr(mt7621_pcie_ids),
+               .of_match_table = mt7621_pcie_ids,
        },
 };
 builtin_platform_driver(mt7621_pcie_driver);
index 0d63541..e9cf318 100644 (file)
@@ -28,6 +28,7 @@ void pci_msi_teardown_msi_irqs(struct pci_dev *dev)
                msi_domain_free_irqs_descs_locked(domain, &dev->dev);
        else
                pci_msi_legacy_teardown_msi_irqs(dev);
+       msi_free_msi_descs(&dev->dev);
 }
 
 /**
@@ -171,8 +172,7 @@ struct irq_domain *pci_msi_create_irq_domain(struct fwnode_handle *fwnode,
        if (info->flags & MSI_FLAG_USE_DEF_CHIP_OPS)
                pci_msi_domain_update_chip_ops(info);
 
-       info->flags |= MSI_FLAG_ACTIVATE_EARLY | MSI_FLAG_DEV_SYSFS |
-                      MSI_FLAG_FREE_MSI_DESCS;
+       info->flags |= MSI_FLAG_ACTIVATE_EARLY | MSI_FLAG_DEV_SYSFS;
        if (IS_ENABLED(CONFIG_GENERIC_IRQ_RESERVATION_MODE))
                info->flags |= MSI_FLAG_MUST_REACTIVATE;
 
index cdbb468..db761ad 100644 (file)
@@ -77,5 +77,4 @@ void pci_msi_legacy_teardown_msi_irqs(struct pci_dev *dev)
 {
        msi_device_destroy_sysfs(&dev->dev);
        arch_teardown_msi_irqs(dev);
-       msi_free_msi_descs(&dev->dev);
 }
index c19c7ca..9037a78 100644 (file)
@@ -1111,7 +1111,8 @@ const struct cpumask *pci_irq_get_affinity(struct pci_dev *dev, int nr)
        if (!desc)
                return cpu_possible_mask;
 
-       if (WARN_ON_ONCE(!desc->affinity))
+       /* MSI[X] interrupts can be allocated without affinity descriptor */
+       if (!desc->affinity)
                return NULL;
 
        /*
index 08c364d..f64d29f 100644 (file)
@@ -42,9 +42,9 @@ obj-$(CONFIG_PINCTRL_PISTACHIO)       += pinctrl-pistachio.o
 obj-$(CONFIG_PINCTRL_RK805)    += pinctrl-rk805.o
 obj-$(CONFIG_PINCTRL_ROCKCHIP) += pinctrl-rockchip.o
 obj-$(CONFIG_PINCTRL_SINGLE)   += pinctrl-single.o
+obj-$(CONFIG_PINCTRL_ST)       += pinctrl-st.o
 obj-$(CONFIG_PINCTRL_STARFIVE) += pinctrl-starfive.o
 obj-$(CONFIG_PINCTRL_STMFX)    += pinctrl-stmfx.o
-obj-$(CONFIG_PINCTRL_ST)       += pinctrl-st.o
 obj-$(CONFIG_PINCTRL_SX150X)   += pinctrl-sx150x.o
 obj-$(CONFIG_PINCTRL_TB10X)    += pinctrl-tb10x.o
 obj-$(CONFIG_PINCTRL_THUNDERBAY) += pinctrl-thunderbay.o
index 5123f4c..ac1e400 100644 (file)
@@ -35,6 +35,7 @@ config PINCTRL_BCM63XX
        select PINCONF
        select GENERIC_PINCONF
        select GPIOLIB
+       select REGMAP
        select GPIO_REGMAP
 
 config PINCTRL_BCM6318
index c4ebfa8..47e433e 100644 (file)
@@ -1269,16 +1269,18 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
                                     sizeof(*girq->parents),
                                     GFP_KERNEL);
        if (!girq->parents) {
-               pinctrl_remove_gpio_range(pc->pctl_dev, &pc->gpio_range);
-               return -ENOMEM;
+               err = -ENOMEM;
+               goto out_remove;
        }
 
        if (is_7211) {
                pc->wake_irq = devm_kcalloc(dev, BCM2835_NUM_IRQS,
                                            sizeof(*pc->wake_irq),
                                            GFP_KERNEL);
-               if (!pc->wake_irq)
-                       return -ENOMEM;
+               if (!pc->wake_irq) {
+                       err = -ENOMEM;
+                       goto out_remove;
+               }
        }
 
        /*
@@ -1306,8 +1308,10 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
 
                len = strlen(dev_name(pc->dev)) + 16;
                name = devm_kzalloc(pc->dev, len, GFP_KERNEL);
-               if (!name)
-                       return -ENOMEM;
+               if (!name) {
+                       err = -ENOMEM;
+                       goto out_remove;
+               }
 
                snprintf(name, len, "%s:bank%d", dev_name(pc->dev), i);
 
@@ -1326,11 +1330,14 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
        err = gpiochip_add_data(&pc->gpio_chip, pc);
        if (err) {
                dev_err(dev, "could not add GPIO chip\n");
-               pinctrl_remove_gpio_range(pc->pctl_dev, &pc->gpio_range);
-               return err;
+               goto out_remove;
        }
 
        return 0;
+
+out_remove:
+       pinctrl_remove_gpio_range(pc->pctl_dev, &pc->gpio_range);
+       return err;
 }
 
 static struct platform_driver bcm2835_pinctrl_driver = {
index abffda1..1d58182 100644 (file)
@@ -1471,8 +1471,9 @@ static void chv_gpio_irq_handler(struct irq_desc *desc)
 
                offset = cctx->intr_lines[intr_line];
                if (offset == CHV_INVALID_HWIRQ) {
-                       dev_err(dev, "interrupt on unused interrupt line %u\n", intr_line);
-                       continue;
+                       dev_warn_once(dev, "interrupt on unmapped interrupt line %u\n", intr_line);
+                       /* Some boards expect hwirq 0 to trigger in this case */
+                       offset = 0;
                }
 
                generic_handle_domain_irq(gc->irq.domain, offset);
index 8575097..826d494 100644 (file)
@@ -451,8 +451,8 @@ static void intel_gpio_set_gpio_mode(void __iomem *padcfg0)
        value &= ~PADCFG0_PMODE_MASK;
        value |= PADCFG0_PMODE_GPIO;
 
-       /* Disable input and output buffers */
-       value |= PADCFG0_GPIORXDIS;
+       /* Disable TX buffer and enable RX (this will be input) */
+       value &= ~PADCFG0_GPIORXDIS;
        value |= PADCFG0_GPIOTXDIS;
 
        /* Disable SCI/SMI/NMI generation */
@@ -497,9 +497,6 @@ static int intel_gpio_request_enable(struct pinctrl_dev *pctldev,
 
        intel_gpio_set_gpio_mode(padcfg0);
 
-       /* Disable TX buffer and enable RX (this will be input) */
-       __intel_gpio_set_direction(padcfg0, true);
-
        raw_spin_unlock_irqrestore(&pctrl->lock, flags);
 
        return 0;
@@ -1115,9 +1112,6 @@ static int intel_gpio_irq_type(struct irq_data *d, unsigned int type)
 
        intel_gpio_set_gpio_mode(reg);
 
-       /* Disable TX buffer and enable RX (this will be input) */
-       __intel_gpio_set_direction(reg, true);
-
        value = readl(reg);
 
        value &= ~(PADCFG0_RXEVCFG_MASK | PADCFG0_RXINV);
@@ -1216,6 +1210,39 @@ static irqreturn_t intel_gpio_irq(int irq, void *data)
        return IRQ_RETVAL(ret);
 }
 
+static void intel_gpio_irq_init(struct intel_pinctrl *pctrl)
+{
+       int i;
+
+       for (i = 0; i < pctrl->ncommunities; i++) {
+               const struct intel_community *community;
+               void __iomem *base;
+               unsigned int gpp;
+
+               community = &pctrl->communities[i];
+               base = community->regs;
+
+               for (gpp = 0; gpp < community->ngpps; gpp++) {
+                       /* Mask and clear all interrupts */
+                       writel(0, base + community->ie_offset + gpp * 4);
+                       writel(0xffff, base + community->is_offset + gpp * 4);
+               }
+       }
+}
+
+static int intel_gpio_irq_init_hw(struct gpio_chip *gc)
+{
+       struct intel_pinctrl *pctrl = gpiochip_get_data(gc);
+
+       /*
+        * Make sure the interrupt lines are in a proper state before
+        * further configuration.
+        */
+       intel_gpio_irq_init(pctrl);
+
+       return 0;
+}
+
 static int intel_gpio_add_community_ranges(struct intel_pinctrl *pctrl,
                                const struct intel_community *community)
 {
@@ -1320,6 +1347,7 @@ static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq)
        girq->num_parents = 0;
        girq->default_type = IRQ_TYPE_NONE;
        girq->handler = handle_bad_irq;
+       girq->init_hw = intel_gpio_irq_init_hw;
 
        ret = devm_gpiochip_add_data(pctrl->dev, &pctrl->chip, pctrl);
        if (ret) {
@@ -1695,26 +1723,6 @@ int intel_pinctrl_suspend_noirq(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(intel_pinctrl_suspend_noirq);
 
-static void intel_gpio_irq_init(struct intel_pinctrl *pctrl)
-{
-       size_t i;
-
-       for (i = 0; i < pctrl->ncommunities; i++) {
-               const struct intel_community *community;
-               void __iomem *base;
-               unsigned int gpp;
-
-               community = &pctrl->communities[i];
-               base = community->regs;
-
-               for (gpp = 0; gpp < community->ngpps; gpp++) {
-                       /* Mask and clear all interrupts */
-                       writel(0, base + community->ie_offset + gpp * 4);
-                       writel(0xffff, base + community->is_offset + gpp * 4);
-               }
-       }
-}
-
 static bool intel_gpio_update_reg(void __iomem *reg, u32 mask, u32 value)
 {
        u32 curr, updated;
index 8e081c9..639f113 100644 (file)
@@ -137,7 +137,8 @@ static inline int sgpio_addr_to_pin(struct sgpio_priv *priv, int port, int bit)
 
 static inline u32 sgpio_get_addr(struct sgpio_priv *priv, u32 rno, u32 off)
 {
-       return priv->properties->regoff[rno] + off;
+       return (priv->properties->regoff[rno] + off) *
+               regmap_get_reg_stride(priv->regs);
 }
 
 static u32 sgpio_readl(struct sgpio_priv *priv, u32 rno, u32 off)
index b5b47f4..79d44bc 100644 (file)
@@ -773,63 +773,42 @@ static int thunderbay_build_groups(struct thunderbay_pinctrl *tpc)
 
 static int thunderbay_add_functions(struct thunderbay_pinctrl *tpc, struct function_desc *funcs)
 {
-       struct function_desc *function = funcs;
        int i;
 
        /* Assign the groups for each function */
-       for (i = 0; i < tpc->soc->npins; i++) {
-               const struct pinctrl_pin_desc *pin_info = thunderbay_pins + i;
-               struct thunderbay_mux_desc *pin_mux = pin_info->drv_data;
-
-               while (pin_mux->name) {
-                       const char **grp;
-                       int j, grp_num, match = 0;
-                       size_t grp_size;
-                       struct function_desc *func;
-
-                       for (j = 0; j < tpc->nfuncs; j++) {
-                               if (!strcmp(pin_mux->name, function[j].name)) {
-                                       match = 1;
-                                       break;
-                               }
-                       }
-
-                       if (!match)
-                               return -EINVAL;
-
-                       func = function + j;
-                       grp_num = func->num_group_names;
-                       grp_size = sizeof(*func->group_names);
-
-                       if (!func->group_names) {
-                               func->group_names = devm_kcalloc(tpc->dev,
-                                                                grp_num,
-                                                                grp_size,
-                                                                GFP_KERNEL);
-                               if (!func->group_names) {
-                                       kfree(func);
-                                       return -ENOMEM;
-                               }
+       for (i = 0; i < tpc->nfuncs; i++) {
+               struct function_desc *func = &funcs[i];
+               const char **group_names;
+               unsigned int grp_idx = 0;
+               int j;
+
+               group_names = devm_kcalloc(tpc->dev, func->num_group_names,
+                                          sizeof(*group_names), GFP_KERNEL);
+               if (!group_names)
+                       return -ENOMEM;
+
+               for (j = 0; j < tpc->soc->npins; j++) {
+                       const struct pinctrl_pin_desc *pin_info = &thunderbay_pins[j];
+                       struct thunderbay_mux_desc *pin_mux;
+
+                       for (pin_mux = pin_info->drv_data; pin_mux->name; pin_mux++) {
+                               if (!strcmp(pin_mux->name, func->name))
+                                       group_names[grp_idx++] = pin_info->name;
                        }
-
-                       grp = func->group_names;
-                       while (*grp)
-                               grp++;
-
-                       *grp = pin_info->name;
-                       pin_mux++;
                }
+
+               func->group_names = group_names;
        }
 
        /* Add all functions */
        for (i = 0; i < tpc->nfuncs; i++) {
                pinmux_generic_add_function(tpc->pctrl,
-                                           function[i].name,
-                                           function[i].group_names,
-                                           function[i].num_group_names,
-                                           function[i].data);
+                                           funcs[i].name,
+                                           funcs[i].group_names,
+                                           funcs[i].num_group_names,
+                                           funcs[i].data);
        }
-       kfree(function);
+       kfree(funcs);
        return 0;
 }
 
@@ -839,27 +818,30 @@ static int thunderbay_build_functions(struct thunderbay_pinctrl *tpc)
        void *ptr;
        int pin;
 
-       /* Total number of functions is unknown at this point. Allocate first. */
+       /*
+        * Allocate maximum possible number of functions. Assume every pin
+        * being part of 8 (hw maximum) globally unique muxes.
+        */
        tpc->nfuncs = 0;
        thunderbay_funcs = kcalloc(tpc->soc->npins * 8,
                                   sizeof(*thunderbay_funcs), GFP_KERNEL);
        if (!thunderbay_funcs)
                return -ENOMEM;
 
-       /* Find total number of functions and each's properties */
+       /* Setup 1 function for each unique mux */
        for (pin = 0; pin < tpc->soc->npins; pin++) {
                const struct pinctrl_pin_desc *pin_info = thunderbay_pins + pin;
-               struct thunderbay_mux_desc *pin_mux = pin_info->drv_data;
+               struct thunderbay_mux_desc *pin_mux;
 
-               while (pin_mux->name) {
-                       struct function_desc *func = thunderbay_funcs;
+               for (pin_mux = pin_info->drv_data; pin_mux->name; pin_mux++) {
+                       struct function_desc *func;
 
-                       while (func->name) {
+                       /* Check if we already have function for this mux */
+                       for (func = thunderbay_funcs; func->name; func++) {
                                if (!strcmp(pin_mux->name, func->name)) {
                                        func->num_group_names++;
                                        break;
                                }
-                               func++;
                        }
 
                        if (!func->name) {
@@ -868,8 +850,6 @@ static int thunderbay_build_functions(struct thunderbay_pinctrl *tpc)
                                func->data = (int *)&pin_mux->mode;
                                tpc->nfuncs++;
                        }
-
-                       pin_mux++;
                }
        }
 
index 42da6bd..e140122 100644 (file)
@@ -809,7 +809,6 @@ static int zynqmp_pinctrl_prepare_pin_desc(struct device *dev,
                                           unsigned int *npins)
 {
        struct pinctrl_pin_desc *pins, *pin;
-       char **pin_names;
        int ret;
        int i;
 
@@ -821,14 +820,13 @@ static int zynqmp_pinctrl_prepare_pin_desc(struct device *dev,
        if (!pins)
                return -ENOMEM;
 
-       pin_names = devm_kasprintf_strarray(dev, ZYNQMP_PIN_PREFIX, *npins);
-       if (IS_ERR(pin_names))
-               return PTR_ERR(pin_names);
-
        for (i = 0; i < *npins; i++) {
                pin = &pins[i];
                pin->number = i;
-               pin->name = pin_names[i];
+               pin->name = devm_kasprintf(dev, GFP_KERNEL, "%s%d",
+                                          ZYNQMP_PIN_PREFIX, i);
+               if (!pin->name)
+                       return -ENOMEM;
        }
 
        *zynqmp_pins = pins;
index 2e490e7..4102ce9 100644 (file)
@@ -585,13 +585,11 @@ static const struct samsung_pin_ctrl exynos850_pin_ctrl[] __initconst = {
                /* pin-controller instance 0 ALIVE data */
                .pin_banks      = exynos850_pin_banks0,
                .nr_banks       = ARRAY_SIZE(exynos850_pin_banks0),
-               .eint_gpio_init = exynos_eint_gpio_init,
                .eint_wkup_init = exynos_eint_wkup_init,
        }, {
                /* pin-controller instance 1 CMGP data */
                .pin_banks      = exynos850_pin_banks1,
                .nr_banks       = ARRAY_SIZE(exynos850_pin_banks1),
-               .eint_gpio_init = exynos_eint_gpio_init,
                .eint_wkup_init = exynos_eint_wkup_init,
        }, {
                /* pin-controller instance 2 AUD data */
index 0489c89..a158d58 100644 (file)
@@ -465,6 +465,10 @@ static const struct of_device_id exynos_wkup_irq_ids[] = {
                        .data = &exynos4210_wkup_irq_chip },
        { .compatible = "samsung,exynos7-wakeup-eint",
                        .data = &exynos7_wkup_irq_chip },
+       { .compatible = "samsung,exynos850-wakeup-eint",
+                       .data = &exynos7_wkup_irq_chip },
+       { .compatible = "samsung,exynosautov9-wakeup-eint",
+                       .data = &exynos7_wkup_irq_chip },
        { }
 };
 
index 0f6e930..568b6e6 100644 (file)
@@ -1002,13 +1002,66 @@ samsung_pinctrl_get_soc_data_for_of_alias(struct platform_device *pdev)
        return &(of_data->ctrl[id]);
 }
 
+static void samsung_banks_of_node_put(struct samsung_pinctrl_drv_data *d)
+{
+       struct samsung_pin_bank *bank;
+       unsigned int i;
+
+       bank = d->pin_banks;
+       for (i = 0; i < d->nr_banks; ++i, ++bank)
+               of_node_put(bank->of_node);
+}
+
+/*
+ * Iterate over all driver pin banks to find one matching the name of node,
+ * skipping optional "-gpio" node suffix. When found, assign node to the bank.
+ */
+static void samsung_banks_of_node_get(struct device *dev,
+                                     struct samsung_pinctrl_drv_data *d,
+                                     struct device_node *node)
+{
+       const char *suffix = "-gpio-bank";
+       struct samsung_pin_bank *bank;
+       struct device_node *child;
+       /* Pin bank names are up to 4 characters */
+       char node_name[20];
+       unsigned int i;
+       size_t len;
+
+       bank = d->pin_banks;
+       for (i = 0; i < d->nr_banks; ++i, ++bank) {
+               strscpy(node_name, bank->name, sizeof(node_name));
+               len = strlcat(node_name, suffix, sizeof(node_name));
+               if (len >= sizeof(node_name)) {
+                       dev_err(dev, "Too long pin bank name '%s', ignoring\n",
+                               bank->name);
+                       continue;
+               }
+
+               for_each_child_of_node(node, child) {
+                       if (!of_find_property(child, "gpio-controller", NULL))
+                               continue;
+                       if (of_node_name_eq(child, node_name))
+                               break;
+                       else if (of_node_name_eq(child, bank->name))
+                               break;
+               }
+
+               if (child)
+                       bank->of_node = child;
+               else
+                       dev_warn(dev, "Missing node for bank %s - invalid DTB\n",
+                                bank->name);
+               /* child reference dropped in samsung_drop_banks_of_node() */
+       }
+}
+
 /* retrieve the soc specific data */
 static const struct samsung_pin_ctrl *
 samsung_pinctrl_get_soc_data(struct samsung_pinctrl_drv_data *d,
                             struct platform_device *pdev)
 {
        struct device_node *node = pdev->dev.of_node;
-       struct device_node *np;
        const struct samsung_pin_bank_data *bdata;
        const struct samsung_pin_ctrl *ctrl;
        struct samsung_pin_bank *bank;
@@ -1072,17 +1125,7 @@ samsung_pinctrl_get_soc_data(struct samsung_pinctrl_drv_data *d,
         */
        d->virt_base = virt_base[0];
 
-       for_each_child_of_node(node, np) {
-               if (!of_find_property(np, "gpio-controller", NULL))
-                       continue;
-               bank = d->pin_banks;
-               for (i = 0; i < d->nr_banks; ++i, ++bank) {
-                       if (of_node_name_eq(np, bank->name)) {
-                               bank->of_node = np;
-                               break;
-                       }
-               }
-       }
+       samsung_banks_of_node_get(&pdev->dev, d, node);
 
        d->pin_base = pin_base;
        pin_base += d->nr_pins;
@@ -1117,19 +1160,19 @@ static int samsung_pinctrl_probe(struct platform_device *pdev)
        if (ctrl->retention_data) {
                drvdata->retention_ctrl = ctrl->retention_data->init(drvdata,
                                                          ctrl->retention_data);
-               if (IS_ERR(drvdata->retention_ctrl))
-                       return PTR_ERR(drvdata->retention_ctrl);
+               if (IS_ERR(drvdata->retention_ctrl)) {
+                       ret = PTR_ERR(drvdata->retention_ctrl);
+                       goto err_put_banks;
+               }
        }
 
        ret = samsung_pinctrl_register(pdev, drvdata);
        if (ret)
-               return ret;
+               goto err_put_banks;
 
        ret = samsung_gpiolib_register(pdev, drvdata);
-       if (ret) {
-               samsung_pinctrl_unregister(pdev, drvdata);
-               return ret;
-       }
+       if (ret)
+               goto err_unregister;
 
        if (ctrl->eint_gpio_init)
                ctrl->eint_gpio_init(drvdata);
@@ -1139,6 +1182,12 @@ static int samsung_pinctrl_probe(struct platform_device *pdev)
        platform_set_drvdata(pdev, drvdata);
 
        return 0;
+
+err_unregister:
+       samsung_pinctrl_unregister(pdev, drvdata);
+err_put_banks:
+       samsung_banks_of_node_put(drvdata);
+       return ret;
 }
 
 /*
index ce1917e..152b712 100644 (file)
@@ -363,16 +363,16 @@ static const struct sunxi_desc_pin h616_pins[] = {
                  SUNXI_FUNCTION(0x0, "gpio_in"),
                  SUNXI_FUNCTION(0x1, "gpio_out"),
                  SUNXI_FUNCTION(0x2, "uart2"),         /* CTS */
-                 SUNXI_FUNCTION(0x3, "i2s3"),  /* DO0 */
+                 SUNXI_FUNCTION(0x3, "i2s3_dout0"),    /* DO0 */
                  SUNXI_FUNCTION(0x4, "spi1"),          /* MISO */
-                 SUNXI_FUNCTION(0x5, "i2s3"),  /* DI1 */
+                 SUNXI_FUNCTION(0x5, "i2s3_din1"),     /* DI1 */
                  SUNXI_FUNCTION_IRQ_BANK(0x6, 6, 8)),  /* PH_EINT8 */
        SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 9),
                  SUNXI_FUNCTION(0x0, "gpio_in"),
                  SUNXI_FUNCTION(0x1, "gpio_out"),
-                 SUNXI_FUNCTION(0x3, "i2s3"),  /* DI0 */
+                 SUNXI_FUNCTION(0x3, "i2s3_din0"),     /* DI0 */
                  SUNXI_FUNCTION(0x4, "spi1"),          /* CS1 */
-                 SUNXI_FUNCTION(0x3, "i2s3"),  /* DO1 */
+                 SUNXI_FUNCTION(0x5, "i2s3_dout1"),    /* DO1 */
                  SUNXI_FUNCTION_IRQ_BANK(0x6, 6, 9)),  /* PH_EINT9 */
        SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 10),
                  SUNXI_FUNCTION(0x0, "gpio_in"),
index 5f0578e..463f1ec 100644 (file)
@@ -5,6 +5,7 @@
 
 menuconfig SURFACE_PLATFORMS
        bool "Microsoft Surface Platform-Specific Device Drivers"
+       depends on ARM64 || X86 || COMPILE_TEST
        default y
        help
          Say Y here to get to see options for platform-specific device drivers
index f794343..4c72ba6 100644 (file)
@@ -124,9 +124,10 @@ struct amd_pmc_dev {
        u32 cpu_id;
        u32 active_ips;
 /* SMU version information */
-       u16 major;
-       u16 minor;
-       u16 rev;
+       u8 smu_program;
+       u8 major;
+       u8 minor;
+       u8 rev;
        struct device *dev;
        struct pci_dev *rdev;
        struct mutex lock; /* generic mutex lock */
@@ -180,11 +181,13 @@ static int amd_pmc_get_smu_version(struct amd_pmc_dev *dev)
        if (rc)
                return rc;
 
-       dev->major = (val >> 16) & GENMASK(15, 0);
+       dev->smu_program = (val >> 24) & GENMASK(7, 0);
+       dev->major = (val >> 16) & GENMASK(7, 0);
        dev->minor = (val >> 8) & GENMASK(7, 0);
        dev->rev = (val >> 0) & GENMASK(7, 0);
 
-       dev_dbg(dev->dev, "SMU version is %u.%u.%u\n", dev->major, dev->minor, dev->rev);
+       dev_dbg(dev->dev, "SMU program %u version is %u.%u.%u\n",
+               dev->smu_program, dev->major, dev->minor, dev->rev);
 
        return 0;
 }
@@ -226,7 +229,7 @@ static int amd_pmc_stb_debugfs_release(struct inode *inode, struct file *filp)
        return 0;
 }
 
-const struct file_operations amd_pmc_stb_debugfs_fops = {
+static const struct file_operations amd_pmc_stb_debugfs_fops = {
        .owner = THIS_MODULE,
        .open = amd_pmc_stb_debugfs_open,
        .read = amd_pmc_stb_debugfs_read,
index d4ef8f3..6fd0c9f 100644 (file)
@@ -250,7 +250,7 @@ static int tf103c_dock_hid_raw_request(struct hid_device *hid, u8 reportnum,
        return 0;
 }
 
-struct hid_ll_driver tf103c_dock_hid_ll_driver = {
+static struct hid_ll_driver tf103c_dock_hid_ll_driver = {
        .parse = tf103c_dock_hid_parse,
        .start = tf103c_dock_hid_start,
        .stop = tf103c_dock_hid_stop,
@@ -921,7 +921,7 @@ static int __maybe_unused tf103c_dock_resume(struct device *dev)
        return 0;
 }
 
-SIMPLE_DEV_PM_OPS(tf103c_dock_pm_ops, tf103c_dock_suspend, tf103c_dock_resume);
+static SIMPLE_DEV_PM_OPS(tf103c_dock_pm_ops, tf103c_dock_suspend, tf103c_dock_resume);
 
 static const struct acpi_device_id tf103c_dock_acpi_match[] = {
        {"NPCE69A"},
index 0374bc7..e4299cf 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/regmap.h>
 
 #define CHGRIRQ_REG                                    0x0a
+#define MCHGRIRQ_REG                                   0x17
 
 struct crystal_cove_charger_data {
        struct mutex buslock; /* irq_bus_lock */
@@ -25,8 +26,8 @@ struct crystal_cove_charger_data {
        struct irq_domain *irq_domain;
        int irq;
        int charger_irq;
-       bool irq_enabled;
-       bool irq_is_enabled;
+       u8 mask;
+       u8 new_mask;
 };
 
 static irqreturn_t crystal_cove_charger_irq(int irq, void *data)
@@ -53,13 +54,9 @@ static void crystal_cove_charger_irq_bus_sync_unlock(struct irq_data *data)
 {
        struct crystal_cove_charger_data *charger = irq_data_get_irq_chip_data(data);
 
-       if (charger->irq_is_enabled != charger->irq_enabled) {
-               if (charger->irq_enabled)
-                       enable_irq(charger->irq);
-               else
-                       disable_irq(charger->irq);
-
-               charger->irq_is_enabled = charger->irq_enabled;
+       if (charger->mask != charger->new_mask) {
+               regmap_write(charger->regmap, MCHGRIRQ_REG, charger->new_mask);
+               charger->mask = charger->new_mask;
        }
 
        mutex_unlock(&charger->buslock);
@@ -69,14 +66,14 @@ static void crystal_cove_charger_irq_unmask(struct irq_data *data)
 {
        struct crystal_cove_charger_data *charger = irq_data_get_irq_chip_data(data);
 
-       charger->irq_enabled = true;
+       charger->new_mask &= ~BIT(data->hwirq);
 }
 
 static void crystal_cove_charger_irq_mask(struct irq_data *data)
 {
        struct crystal_cove_charger_data *charger = irq_data_get_irq_chip_data(data);
 
-       charger->irq_enabled = false;
+       charger->new_mask |= BIT(data->hwirq);
 }
 
 static void crystal_cove_charger_rm_irq_domain(void *data)
@@ -130,10 +127,13 @@ static int crystal_cove_charger_probe(struct platform_device *pdev)
        irq_set_nested_thread(charger->charger_irq, true);
        irq_set_noprobe(charger->charger_irq);
 
+       /* Mask the single 2nd level IRQ before enabling the 1st level IRQ */
+       charger->mask = charger->new_mask = BIT(0);
+       regmap_write(charger->regmap, MCHGRIRQ_REG, charger->mask);
+
        ret = devm_request_threaded_irq(&pdev->dev, charger->irq, NULL,
                                        crystal_cove_charger_irq,
-                                       IRQF_ONESHOT | IRQF_NO_AUTOEN,
-                                       KBUILD_MODNAME, charger);
+                                       IRQF_ONESHOT, KBUILD_MODNAME, charger);
        if (ret)
                return dev_err_probe(&pdev->dev, ret, "requesting irq\n");
 
index c9a85eb..e8424e7 100644 (file)
@@ -596,7 +596,10 @@ static long isst_if_def_ioctl(struct file *file, unsigned int cmd,
        return ret;
 }
 
-static DEFINE_MUTEX(punit_misc_dev_lock);
+/* Lock to prevent module registration when already opened by user space */
+static DEFINE_MUTEX(punit_misc_dev_open_lock);
+/* Lock to allow one share misc device for all ISST interace */
+static DEFINE_MUTEX(punit_misc_dev_reg_lock);
 static int misc_usage_count;
 static int misc_device_ret;
 static int misc_device_open;
@@ -606,7 +609,7 @@ static int isst_if_open(struct inode *inode, struct file *file)
        int i, ret = 0;
 
        /* Fail open, if a module is going away */
-       mutex_lock(&punit_misc_dev_lock);
+       mutex_lock(&punit_misc_dev_open_lock);
        for (i = 0; i < ISST_IF_DEV_MAX; ++i) {
                struct isst_if_cmd_cb *cb = &punit_callbacks[i];
 
@@ -628,7 +631,7 @@ static int isst_if_open(struct inode *inode, struct file *file)
        } else {
                misc_device_open++;
        }
-       mutex_unlock(&punit_misc_dev_lock);
+       mutex_unlock(&punit_misc_dev_open_lock);
 
        return ret;
 }
@@ -637,7 +640,7 @@ static int isst_if_relase(struct inode *inode, struct file *f)
 {
        int i;
 
-       mutex_lock(&punit_misc_dev_lock);
+       mutex_lock(&punit_misc_dev_open_lock);
        misc_device_open--;
        for (i = 0; i < ISST_IF_DEV_MAX; ++i) {
                struct isst_if_cmd_cb *cb = &punit_callbacks[i];
@@ -645,7 +648,7 @@ static int isst_if_relase(struct inode *inode, struct file *f)
                if (cb->registered)
                        module_put(cb->owner);
        }
-       mutex_unlock(&punit_misc_dev_lock);
+       mutex_unlock(&punit_misc_dev_open_lock);
 
        return 0;
 }
@@ -662,6 +665,43 @@ static struct miscdevice isst_if_char_driver = {
        .fops           = &isst_if_char_driver_ops,
 };
 
+static int isst_misc_reg(void)
+{
+       mutex_lock(&punit_misc_dev_reg_lock);
+       if (misc_device_ret)
+               goto unlock_exit;
+
+       if (!misc_usage_count) {
+               misc_device_ret = isst_if_cpu_info_init();
+               if (misc_device_ret)
+                       goto unlock_exit;
+
+               misc_device_ret = misc_register(&isst_if_char_driver);
+               if (misc_device_ret) {
+                       isst_if_cpu_info_exit();
+                       goto unlock_exit;
+               }
+       }
+       misc_usage_count++;
+
+unlock_exit:
+       mutex_unlock(&punit_misc_dev_reg_lock);
+
+       return misc_device_ret;
+}
+
+static void isst_misc_unreg(void)
+{
+       mutex_lock(&punit_misc_dev_reg_lock);
+       if (misc_usage_count)
+               misc_usage_count--;
+       if (!misc_usage_count && !misc_device_ret) {
+               misc_deregister(&isst_if_char_driver);
+               isst_if_cpu_info_exit();
+       }
+       mutex_unlock(&punit_misc_dev_reg_lock);
+}
+
 /**
  * isst_if_cdev_register() - Register callback for IOCTL
  * @device_type: The device type this callback handling.
@@ -679,38 +719,31 @@ static struct miscdevice isst_if_char_driver = {
  */
 int isst_if_cdev_register(int device_type, struct isst_if_cmd_cb *cb)
 {
-       if (misc_device_ret)
-               return misc_device_ret;
+       int ret;
 
        if (device_type >= ISST_IF_DEV_MAX)
                return -EINVAL;
 
-       mutex_lock(&punit_misc_dev_lock);
+       mutex_lock(&punit_misc_dev_open_lock);
+       /* Device is already open, we don't want to add new callbacks */
        if (misc_device_open) {
-               mutex_unlock(&punit_misc_dev_lock);
+               mutex_unlock(&punit_misc_dev_open_lock);
                return -EAGAIN;
        }
-       if (!misc_usage_count) {
-               int ret;
-
-               misc_device_ret = misc_register(&isst_if_char_driver);
-               if (misc_device_ret)
-                       goto unlock_exit;
-
-               ret = isst_if_cpu_info_init();
-               if (ret) {
-                       misc_deregister(&isst_if_char_driver);
-                       misc_device_ret = ret;
-                       goto unlock_exit;
-               }
-       }
        memcpy(&punit_callbacks[device_type], cb, sizeof(*cb));
        punit_callbacks[device_type].registered = 1;
-       misc_usage_count++;
-unlock_exit:
-       mutex_unlock(&punit_misc_dev_lock);
+       mutex_unlock(&punit_misc_dev_open_lock);
 
-       return misc_device_ret;
+       ret = isst_misc_reg();
+       if (ret) {
+               /*
+                * No need of mutex as the misc device register failed
+                * as no one can open device yet. Hence no contention.
+                */
+               punit_callbacks[device_type].registered = 0;
+               return ret;
+       }
+       return 0;
 }
 EXPORT_SYMBOL_GPL(isst_if_cdev_register);
 
@@ -725,16 +758,12 @@ EXPORT_SYMBOL_GPL(isst_if_cdev_register);
  */
 void isst_if_cdev_unregister(int device_type)
 {
-       mutex_lock(&punit_misc_dev_lock);
-       misc_usage_count--;
+       isst_misc_unreg();
+       mutex_lock(&punit_misc_dev_open_lock);
        punit_callbacks[device_type].registered = 0;
        if (device_type == ISST_IF_DEV_MBOX)
                isst_delete_hash();
-       if (!misc_usage_count && !misc_device_ret) {
-               misc_deregister(&isst_if_char_driver);
-               isst_if_cpu_info_exit();
-       }
-       mutex_unlock(&punit_misc_dev_lock);
+       mutex_unlock(&punit_misc_dev_open_lock);
 }
 EXPORT_SYMBOL_GPL(isst_if_cdev_unregister);
 
index 098180f..bd04548 100644 (file)
@@ -8679,9 +8679,10 @@ static const struct attribute_group fan_driver_attr_group = {
        .attrs = fan_driver_attributes,
 };
 
-#define TPACPI_FAN_Q1  0x0001          /* Unitialized HFSP */
-#define TPACPI_FAN_2FAN        0x0002          /* EC 0x31 bit 0 selects fan2 */
-#define TPACPI_FAN_2CTL        0x0004          /* selects fan2 control */
+#define TPACPI_FAN_Q1          0x0001          /* Uninitialized HFSP */
+#define TPACPI_FAN_2FAN                0x0002          /* EC 0x31 bit 0 selects fan2 */
+#define TPACPI_FAN_2CTL                0x0004          /* selects fan2 control */
+#define TPACPI_FAN_NOFAN       0x0008          /* no fan available */
 
 static const struct tpacpi_quirk fan_quirk_table[] __initconst = {
        TPACPI_QEC_IBM('1', 'Y', TPACPI_FAN_Q1),
@@ -8702,6 +8703,7 @@ static const struct tpacpi_quirk fan_quirk_table[] __initconst = {
        TPACPI_Q_LNV3('N', '4', '0', TPACPI_FAN_2CTL),  /* P1 / X1 Extreme (4nd gen) */
        TPACPI_Q_LNV3('N', '3', '0', TPACPI_FAN_2CTL),  /* P15 (1st gen) / P15v (1st gen) */
        TPACPI_Q_LNV3('N', '3', '2', TPACPI_FAN_2CTL),  /* X1 Carbon (9th gen) */
+       TPACPI_Q_LNV3('N', '1', 'O', TPACPI_FAN_NOFAN), /* X1 Tablet (2nd gen) */
 };
 
 static int __init fan_init(struct ibm_init_struct *iibm)
@@ -8730,6 +8732,11 @@ static int __init fan_init(struct ibm_init_struct *iibm)
        quirks = tpacpi_check_quirks(fan_quirk_table,
                                     ARRAY_SIZE(fan_quirk_table));
 
+       if (quirks & TPACPI_FAN_NOFAN) {
+               pr_info("No integrated ThinkPad fan available\n");
+               return -ENODEV;
+       }
+
        if (gfan_handle) {
                /* 570, 600e/x, 770e, 770x */
                fan_status_access_mode = TPACPI_FAN_RD_ACPI_GFAN;
@@ -10112,6 +10119,9 @@ static struct ibm_struct proxsensor_driver_data = {
 #define DYTC_CMD_MMC_GET      8 /* To get current MMC function and mode */
 #define DYTC_CMD_RESET    0x1ff /* To reset back to default */
 
+#define DYTC_CMD_FUNC_CAP     3 /* To get DYTC capabilities */
+#define DYTC_FC_MMC           27 /* MMC Mode supported */
+
 #define DYTC_GET_FUNCTION_BIT 8  /* Bits  8-11 - function setting */
 #define DYTC_GET_MODE_BIT     12 /* Bits 12-15 - mode setting */
 
@@ -10324,6 +10334,15 @@ static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm)
        if (dytc_version < 5)
                return -ENODEV;
 
+       /* Check what capabilities are supported. Currently MMC is needed */
+       err = dytc_command(DYTC_CMD_FUNC_CAP, &output);
+       if (err)
+               return err;
+       if (!(output & BIT(DYTC_FC_MMC))) {
+               dbg_printk(TPACPI_DBG_INIT, " DYTC MMC mode not supported\n");
+               return -ENODEV;
+       }
+
        dbg_printk(TPACPI_DBG_INIT,
                        "DYTC version %d: thermal mode available\n", dytc_version);
        /*
index 494f230..bc97bfa 100644 (file)
@@ -770,6 +770,21 @@ static const struct ts_dmi_data predia_basic_data = {
        .properties     = predia_basic_props,
 };
 
+static const struct property_entry rwc_nanote_p8_props[] = {
+       PROPERTY_ENTRY_U32("touchscreen-min-y", 46),
+       PROPERTY_ENTRY_U32("touchscreen-size-x", 1728),
+       PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
+       PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
+       PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-rwc-nanote-p8.fw"),
+       PROPERTY_ENTRY_U32("silead,max-fingers", 10),
+       { }
+};
+
+static const struct ts_dmi_data rwc_nanote_p8_data = {
+       .acpi_name = "MSSL1680:00",
+       .properties = rwc_nanote_p8_props,
+};
+
 static const struct property_entry schneider_sct101ctm_props[] = {
        PROPERTY_ENTRY_U32("touchscreen-size-x", 1715),
        PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
@@ -1395,6 +1410,15 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
                },
        },
        {
+               /* RWC NANOTE P8 */
+               .driver_data = (void *)&rwc_nanote_p8_data,
+               .matches = {
+                       DMI_MATCH(DMI_BOARD_VENDOR, "Default string"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "AY07J"),
+                       DMI_MATCH(DMI_PRODUCT_SKU, "0001")
+               },
+       },
+       {
                /* Schneider SCT101CTM */
                .driver_data = (void *)&schneider_sct101ctm_data,
                .matches = {
index 3ba63ad..9360a8a 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/string.h>
 /* For gpio_get_desc() which is EXPORT_SYMBOL_GPL() */
 #include "../../gpio/gpiolib.h"
+#include "../../gpio/gpiolib-acpi.h"
 
 /*
  * Helper code to get Linux IRQ numbers given a description of the IRQ source
@@ -47,7 +48,7 @@ struct x86_acpi_irq_data {
        int polarity; /* ACPI_ACTIVE_HIGH / ACPI_ACTIVE_LOW / ACPI_ACTIVE_BOTH */
 };
 
-static int x86_acpi_irq_helper_gpiochip_find(struct gpio_chip *gc, void *data)
+static int gpiochip_find_match_label(struct gpio_chip *gc, void *data)
 {
        return gc->label && !strcmp(gc->label, data);
 }
@@ -73,7 +74,7 @@ static int x86_acpi_irq_helper_get(const struct x86_acpi_irq_data *data)
                return irq;
        case X86_ACPI_IRQ_TYPE_GPIOINT:
                /* Like acpi_dev_gpio_irq_get(), but without parsing ACPI resources */
-               chip = gpiochip_find(data->chip, x86_acpi_irq_helper_gpiochip_find);
+               chip = gpiochip_find(data->chip, gpiochip_find_match_label);
                if (!chip) {
                        pr_err("error cannot find GPIO chip %s\n", data->chip);
                        return -ENODEV;
@@ -143,14 +144,17 @@ struct x86_serdev_info {
 };
 
 struct x86_dev_info {
+       char *invalid_aei_gpiochip;
        const char * const *modules;
-       struct gpiod_lookup_table **gpiod_lookup_tables;
+       struct gpiod_lookup_table * const *gpiod_lookup_tables;
        const struct x86_i2c_client_info *i2c_client_info;
        const struct platform_device_info *pdev_info;
        const struct x86_serdev_info *serdev_info;
        int i2c_client_count;
        int pdev_count;
        int serdev_count;
+       int (*init)(void);
+       void (*exit)(void);
 };
 
 /* Generic / shared bq24190 settings */
@@ -187,8 +191,8 @@ static struct bq24190_platform_data bq24190_pdata = {
 };
 
 static const char * const bq24190_modules[] __initconst = {
-       "crystal_cove_charger", /* For the bq24190 IRQ */
-       "bq24190_charger",      /* For the Vbus regulator for intel-int3496 */
+       "intel_crystal_cove_charger", /* For the bq24190 IRQ */
+       "bq24190_charger",            /* For the Vbus regulator for intel-int3496 */
        NULL
 };
 
@@ -302,7 +306,7 @@ static struct gpiod_lookup_table asus_me176c_goodix_gpios = {
        },
 };
 
-static struct gpiod_lookup_table *asus_me176c_gpios[] = {
+static struct gpiod_lookup_table * const asus_me176c_gpios[] = {
        &int3496_gpo2_pin22_gpios,
        &asus_me176c_goodix_gpios,
        NULL
@@ -317,6 +321,7 @@ static const struct x86_dev_info asus_me176c_info __initconst = {
        .serdev_count = ARRAY_SIZE(asus_me176c_serdevs),
        .gpiod_lookup_tables = asus_me176c_gpios,
        .modules = bq24190_modules,
+       .invalid_aei_gpiochip = "INT33FC:02",
 };
 
 /* Asus TF103C tablets have an Android factory img with everything hardcoded */
@@ -405,7 +410,7 @@ static const struct x86_i2c_client_info asus_tf103c_i2c_clients[] __initconst =
        },
 };
 
-static struct gpiod_lookup_table *asus_tf103c_gpios[] = {
+static struct gpiod_lookup_table * const asus_tf103c_gpios[] = {
        &int3496_gpo2_pin22_gpios,
        NULL
 };
@@ -417,6 +422,7 @@ static const struct x86_dev_info asus_tf103c_info __initconst = {
        .pdev_count = ARRAY_SIZE(int3496_pdevs),
        .gpiod_lookup_tables = asus_tf103c_gpios,
        .modules = bq24190_modules,
+       .invalid_aei_gpiochip = "INT33FC:02",
 };
 
 /*
@@ -490,6 +496,39 @@ static const struct x86_dev_info chuwi_hi8_info __initconst = {
        .i2c_client_count = ARRAY_SIZE(chuwi_hi8_i2c_clients),
 };
 
+#define CZC_EC_EXTRA_PORT      0x68
+#define CZC_EC_ANDROID_KEYS    0x63
+
+static int __init czc_p10t_init(void)
+{
+       /*
+        * The device boots up in "Windows 7" mode, when the home button sends a
+        * Windows specific key sequence (Left Meta + D) and the second button
+        * sends an unknown one while also toggling the Radio Kill Switch.
+        * This is a surprising behavior when the second button is labeled "Back".
+        *
+        * The vendor-supplied Android-x86 build switches the device to a "Android"
+        * mode by writing value 0x63 to the I/O port 0x68. This just seems to just
+        * set bit 6 on address 0x96 in the EC region; switching the bit directly
+        * seems to achieve the same result. It uses a "p10t_switcher" to do the
+        * job. It doesn't seem to be able to do anything else, and no other use
+        * of the port 0x68 is known.
+        *
+        * In the Android mode, the home button sends just a single scancode,
+        * which can be handled in Linux userspace more reasonably and the back
+        * button only sends a scancode without toggling the kill switch.
+        * The scancode can then be mapped either to Back or RF Kill functionality
+        * in userspace, depending on how the button is labeled on that particular
+        * model.
+        */
+       outb(CZC_EC_ANDROID_KEYS, CZC_EC_EXTRA_PORT);
+       return 0;
+}
+
+static const struct x86_dev_info czc_p10t __initconst = {
+       .init = czc_p10t_init,
+};
+
 /*
  * Whitelabel (sold as various brands) TM800A550L tablets.
  * These tablet's DSDT contains a whole bunch of bogus ACPI I2C devices
@@ -559,7 +598,7 @@ static struct gpiod_lookup_table whitelabel_tm800a550l_goodix_gpios = {
        },
 };
 
-static struct gpiod_lookup_table *whitelabel_tm800a550l_gpios[] = {
+static struct gpiod_lookup_table * const whitelabel_tm800a550l_gpios[] = {
        &whitelabel_tm800a550l_goodix_gpios,
        NULL
 };
@@ -642,6 +681,24 @@ static const struct dmi_system_id x86_android_tablet_ids[] __initconst = {
                .driver_data = (void *)&chuwi_hi8_info,
        },
        {
+               /* CZC P10T */
+               .ident = "CZC ODEON TPC-10 (\"P10T\")",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "CZC"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "ODEON*TPC-10"),
+               },
+               .driver_data = (void *)&czc_p10t,
+       },
+       {
+               /* A variant of CZC P10T */
+               .ident = "ViewSonic ViewPad 10",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "ViewSonic"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "VPAD10"),
+               },
+               .driver_data = (void *)&czc_p10t,
+       },
+       {
                /* Whitelabel (sold as various brands) TM800A550L */
                .matches = {
                        DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
@@ -669,7 +726,8 @@ static int serdev_count;
 static struct i2c_client **i2c_clients;
 static struct platform_device **pdevs;
 static struct serdev_device **serdevs;
-static struct gpiod_lookup_table **gpiod_lookup_tables;
+static struct gpiod_lookup_table * const *gpiod_lookup_tables;
+static void (*exit_handler)(void);
 
 static __init int x86_instantiate_i2c_client(const struct x86_dev_info *dev_info,
                                             int idx)
@@ -787,6 +845,9 @@ static void x86_android_tablet_cleanup(void)
 
        kfree(i2c_clients);
 
+       if (exit_handler)
+               exit_handler();
+
        for (i = 0; gpiod_lookup_tables && gpiod_lookup_tables[i]; i++)
                gpiod_remove_lookup_table(gpiod_lookup_tables[i]);
 }
@@ -795,6 +856,7 @@ static __init int x86_android_tablet_init(void)
 {
        const struct x86_dev_info *dev_info;
        const struct dmi_system_id *id;
+       struct gpio_chip *chip;
        int i, ret = 0;
 
        id = dmi_first_match(x86_android_tablet_ids);
@@ -804,6 +866,20 @@ static __init int x86_android_tablet_init(void)
        dev_info = id->driver_data;
 
        /*
+        * The broken DSDTs on these devices often also include broken
+        * _AEI (ACPI Event Interrupt) handlers, disable these.
+        */
+       if (dev_info->invalid_aei_gpiochip) {
+               chip = gpiochip_find(dev_info->invalid_aei_gpiochip,
+                                    gpiochip_find_match_label);
+               if (!chip) {
+                       pr_err("error cannot find GPIO chip %s\n", dev_info->invalid_aei_gpiochip);
+                       return -ENODEV;
+               }
+               acpi_gpiochip_free_interrupts(chip);
+       }
+
+       /*
         * Since this runs from module_init() it cannot use -EPROBE_DEFER,
         * instead pre-load any modules which are listed as requirements.
         */
@@ -814,6 +890,15 @@ static __init int x86_android_tablet_init(void)
        for (i = 0; gpiod_lookup_tables && gpiod_lookup_tables[i]; i++)
                gpiod_add_lookup_table(gpiod_lookup_tables[i]);
 
+       if (dev_info->init) {
+               ret = dev_info->init();
+               if (ret < 0) {
+                       x86_android_tablet_cleanup();
+                       return ret;
+               }
+               exit_handler = dev_info->exit;
+       }
+
        i2c_clients = kcalloc(dev_info->i2c_client_count, sizeof(*i2c_clients), GFP_KERNEL);
        if (!i2c_clients) {
                x86_android_tablet_cleanup();
@@ -865,6 +950,6 @@ static __init int x86_android_tablet_init(void)
 module_init(x86_android_tablet_init);
 module_exit(x86_android_tablet_cleanup);
 
-MODULE_AUTHOR("Hans de Goede <hdegoede@redhat.com");
+MODULE_AUTHOR("Hans de Goede <hdegoede@redhat.com>");
 MODULE_DESCRIPTION("X86 Android tablets DSDT fixups driver");
 MODULE_LICENSE("GPL");
index fbc56b0..b8bf76c 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <linux/err.h>
 #include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
 #include <linux/i2c.h>
 #include <linux/module.h>
 #include <linux/regmap.h>
@@ -140,7 +141,7 @@ static int max20086_parse_regulators_dt(struct max20086 *chip, bool *boot_on)
        node = of_get_child_by_name(chip->dev->of_node, "regulators");
        if (!node) {
                dev_err(chip->dev, "regulators node not found\n");
-               return PTR_ERR(node);
+               return -ENODEV;
        }
 
        for (i = 0; i < chip->info->num_outputs; ++i)
index 3ddd426..1660197 100644 (file)
@@ -180,6 +180,7 @@ config QCOM_Q6V5_ADSP
        depends on RPMSG_QCOM_GLINK_SMEM || RPMSG_QCOM_GLINK_SMEM=n
        depends on QCOM_SYSMON || QCOM_SYSMON=n
        depends on RPMSG_QCOM_GLINK || RPMSG_QCOM_GLINK=n
+       depends on QCOM_AOSS_QMP || QCOM_AOSS_QMP=n
        select MFD_SYSCON
        select QCOM_PIL_INFO
        select QCOM_MDT_LOADER
@@ -199,6 +200,7 @@ config QCOM_Q6V5_MSS
        depends on RPMSG_QCOM_GLINK_SMEM || RPMSG_QCOM_GLINK_SMEM=n
        depends on QCOM_SYSMON || QCOM_SYSMON=n
        depends on RPMSG_QCOM_GLINK || RPMSG_QCOM_GLINK=n
+       depends on QCOM_AOSS_QMP || QCOM_AOSS_QMP=n
        select MFD_SYSCON
        select QCOM_MDT_LOADER
        select QCOM_PIL_INFO
@@ -218,6 +220,7 @@ config QCOM_Q6V5_PAS
        depends on RPMSG_QCOM_GLINK_SMEM || RPMSG_QCOM_GLINK_SMEM=n
        depends on QCOM_SYSMON || QCOM_SYSMON=n
        depends on RPMSG_QCOM_GLINK || RPMSG_QCOM_GLINK=n
+       depends on QCOM_AOSS_QMP || QCOM_AOSS_QMP=n
        select MFD_SYSCON
        select QCOM_PIL_INFO
        select QCOM_MDT_LOADER
@@ -239,6 +242,7 @@ config QCOM_Q6V5_WCSS
        depends on RPMSG_QCOM_GLINK_SMEM || RPMSG_QCOM_GLINK_SMEM=n
        depends on QCOM_SYSMON || QCOM_SYSMON=n
        depends on RPMSG_QCOM_GLINK || RPMSG_QCOM_GLINK=n
+       depends on QCOM_AOSS_QMP || QCOM_AOSS_QMP=n
        select MFD_SYSCON
        select QCOM_MDT_LOADER
        select QCOM_PIL_INFO
index eada7e3..442a388 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/platform_device.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
+#include <linux/soc/qcom/qcom_aoss.h>
 #include <linux/soc/qcom/smem.h>
 #include <linux/soc/qcom/smem_state.h>
 #include <linux/remoteproc.h>
index d6214cb..5663cf7 100644 (file)
@@ -93,7 +93,7 @@ static int rpmsg_eptdev_destroy(struct device *dev, void *data)
        /* wake up any blocked readers */
        wake_up_interruptible(&eptdev->readq);
 
-       device_del(&eptdev->dev);
+       cdev_device_del(&eptdev->cdev, &eptdev->dev);
        put_device(&eptdev->dev);
 
        return 0;
@@ -336,7 +336,6 @@ static void rpmsg_eptdev_release_device(struct device *dev)
 
        ida_simple_remove(&rpmsg_ept_ida, dev->id);
        ida_simple_remove(&rpmsg_minor_ida, MINOR(eptdev->dev.devt));
-       cdev_del(&eptdev->cdev);
        kfree(eptdev);
 }
 
@@ -381,19 +380,13 @@ static int rpmsg_eptdev_create(struct rpmsg_ctrldev *ctrldev,
        dev->id = ret;
        dev_set_name(dev, "rpmsg%d", ret);
 
-       ret = cdev_add(&eptdev->cdev, dev->devt, 1);
+       ret = cdev_device_add(&eptdev->cdev, &eptdev->dev);
        if (ret)
                goto free_ept_ida;
 
        /* We can now rely on the release function for cleanup */
        dev->release = rpmsg_eptdev_release_device;
 
-       ret = device_add(dev);
-       if (ret) {
-               dev_err(dev, "device_add failed: %d\n", ret);
-               put_device(dev);
-       }
-
        return ret;
 
 free_ept_ida:
@@ -462,7 +455,6 @@ static void rpmsg_ctrldev_release_device(struct device *dev)
 
        ida_simple_remove(&rpmsg_ctrl_ida, dev->id);
        ida_simple_remove(&rpmsg_minor_ida, MINOR(dev->devt));
-       cdev_del(&ctrldev->cdev);
        kfree(ctrldev);
 }
 
@@ -497,19 +489,13 @@ static int rpmsg_chrdev_probe(struct rpmsg_device *rpdev)
        dev->id = ret;
        dev_set_name(&ctrldev->dev, "rpmsg_ctrl%d", ret);
 
-       ret = cdev_add(&ctrldev->cdev, dev->devt, 1);
+       ret = cdev_device_add(&ctrldev->cdev, &ctrldev->dev);
        if (ret)
                goto free_ctrl_ida;
 
        /* We can now rely on the release function for cleanup */
        dev->release = rpmsg_ctrldev_release_device;
 
-       ret = device_add(dev);
-       if (ret) {
-               dev_err(&rpdev->dev, "device_add failed: %d\n", ret);
-               put_device(dev);
-       }
-
        dev_set_drvdata(&rpdev->dev, ctrldev);
 
        return ret;
@@ -535,7 +521,7 @@ static void rpmsg_chrdev_remove(struct rpmsg_device *rpdev)
        if (ret)
                dev_warn(&rpdev->dev, "failed to nuke endpoints: %d\n", ret);
 
-       device_del(&ctrldev->dev);
+       cdev_device_del(&ctrldev->cdev, &ctrldev->dev);
        put_device(&ctrldev->dev);
 }
 
index d24cafe..511bf8e 100644 (file)
@@ -521,6 +521,8 @@ static void zfcp_fc_adisc_handler(void *data)
                goto out;
        }
 
+       /* re-init to undo drop from zfcp_fc_adisc() */
+       port->d_id = ntoh24(adisc_resp->adisc_port_id);
        /* port is good, unblock rport without going through erp */
        zfcp_scsi_schedule_rport_register(port);
  out:
@@ -534,6 +536,7 @@ static int zfcp_fc_adisc(struct zfcp_port *port)
        struct zfcp_fc_req *fc_req;
        struct zfcp_adapter *adapter = port->adapter;
        struct Scsi_Host *shost = adapter->scsi_host;
+       u32 d_id;
        int ret;
 
        fc_req = kmem_cache_zalloc(zfcp_fc_req_cache, GFP_ATOMIC);
@@ -558,7 +561,15 @@ static int zfcp_fc_adisc(struct zfcp_port *port)
        fc_req->u.adisc.req.adisc_cmd = ELS_ADISC;
        hton24(fc_req->u.adisc.req.adisc_port_id, fc_host_port_id(shost));
 
-       ret = zfcp_fsf_send_els(adapter, port->d_id, &fc_req->ct_els,
+       d_id = port->d_id; /* remember as destination for send els below */
+       /*
+        * Force fresh GID_PN lookup on next port recovery.
+        * Must happen after request setup and before sending request,
+        * to prevent race with port->d_id re-init in zfcp_fc_adisc_handler().
+        */
+       port->d_id = 0;
+
+       ret = zfcp_fsf_send_els(adapter, d_id, &fc_req->ct_els,
                                ZFCP_FC_CTELS_TMO);
        if (ret)
                kmem_cache_free(zfcp_fc_req_cache, fc_req);
index b9482da..3ebe661 100644 (file)
@@ -1567,8 +1567,6 @@ static int twl_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
        pci_try_set_mwi(pdev);
 
        retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
-       if (retval)
-               retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
        if (retval) {
                TW_PRINTK(host, TW_DRIVER, 0x18, "Failed to set dma mask");
                retval = -ENODEV;
@@ -1786,8 +1784,6 @@ static int __maybe_unused twl_resume(struct device *dev)
        pci_try_set_mwi(pdev);
 
        retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
-       if (retval)
-               retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
        if (retval) {
                TW_PRINTK(host, TW_DRIVER, 0x25, "Failed to set dma mask during resume");
                retval = -ENODEV;
index 3ad3eba..ad4972c 100644 (file)
@@ -1507,7 +1507,6 @@ NCR_700_intr(int irq, void *dev_id)
                struct scsi_cmnd *SCp = hostdata->cmd;
 
                handled = 1;
-               SCp = hostdata->cmd;
 
                if(istat & SCSI_INT_PENDING) {
                        udelay(10);
index 440ef32..e5aa982 100644 (file)
@@ -732,9 +732,6 @@ bfad_pci_init(struct pci_dev *pdev, struct bfad_s *bfad)
        pci_set_master(pdev);
 
        rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
-       if (rc)
-               rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
-
        if (rc) {
                rc = -ENODEV;
                printk(KERN_ERR "dma_set_mask_and_coherent fail %p\n", pdev);
@@ -1560,9 +1557,6 @@ bfad_pci_slot_reset(struct pci_dev *pdev)
 
        rc = dma_set_mask_and_coherent(&bfad->pcidev->dev, DMA_BIT_MASK(64));
        if (rc)
-               rc = dma_set_mask_and_coherent(&bfad->pcidev->dev,
-                                              DMA_BIT_MASK(32));
-       if (rc)
                goto out_disable_device;
 
        if (restart_bfa(bfad) == -1)
index 71fa62b..a826456 100644 (file)
@@ -82,7 +82,7 @@ static int bnx2fc_bind_pcidev(struct bnx2fc_hba *hba);
 static void bnx2fc_unbind_pcidev(struct bnx2fc_hba *hba);
 static struct fc_lport *bnx2fc_if_create(struct bnx2fc_interface *interface,
                                  struct device *parent, int npiv);
-static void bnx2fc_destroy_work(struct work_struct *work);
+static void bnx2fc_port_destroy(struct fcoe_port *port);
 
 static struct bnx2fc_hba *bnx2fc_hba_lookup(struct net_device *phys_dev);
 static struct bnx2fc_interface *bnx2fc_interface_lookup(struct net_device
@@ -508,7 +508,8 @@ static int bnx2fc_l2_rcv_thread(void *arg)
 
 static void bnx2fc_recv_frame(struct sk_buff *skb)
 {
-       u32 fr_len;
+       u64 crc_err;
+       u32 fr_len, fr_crc;
        struct fc_lport *lport;
        struct fcoe_rcv_info *fr;
        struct fc_stats *stats;
@@ -542,6 +543,11 @@ static void bnx2fc_recv_frame(struct sk_buff *skb)
        skb_pull(skb, sizeof(struct fcoe_hdr));
        fr_len = skb->len - sizeof(struct fcoe_crc_eof);
 
+       stats = per_cpu_ptr(lport->stats, get_cpu());
+       stats->RxFrames++;
+       stats->RxWords += fr_len / FCOE_WORD_TO_BYTE;
+       put_cpu();
+
        fp = (struct fc_frame *)skb;
        fc_frame_init(fp);
        fr_dev(fp) = lport;
@@ -624,16 +630,15 @@ static void bnx2fc_recv_frame(struct sk_buff *skb)
                return;
        }
 
-       stats = per_cpu_ptr(lport->stats, smp_processor_id());
-       stats->RxFrames++;
-       stats->RxWords += fr_len / FCOE_WORD_TO_BYTE;
+       fr_crc = le32_to_cpu(fr_crc(fp));
 
-       if (le32_to_cpu(fr_crc(fp)) !=
-                       ~crc32(~0, skb->data, fr_len)) {
-               if (stats->InvalidCRCCount < 5)
+       if (unlikely(fr_crc != ~crc32(~0, skb->data, fr_len))) {
+               stats = per_cpu_ptr(lport->stats, get_cpu());
+               crc_err = (stats->InvalidCRCCount++);
+               put_cpu();
+               if (crc_err < 5)
                        printk(KERN_WARNING PFX "dropping frame with "
                               "CRC error\n");
-               stats->InvalidCRCCount++;
                kfree_skb(skb);
                return;
        }
@@ -907,9 +912,6 @@ static void bnx2fc_indicate_netevent(void *context, unsigned long event,
                                __bnx2fc_destroy(interface);
                }
                mutex_unlock(&bnx2fc_dev_lock);
-
-               /* Ensure ALL destroy work has been completed before return */
-               flush_workqueue(bnx2fc_wq);
                return;
 
        default:
@@ -1215,8 +1217,8 @@ static int bnx2fc_vport_destroy(struct fc_vport *vport)
        mutex_unlock(&n_port->lp_mutex);
        bnx2fc_free_vport(interface->hba, port->lport);
        bnx2fc_port_shutdown(port->lport);
+       bnx2fc_port_destroy(port);
        bnx2fc_interface_put(interface);
-       queue_work(bnx2fc_wq, &port->destroy_work);
        return 0;
 }
 
@@ -1525,7 +1527,6 @@ static struct fc_lport *bnx2fc_if_create(struct bnx2fc_interface *interface,
        port->lport = lport;
        port->priv = interface;
        port->get_netdev = bnx2fc_netdev;
-       INIT_WORK(&port->destroy_work, bnx2fc_destroy_work);
 
        /* Configure fcoe_port */
        rc = bnx2fc_lport_config(lport);
@@ -1653,8 +1654,8 @@ static void __bnx2fc_destroy(struct bnx2fc_interface *interface)
        bnx2fc_interface_cleanup(interface);
        bnx2fc_stop(interface);
        list_del(&interface->list);
+       bnx2fc_port_destroy(port);
        bnx2fc_interface_put(interface);
-       queue_work(bnx2fc_wq, &port->destroy_work);
 }
 
 /**
@@ -1694,15 +1695,12 @@ netdev_err:
        return rc;
 }
 
-static void bnx2fc_destroy_work(struct work_struct *work)
+static void bnx2fc_port_destroy(struct fcoe_port *port)
 {
-       struct fcoe_port *port;
        struct fc_lport *lport;
 
-       port = container_of(work, struct fcoe_port, destroy_work);
        lport = port->lport;
-
-       BNX2FC_HBA_DBG(lport, "Entered bnx2fc_destroy_work\n");
+       BNX2FC_HBA_DBG(lport, "Entered %s, destroying lport %p\n", __func__, lport);
 
        bnx2fc_if_destroy(lport);
 }
@@ -2556,9 +2554,6 @@ static void bnx2fc_ulp_exit(struct cnic_dev *dev)
                        __bnx2fc_destroy(interface);
        mutex_unlock(&bnx2fc_dev_lock);
 
-       /* Ensure ALL destroy work has been completed before return */
-       flush_workqueue(bnx2fc_wq);
-
        bnx2fc_ulp_stop(hba);
        /* unregister cnic device */
        if (test_and_clear_bit(BNX2FC_CNIC_REGISTERED, &hba->reg_with_cnic))
index 7bb4f9a..84bc81d 100644 (file)
@@ -46,18 +46,14 @@ efc_els_io_alloc_size(struct efc_node *node, u32 reqlen, u32 rsplen)
 
        efc = node->efc;
 
-       spin_lock_irqsave(&node->els_ios_lock, flags);
-
        if (!node->els_io_enabled) {
                efc_log_err(efc, "els io alloc disabled\n");
-               spin_unlock_irqrestore(&node->els_ios_lock, flags);
                return NULL;
        }
 
        els = mempool_alloc(efc->els_io_pool, GFP_ATOMIC);
        if (!els) {
                atomic_add_return(1, &efc->els_io_alloc_failed_count);
-               spin_unlock_irqrestore(&node->els_ios_lock, flags);
                return NULL;
        }
 
@@ -74,7 +70,6 @@ efc_els_io_alloc_size(struct efc_node *node, u32 reqlen, u32 rsplen)
                                              &els->io.req.phys, GFP_KERNEL);
        if (!els->io.req.virt) {
                mempool_free(els, efc->els_io_pool);
-               spin_unlock_irqrestore(&node->els_ios_lock, flags);
                return NULL;
        }
 
@@ -94,10 +89,11 @@ efc_els_io_alloc_size(struct efc_node *node, u32 reqlen, u32 rsplen)
 
                /* add els structure to ELS IO list */
                INIT_LIST_HEAD(&els->list_entry);
+               spin_lock_irqsave(&node->els_ios_lock, flags);
                list_add_tail(&els->list_entry, &node->els_ios_list);
+               spin_unlock_irqrestore(&node->els_ios_lock, flags);
        }
 
-       spin_unlock_irqrestore(&node->els_ios_lock, flags);
        return els;
 }
 
index a05ec7a..ebf5ec3 100644 (file)
@@ -400,8 +400,7 @@ void hisi_sas_task_deliver(struct hisi_hba *hisi_hba,
                           struct hisi_sas_slot *slot,
                           struct hisi_sas_dq *dq,
                           struct hisi_sas_device *sas_dev,
-                          struct hisi_sas_internal_abort *abort,
-                          struct hisi_sas_tmf_task *tmf)
+                          struct hisi_sas_internal_abort *abort)
 {
        struct hisi_sas_cmd_hdr *cmd_hdr_base;
        int dlvry_queue_slot, dlvry_queue;
@@ -427,8 +426,6 @@ void hisi_sas_task_deliver(struct hisi_hba *hisi_hba,
        cmd_hdr_base = hisi_hba->cmd_hdr[dlvry_queue];
        slot->cmd_hdr = &cmd_hdr_base[dlvry_queue_slot];
 
-       slot->tmf = tmf;
-       slot->is_internal = tmf;
        task->lldd_task = slot;
 
        memset(slot->cmd_hdr, 0, sizeof(struct hisi_sas_cmd_hdr));
@@ -587,7 +584,7 @@ static int hisi_sas_task_exec(struct sas_task *task, gfp_t gfp_flags,
        slot->is_internal = tmf;
 
        /* protect task_prep and start_delivery sequence */
-       hisi_sas_task_deliver(hisi_hba, slot, dq, sas_dev, NULL, tmf);
+       hisi_sas_task_deliver(hisi_hba, slot, dq, sas_dev, NULL);
 
        return 0;
 
@@ -1380,12 +1377,13 @@ static int hisi_sas_softreset_ata_disk(struct domain_device *device)
        struct hisi_hba *hisi_hba = dev_to_hisi_hba(device);
        struct device *dev = hisi_hba->dev;
        int s = sizeof(struct host_to_dev_fis);
+       struct hisi_sas_tmf_task tmf = {};
 
        ata_for_each_link(link, ap, EDGE) {
                int pmp = sata_srst_pmp(link);
 
                hisi_sas_fill_ata_reset_cmd(link->device, 1, pmp, fis);
-               rc = hisi_sas_exec_internal_tmf_task(device, fis, s, NULL);
+               rc = hisi_sas_exec_internal_tmf_task(device, fis, s, &tmf);
                if (rc != TMF_RESP_FUNC_COMPLETE)
                        break;
        }
@@ -1396,7 +1394,7 @@ static int hisi_sas_softreset_ata_disk(struct domain_device *device)
 
                        hisi_sas_fill_ata_reset_cmd(link->device, 0, pmp, fis);
                        rc = hisi_sas_exec_internal_tmf_task(device, fis,
-                                                            s, NULL);
+                                                            s, &tmf);
                        if (rc != TMF_RESP_FUNC_COMPLETE)
                                dev_err(dev, "ata disk %016llx de-reset failed\n",
                                        SAS_ADDR(device->sas_addr));
@@ -2067,7 +2065,7 @@ hisi_sas_internal_abort_task_exec(struct hisi_hba *hisi_hba, int device_id,
        slot->port = port;
        slot->is_internal = true;
 
-       hisi_sas_task_deliver(hisi_hba, slot, dq, sas_dev, abort, NULL);
+       hisi_sas_task_deliver(hisi_hba, slot, dq, sas_dev, abort);
 
        return 0;
 
@@ -2666,9 +2664,6 @@ static struct Scsi_Host *hisi_sas_shost_alloc(struct platform_device *pdev,
                goto err_out;
 
        error = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64));
-       if (error)
-               error = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32));
-
        if (error) {
                dev_err(dev, "No usable DMA addressing method\n");
                goto err_out;
index a45ef9a..a01a3a7 100644 (file)
@@ -4695,8 +4695,6 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                goto err_out;
 
        rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
-       if (rc)
-               rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
        if (rc) {
                dev_err(dev, "No usable DMA addressing method\n");
                rc = -ENODEV;
index 253ceca..7eb8c39 100644 (file)
@@ -2267,7 +2267,8 @@ static void myrs_cleanup(struct myrs_hba *cs)
        myrs_unmap(cs);
 
        if (cs->mmio_base) {
-               cs->disable_intr(cs);
+               if (cs->disable_intr)
+                       cs->disable_intr(cs);
                iounmap(cs->mmio_base);
                cs->mmio_base = NULL;
        }
index c814e50..9ec310b 100644 (file)
@@ -2692,7 +2692,6 @@ static void mpi_sata_event(struct pm8001_hba_info *pm8001_ha, void *piomb)
        u32 tag = le32_to_cpu(psataPayload->tag);
        u32 port_id = le32_to_cpu(psataPayload->port_id);
        u32 dev_id = le32_to_cpu(psataPayload->device_id);
-       unsigned long flags;
 
        if (event)
                pm8001_dbg(pm8001_ha, FAIL, "SATA EVENT 0x%x\n", event);
@@ -2724,8 +2723,6 @@ static void mpi_sata_event(struct pm8001_hba_info *pm8001_ha, void *piomb)
                ts->resp = SAS_TASK_COMPLETE;
                ts->stat = SAS_DATA_OVERRUN;
                ts->residual = 0;
-               if (pm8001_dev)
-                       atomic_dec(&pm8001_dev->running_req);
                break;
        case IO_XFER_ERROR_BREAK:
                pm8001_dbg(pm8001_ha, IO, "IO_XFER_ERROR_BREAK\n");
@@ -2767,7 +2764,6 @@ static void mpi_sata_event(struct pm8001_hba_info *pm8001_ha, void *piomb)
                                IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS);
                        ts->resp = SAS_TASK_COMPLETE;
                        ts->stat = SAS_QUEUE_FULL;
-                       pm8001_ccb_task_free_done(pm8001_ha, t, ccb, tag);
                        return;
                }
                break;
@@ -2853,20 +2849,6 @@ static void mpi_sata_event(struct pm8001_hba_info *pm8001_ha, void *piomb)
                ts->stat = SAS_OPEN_TO;
                break;
        }
-       spin_lock_irqsave(&t->task_state_lock, flags);
-       t->task_state_flags &= ~SAS_TASK_STATE_PENDING;
-       t->task_state_flags &= ~SAS_TASK_AT_INITIATOR;
-       t->task_state_flags |= SAS_TASK_STATE_DONE;
-       if (unlikely((t->task_state_flags & SAS_TASK_STATE_ABORTED))) {
-               spin_unlock_irqrestore(&t->task_state_lock, flags);
-               pm8001_dbg(pm8001_ha, FAIL,
-                          "task 0x%p done with io_status 0x%x resp 0x%x stat 0x%x but aborted by upper layer!\n",
-                          t, event, ts->resp, ts->stat);
-               pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
-       } else {
-               spin_unlock_irqrestore(&t->task_state_lock, flags);
-               pm8001_ccb_task_free_done(pm8001_ha, t, ccb, tag);
-       }
 }
 
 /*See the comments for mpi_ssp_completion */
index 160ee8b..32edda3 100644 (file)
@@ -769,8 +769,13 @@ static int pm8001_exec_internal_tmf_task(struct domain_device *dev,
                res = -TMF_RESP_FUNC_FAILED;
                /* Even TMF timed out, return direct. */
                if (task->task_state_flags & SAS_TASK_STATE_ABORTED) {
+                       struct pm8001_ccb_info *ccb = task->lldd_task;
+
                        pm8001_dbg(pm8001_ha, FAIL, "TMF task[%x]timeout.\n",
                                   tmf->tmf);
+
+                       if (ccb)
+                               ccb->task = NULL;
                        goto ex_err;
                }
 
index bbf538f..9d20f80 100644 (file)
@@ -2185,9 +2185,9 @@ mpi_ssp_completion(struct pm8001_hba_info *pm8001_ha, void *piomb)
                pm8001_dbg(pm8001_ha, FAIL,
                           "task 0x%p done with io_status 0x%x resp 0x%x stat 0x%x but aborted by upper layer!\n",
                           t, status, ts->resp, ts->stat);
+               pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
                if (t->slow_task)
                        complete(&t->slow_task->completion);
-               pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
        } else {
                spin_unlock_irqrestore(&t->task_state_lock, flags);
                pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
@@ -2794,9 +2794,9 @@ mpi_sata_completion(struct pm8001_hba_info *pm8001_ha,
                pm8001_dbg(pm8001_ha, FAIL,
                           "task 0x%p done with io_status 0x%x resp 0x%x stat 0x%x but aborted by upper layer!\n",
                           t, status, ts->resp, ts->stat);
+               pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
                if (t->slow_task)
                        complete(&t->slow_task->completion);
-               pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
        } else {
                spin_unlock_irqrestore(&t->task_state_lock, flags);
                spin_unlock_irqrestore(&circularQ->oq_lock,
@@ -2821,7 +2821,6 @@ static void mpi_sata_event(struct pm8001_hba_info *pm8001_ha,
        u32 tag = le32_to_cpu(psataPayload->tag);
        u32 port_id = le32_to_cpu(psataPayload->port_id);
        u32 dev_id = le32_to_cpu(psataPayload->device_id);
-       unsigned long flags;
 
        if (event)
                pm8001_dbg(pm8001_ha, FAIL, "SATA EVENT 0x%x\n", event);
@@ -2854,8 +2853,6 @@ static void mpi_sata_event(struct pm8001_hba_info *pm8001_ha,
                ts->resp = SAS_TASK_COMPLETE;
                ts->stat = SAS_DATA_OVERRUN;
                ts->residual = 0;
-               if (pm8001_dev)
-                       atomic_dec(&pm8001_dev->running_req);
                break;
        case IO_XFER_ERROR_BREAK:
                pm8001_dbg(pm8001_ha, IO, "IO_XFER_ERROR_BREAK\n");
@@ -2904,11 +2901,6 @@ static void mpi_sata_event(struct pm8001_hba_info *pm8001_ha,
                                IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS);
                        ts->resp = SAS_TASK_COMPLETE;
                        ts->stat = SAS_QUEUE_FULL;
-                       spin_unlock_irqrestore(&circularQ->oq_lock,
-                                       circularQ->lock_flags);
-                       pm8001_ccb_task_free_done(pm8001_ha, t, ccb, tag);
-                       spin_lock_irqsave(&circularQ->oq_lock,
-                                       circularQ->lock_flags);
                        return;
                }
                break;
@@ -3008,24 +3000,6 @@ static void mpi_sata_event(struct pm8001_hba_info *pm8001_ha,
                ts->stat = SAS_OPEN_TO;
                break;
        }
-       spin_lock_irqsave(&t->task_state_lock, flags);
-       t->task_state_flags &= ~SAS_TASK_STATE_PENDING;
-       t->task_state_flags &= ~SAS_TASK_AT_INITIATOR;
-       t->task_state_flags |= SAS_TASK_STATE_DONE;
-       if (unlikely((t->task_state_flags & SAS_TASK_STATE_ABORTED))) {
-               spin_unlock_irqrestore(&t->task_state_lock, flags);
-               pm8001_dbg(pm8001_ha, FAIL,
-                          "task 0x%p done with io_status 0x%x resp 0x%x stat 0x%x but aborted by upper layer!\n",
-                          t, event, ts->resp, ts->stat);
-               pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
-       } else {
-               spin_unlock_irqrestore(&t->task_state_lock, flags);
-               spin_unlock_irqrestore(&circularQ->oq_lock,
-                               circularQ->lock_flags);
-               pm8001_ccb_task_free_done(pm8001_ha, t, ccb, tag);
-               spin_lock_irqsave(&circularQ->oq_lock,
-                               circularQ->lock_flags);
-       }
 }
 
 /*See the comments for mpi_ssp_completion */
@@ -3931,6 +3905,7 @@ static int ssp_coalesced_comp_resp(struct pm8001_hba_info *pm8001_ha,
 /**
  * process_one_iomb - process one outbound Queue memory block
  * @pm8001_ha: our hba card information
+ * @circularQ: outbound circular queue
  * @piomb: IO message buffer
  */
 static void process_one_iomb(struct pm8001_hba_info *pm8001_ha,
@@ -4151,10 +4126,22 @@ static int process_oq(struct pm8001_hba_info *pm8001_ha, u8 vec)
        u32 ret = MPI_IO_STATUS_FAIL;
        u32 regval;
 
+       /*
+        * Fatal errors are programmed to be signalled in irq vector
+        * pm8001_ha->max_q_num - 1 through pm8001_ha->main_cfg_tbl.pm80xx_tbl.
+        * fatal_err_interrupt
+        */
        if (vec == (pm8001_ha->max_q_num - 1)) {
+               u32 mipsall_ready;
+
+               if (pm8001_ha->chip_id == chip_8008 ||
+                   pm8001_ha->chip_id == chip_8009)
+                       mipsall_ready = SCRATCH_PAD_MIPSALL_READY_8PORT;
+               else
+                       mipsall_ready = SCRATCH_PAD_MIPSALL_READY_16PORT;
+
                regval = pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_1);
-               if ((regval & SCRATCH_PAD_MIPSALL_READY) !=
-                                       SCRATCH_PAD_MIPSALL_READY) {
+               if ((regval & mipsall_ready) != mipsall_ready) {
                        pm8001_ha->controller_fatal_error = true;
                        pm8001_dbg(pm8001_ha, FAIL,
                                   "Firmware Fatal error! Regval:0x%x\n",
index c7e5d93..c41ed03 100644 (file)
@@ -1405,8 +1405,12 @@ typedef struct SASProtocolTimerConfig SASProtocolTimerConfig_t;
 #define SCRATCH_PAD_BOOT_LOAD_SUCCESS  0x0
 #define SCRATCH_PAD_IOP0_READY         0xC00
 #define SCRATCH_PAD_IOP1_READY         0x3000
-#define SCRATCH_PAD_MIPSALL_READY      (SCRATCH_PAD_IOP1_READY | \
+#define SCRATCH_PAD_MIPSALL_READY_16PORT       (SCRATCH_PAD_IOP1_READY | \
                                        SCRATCH_PAD_IOP0_READY | \
+                                       SCRATCH_PAD_ILA_READY | \
+                                       SCRATCH_PAD_RAAE_READY)
+#define SCRATCH_PAD_MIPSALL_READY_8PORT        (SCRATCH_PAD_IOP0_READY | \
+                                       SCRATCH_PAD_ILA_READY | \
                                        SCRATCH_PAD_RAAE_READY)
 
 /* boot loader state */
index 99a56ca..fab43da 100644 (file)
@@ -2250,6 +2250,7 @@ process_els:
            io_req->tm_flags == FCP_TMF_TGT_RESET) {
                clear_bit(QEDF_CMD_OUTSTANDING, &io_req->flags);
                io_req->sc_cmd = NULL;
+               kref_put(&io_req->refcount, qedf_release_cmd);
                complete(&io_req->tm_done);
        }
 
index cdc66e2..6ad28bc 100644 (file)
@@ -911,7 +911,7 @@ void qedf_ctx_soft_reset(struct fc_lport *lport)
        struct qed_link_output if_link;
 
        if (lport->vport) {
-               QEDF_ERR(NULL, "Cannot issue host reset on NPIV port.\n");
+               printk_ratelimited("Cannot issue host reset on NPIV port.\n");
                return;
        }
 
@@ -1864,6 +1864,7 @@ static int qedf_vport_create(struct fc_vport *vport, bool disabled)
        vport_qedf->cmd_mgr = base_qedf->cmd_mgr;
        init_completion(&vport_qedf->flogi_compl);
        INIT_LIST_HEAD(&vport_qedf->fcports);
+       INIT_DELAYED_WORK(&vport_qedf->stag_work, qedf_stag_change_work);
 
        rc = qedf_vport_libfc_config(vport, vn_port);
        if (rc) {
@@ -3980,7 +3981,9 @@ void qedf_stag_change_work(struct work_struct *work)
        struct qedf_ctx *qedf =
            container_of(work, struct qedf_ctx, stag_work.work);
 
-       QEDF_ERR(&qedf->dbg_ctx, "Performing software context reset.\n");
+       printk_ratelimited("[%s]:[%s:%d]:%d: Performing software context reset.",
+                       dev_name(&qedf->pdev->dev), __func__, __LINE__,
+                       qedf->dbg_ctx.host_no);
        qedf_ctx_soft_reset(qedf->lport);
 }
 
index 3520b93..f4e6c68 100644 (file)
@@ -214,6 +214,48 @@ static void scsi_unlock_floptical(struct scsi_device *sdev,
                         SCSI_TIMEOUT, 3, NULL);
 }
 
+static int scsi_realloc_sdev_budget_map(struct scsi_device *sdev,
+                                       unsigned int depth)
+{
+       int new_shift = sbitmap_calculate_shift(depth);
+       bool need_alloc = !sdev->budget_map.map;
+       bool need_free = false;
+       int ret;
+       struct sbitmap sb_backup;
+
+       /*
+        * realloc if new shift is calculated, which is caused by setting
+        * up one new default queue depth after calling ->slave_configure
+        */
+       if (!need_alloc && new_shift != sdev->budget_map.shift)
+               need_alloc = need_free = true;
+
+       if (!need_alloc)
+               return 0;
+
+       /*
+        * Request queue has to be frozen for reallocating budget map,
+        * and here disk isn't added yet, so freezing is pretty fast
+        */
+       if (need_free) {
+               blk_mq_freeze_queue(sdev->request_queue);
+               sb_backup = sdev->budget_map;
+       }
+       ret = sbitmap_init_node(&sdev->budget_map,
+                               scsi_device_max_queue_depth(sdev),
+                               new_shift, GFP_KERNEL,
+                               sdev->request_queue->node, false, true);
+       if (need_free) {
+               if (ret)
+                       sdev->budget_map = sb_backup;
+               else
+                       sbitmap_free(&sb_backup);
+               ret = 0;
+               blk_mq_unfreeze_queue(sdev->request_queue);
+       }
+       return ret;
+}
+
 /**
  * scsi_alloc_sdev - allocate and setup a scsi_Device
  * @starget: which target to allocate a &scsi_device for
@@ -306,11 +348,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
         * default device queue depth to figure out sbitmap shift
         * since we use this queue depth most of times.
         */
-       if (sbitmap_init_node(&sdev->budget_map,
-                               scsi_device_max_queue_depth(sdev),
-                               sbitmap_calculate_shift(depth),
-                               GFP_KERNEL, sdev->request_queue->node,
-                               false, true)) {
+       if (scsi_realloc_sdev_budget_map(sdev, depth)) {
                put_device(&starget->dev);
                kfree(sdev);
                goto out;
@@ -1017,6 +1055,13 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result,
                        }
                        return SCSI_SCAN_NO_RESPONSE;
                }
+
+               /*
+                * The queue_depth is often changed in ->slave_configure.
+                * Set up budget map again since memory consumption of
+                * the map depends on actual queue depth.
+                */
+               scsi_realloc_sdev_budget_map(sdev, sdev->queue_depth);
        }
 
        if (sdev->scsi_level >= SCSI_3)
index 8b16bbb..87975d1 100644 (file)
@@ -92,6 +92,11 @@ static int ufshcd_parse_clock_info(struct ufs_hba *hba)
                clki->min_freq = clkfreq[i];
                clki->max_freq = clkfreq[i+1];
                clki->name = devm_kstrdup(dev, name, GFP_KERNEL);
+               if (!clki->name) {
+                       ret = -ENOMEM;
+                       goto out;
+               }
+
                if (!strcmp(name, "ref_clk"))
                        clki->keep_link_active = true;
                dev_dbg(dev, "%s: min %u max %u name %s\n", "freq-table-hz",
@@ -127,6 +132,8 @@ static int ufshcd_populate_vreg(struct device *dev, const char *name,
                return -ENOMEM;
 
        vreg->name = devm_kstrdup(dev, name, GFP_KERNEL);
+       if (!vreg->name)
+               return -ENOMEM;
 
        snprintf(prop_name, MAX_PROP_SIZE, "%s-max-microamp", name);
        if (of_property_read_u32(np, prop_name, &vreg->max_uA)) {
index 460d2b4..50b12d6 100644 (file)
@@ -8613,7 +8613,7 @@ static void ufshcd_hba_exit(struct ufs_hba *hba)
  * @pwr_mode: device power mode to set
  *
  * Returns 0 if requested power mode is set successfully
- * Returns non-zero if failed to set the requested power mode
+ * Returns < 0 if failed to set the requested power mode
  */
 static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba,
                                     enum ufs_dev_pwr_mode pwr_mode)
@@ -8667,8 +8667,11 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba,
                sdev_printk(KERN_WARNING, sdp,
                            "START_STOP failed for power mode: %d, result %x\n",
                            pwr_mode, ret);
-               if (ret > 0 && scsi_sense_valid(&sshdr))
-                       scsi_print_sense_hdr(sdp, NULL, &sshdr);
+               if (ret > 0) {
+                       if (scsi_sense_valid(&sshdr))
+                               scsi_print_sense_hdr(sdp, NULL, &sshdr);
+                       ret = -EIO;
+               }
        }
 
        if (!ret)
index 6a295c8..a7ff0e5 100644 (file)
@@ -142,7 +142,8 @@ static inline u32 ufshci_version(u32 major, u32 minor)
 #define INT_FATAL_ERRORS       (DEVICE_FATAL_ERROR |\
                                CONTROLLER_FATAL_ERROR |\
                                SYSTEM_BUS_FATAL_ERROR |\
-                               CRYPTO_ENGINE_FATAL_ERROR)
+                               CRYPTO_ENGINE_FATAL_ERROR |\
+                               UIC_LINK_LOST)
 
 /* HCS - Host Controller Status 30h */
 #define DEVICE_PRESENT                         0x1
index c9a769b..86c7621 100644 (file)
@@ -585,7 +585,7 @@ static void bcm_qspi_chip_select(struct bcm_qspi *qspi, int cs)
        u32 rd = 0;
        u32 wr = 0;
 
-       if (qspi->base[CHIP_SELECT]) {
+       if (cs >= 0 && qspi->base[CHIP_SELECT]) {
                rd = bcm_qspi_read(qspi, CHIP_SELECT, 0);
                wr = (rd & ~0xff) | (1 << cs);
                if (rd == wr)
index c208efe..0bc7daa 100644 (file)
@@ -693,6 +693,11 @@ static int meson_spicc_probe(struct platform_device *pdev)
        writel_relaxed(0, spicc->base + SPICC_INTREG);
 
        irq = platform_get_irq(pdev, 0);
+       if (irq < 0) {
+               ret = irq;
+               goto out_master;
+       }
+
        ret = devm_request_irq(&pdev->dev, irq, meson_spicc_irq,
                               0, NULL, spicc);
        if (ret) {
index a15de10..753bd31 100644 (file)
@@ -624,7 +624,7 @@ static irqreturn_t mtk_spi_interrupt(int irq, void *dev_id)
        else
                mdata->state = MTK_SPI_IDLE;
 
-       if (!master->can_dma(master, master->cur_msg->spi, trans)) {
+       if (!master->can_dma(master, NULL, trans)) {
                if (trans->rx_buf) {
                        cnt = mdata->xfer_len / 4;
                        ioread32_rep(mdata->base + SPI_RX_DATA_REG,
index 514337c..ffdc55f 100644 (file)
@@ -688,7 +688,7 @@ static int stm32_qspi_probe(struct platform_device *pdev)
        struct resource *res;
        int ret, irq;
 
-       ctrl = spi_alloc_master(dev, sizeof(*qspi));
+       ctrl = devm_spi_alloc_master(dev, sizeof(*qspi));
        if (!ctrl)
                return -ENOMEM;
 
@@ -697,58 +697,46 @@ static int stm32_qspi_probe(struct platform_device *pdev)
 
        res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "qspi");
        qspi->io_base = devm_ioremap_resource(dev, res);
-       if (IS_ERR(qspi->io_base)) {
-               ret = PTR_ERR(qspi->io_base);
-               goto err_master_put;
-       }
+       if (IS_ERR(qspi->io_base))
+               return PTR_ERR(qspi->io_base);
 
        qspi->phys_base = res->start;
 
        res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "qspi_mm");
        qspi->mm_base = devm_ioremap_resource(dev, res);
-       if (IS_ERR(qspi->mm_base)) {
-               ret = PTR_ERR(qspi->mm_base);
-               goto err_master_put;
-       }
+       if (IS_ERR(qspi->mm_base))
+               return PTR_ERR(qspi->mm_base);
 
        qspi->mm_size = resource_size(res);
-       if (qspi->mm_size > STM32_QSPI_MAX_MMAP_SZ) {
-               ret = -EINVAL;
-               goto err_master_put;
-       }
+       if (qspi->mm_size > STM32_QSPI_MAX_MMAP_SZ)
+               return -EINVAL;
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               ret = irq;
-               goto err_master_put;
-       }
+       if (irq < 0)
+               return irq;
 
        ret = devm_request_irq(dev, irq, stm32_qspi_irq, 0,
                               dev_name(dev), qspi);
        if (ret) {
                dev_err(dev, "failed to request irq\n");
-               goto err_master_put;
+               return ret;
        }
 
        init_completion(&qspi->data_completion);
        init_completion(&qspi->match_completion);
 
        qspi->clk = devm_clk_get(dev, NULL);
-       if (IS_ERR(qspi->clk)) {
-               ret = PTR_ERR(qspi->clk);
-               goto err_master_put;
-       }
+       if (IS_ERR(qspi->clk))
+               return PTR_ERR(qspi->clk);
 
        qspi->clk_rate = clk_get_rate(qspi->clk);
-       if (!qspi->clk_rate) {
-               ret = -EINVAL;
-               goto err_master_put;
-       }
+       if (!qspi->clk_rate)
+               return -EINVAL;
 
        ret = clk_prepare_enable(qspi->clk);
        if (ret) {
                dev_err(dev, "can not enable the clock\n");
-               goto err_master_put;
+               return ret;
        }
 
        rstc = devm_reset_control_get_exclusive(dev, NULL);
@@ -784,7 +772,7 @@ static int stm32_qspi_probe(struct platform_device *pdev)
        pm_runtime_enable(dev);
        pm_runtime_get_noresume(dev);
 
-       ret = devm_spi_register_master(dev, ctrl);
+       ret = spi_register_master(ctrl);
        if (ret)
                goto err_pm_runtime_free;
 
@@ -806,8 +794,6 @@ err_dma_free:
        stm32_qspi_dma_free(qspi);
 err_clk_disable:
        clk_disable_unprepare(qspi->clk);
-err_master_put:
-       spi_master_put(qspi->ctrl);
 
        return ret;
 }
@@ -817,6 +803,7 @@ static int stm32_qspi_remove(struct platform_device *pdev)
        struct stm32_qspi *qspi = platform_get_drvdata(pdev);
 
        pm_runtime_get_sync(qspi->dev);
+       spi_unregister_master(qspi->ctrl);
        /* disable qspi */
        writel_relaxed(0, qspi->io_base + QSPI_CR);
        stm32_qspi_dma_free(qspi);
index 9bd3fd1..7fc2450 100644 (file)
@@ -221,7 +221,6 @@ struct stm32_spi;
  * time between frames (if driver has this functionality)
  * @set_number_of_data: optional routine to configure registers to desired
  * number of data (if driver has this functionality)
- * @can_dma: routine to determine if the transfer is eligible for DMA use
  * @transfer_one_dma_start: routine to start transfer a single spi_transfer
  * using DMA
  * @dma_rx_cb: routine to call after DMA RX channel operation is complete
@@ -232,7 +231,7 @@ struct stm32_spi;
  * @baud_rate_div_min: minimum baud rate divisor
  * @baud_rate_div_max: maximum baud rate divisor
  * @has_fifo: boolean to know if fifo is used for driver
- * @has_startbit: boolean to know if start bit is used to start transfer
+ * @flags: compatible specific SPI controller flags used at registration time
  */
 struct stm32_spi_cfg {
        const struct stm32_spi_regspec *regs;
@@ -253,6 +252,7 @@ struct stm32_spi_cfg {
        unsigned int baud_rate_div_min;
        unsigned int baud_rate_div_max;
        bool has_fifo;
+       u16 flags;
 };
 
 /**
@@ -1722,6 +1722,7 @@ static const struct stm32_spi_cfg stm32f4_spi_cfg = {
        .baud_rate_div_min = STM32F4_SPI_BR_DIV_MIN,
        .baud_rate_div_max = STM32F4_SPI_BR_DIV_MAX,
        .has_fifo = false,
+       .flags = SPI_MASTER_MUST_TX,
 };
 
 static const struct stm32_spi_cfg stm32h7_spi_cfg = {
@@ -1854,7 +1855,7 @@ static int stm32_spi_probe(struct platform_device *pdev)
        master->prepare_message = stm32_spi_prepare_msg;
        master->transfer_one = stm32_spi_transfer_one;
        master->unprepare_message = stm32_spi_unprepare_msg;
-       master->flags = SPI_MASTER_MUST_TX;
+       master->flags = spi->cfg->flags;
 
        spi->dma_tx = dma_request_chan(spi->dev, "tx");
        if (IS_ERR(spi->dma_tx)) {
index 342ee8d..cc0da48 100644 (file)
@@ -726,7 +726,7 @@ static int uniphier_spi_probe(struct platform_device *pdev)
                if (ret) {
                        dev_err(&pdev->dev, "failed to get TX DMA capacities: %d\n",
                                ret);
-                       goto out_disable_clk;
+                       goto out_release_dma;
                }
                dma_tx_burst = caps.max_burst;
        }
@@ -735,7 +735,7 @@ static int uniphier_spi_probe(struct platform_device *pdev)
        if (IS_ERR_OR_NULL(master->dma_rx)) {
                if (PTR_ERR(master->dma_rx) == -EPROBE_DEFER) {
                        ret = -EPROBE_DEFER;
-                       goto out_disable_clk;
+                       goto out_release_dma;
                }
                master->dma_rx = NULL;
                dma_rx_burst = INT_MAX;
@@ -744,7 +744,7 @@ static int uniphier_spi_probe(struct platform_device *pdev)
                if (ret) {
                        dev_err(&pdev->dev, "failed to get RX DMA capacities: %d\n",
                                ret);
-                       goto out_disable_clk;
+                       goto out_release_dma;
                }
                dma_rx_burst = caps.max_burst;
        }
@@ -753,10 +753,20 @@ static int uniphier_spi_probe(struct platform_device *pdev)
 
        ret = devm_spi_register_master(&pdev->dev, master);
        if (ret)
-               goto out_disable_clk;
+               goto out_release_dma;
 
        return 0;
 
+out_release_dma:
+       if (!IS_ERR_OR_NULL(master->dma_rx)) {
+               dma_release_channel(master->dma_rx);
+               master->dma_rx = NULL;
+       }
+       if (!IS_ERR_OR_NULL(master->dma_tx)) {
+               dma_release_channel(master->dma_tx);
+               master->dma_tx = NULL;
+       }
+
 out_disable_clk:
        clk_disable_unprepare(priv->clk);
 
index 8075f60..2d5cf17 100644 (file)
@@ -443,6 +443,9 @@ static bool iscsit_tpg_check_network_portal(
                                break;
                }
                spin_unlock(&tpg->tpg_np_lock);
+
+               if (match)
+                       break;
        }
        spin_unlock(&tiqn->tiqn_tpg_lock);
 
index ba27b27..0b1808e 100644 (file)
@@ -322,6 +322,7 @@ static int addr_cnt;
 #define GSM1_ESCAPE_BITS       0x20
 #define XON                    0x11
 #define XOFF                   0x13
+#define ISO_IEC_646_MASK       0x7F
 
 static const struct tty_port_operations gsm_port_ops;
 
@@ -531,7 +532,8 @@ static int gsm_stuff_frame(const u8 *input, u8 *output, int len)
        int olen = 0;
        while (len--) {
                if (*input == GSM1_SOF || *input == GSM1_ESCAPE
-                   || *input == XON || *input == XOFF) {
+                   || (*input & ISO_IEC_646_MASK) == XON
+                   || (*input & ISO_IEC_646_MASK) == XOFF) {
                        *output++ = GSM1_ESCAPE;
                        *output++ = *input++ ^ GSM1_ESCAPE_BITS;
                        olen++;
index dae2a4e..29db413 100644 (file)
@@ -50,10 +50,17 @@ static int rpmsg_tty_cb(struct rpmsg_device *rpdev, void *data, int len, void *p
 static int rpmsg_tty_install(struct tty_driver *driver, struct tty_struct *tty)
 {
        struct rpmsg_tty_port *cport = idr_find(&tty_idr, tty->index);
+       struct tty_port *port;
 
        tty->driver_data = cport;
 
-       return tty_port_install(&cport->port, driver, tty);
+       port = tty_port_get(&cport->port);
+       return tty_port_install(port, driver, tty);
+}
+
+static void rpmsg_tty_cleanup(struct tty_struct *tty)
+{
+       tty_port_put(tty->port);
 }
 
 static int rpmsg_tty_open(struct tty_struct *tty, struct file *filp)
@@ -106,12 +113,19 @@ static unsigned int rpmsg_tty_write_room(struct tty_struct *tty)
        return size;
 }
 
+static void rpmsg_tty_hangup(struct tty_struct *tty)
+{
+       tty_port_hangup(tty->port);
+}
+
 static const struct tty_operations rpmsg_tty_ops = {
        .install        = rpmsg_tty_install,
        .open           = rpmsg_tty_open,
        .close          = rpmsg_tty_close,
        .write          = rpmsg_tty_write,
        .write_room     = rpmsg_tty_write_room,
+       .hangup         = rpmsg_tty_hangup,
+       .cleanup        = rpmsg_tty_cleanup,
 };
 
 static struct rpmsg_tty_port *rpmsg_tty_alloc_cport(void)
@@ -137,8 +151,10 @@ static struct rpmsg_tty_port *rpmsg_tty_alloc_cport(void)
        return cport;
 }
 
-static void rpmsg_tty_release_cport(struct rpmsg_tty_port *cport)
+static void rpmsg_tty_destruct_port(struct tty_port *port)
 {
+       struct rpmsg_tty_port *cport = container_of(port, struct rpmsg_tty_port, port);
+
        mutex_lock(&idr_lock);
        idr_remove(&tty_idr, cport->id);
        mutex_unlock(&idr_lock);
@@ -146,7 +162,10 @@ static void rpmsg_tty_release_cport(struct rpmsg_tty_port *cport)
        kfree(cport);
 }
 
-static const struct tty_port_operations rpmsg_tty_port_ops = { };
+static const struct tty_port_operations rpmsg_tty_port_ops = {
+       .destruct = rpmsg_tty_destruct_port,
+};
+
 
 static int rpmsg_tty_probe(struct rpmsg_device *rpdev)
 {
@@ -166,7 +185,8 @@ static int rpmsg_tty_probe(struct rpmsg_device *rpdev)
                                           cport->id, dev);
        if (IS_ERR(tty_dev)) {
                ret = dev_err_probe(dev, PTR_ERR(tty_dev), "Failed to register tty port\n");
-               goto err_destroy;
+               tty_port_put(&cport->port);
+               return ret;
        }
 
        cport->rpdev = rpdev;
@@ -177,12 +197,6 @@ static int rpmsg_tty_probe(struct rpmsg_device *rpdev)
                rpdev->src, rpdev->dst, cport->id);
 
        return 0;
-
-err_destroy:
-       tty_port_destroy(&cport->port);
-       rpmsg_tty_release_cport(cport);
-
-       return ret;
 }
 
 static void rpmsg_tty_remove(struct rpmsg_device *rpdev)
@@ -192,13 +206,11 @@ static void rpmsg_tty_remove(struct rpmsg_device *rpdev)
        dev_dbg(&rpdev->dev, "Removing rpmsg tty device %d\n", cport->id);
 
        /* User hang up to release the tty */
-       if (tty_port_initialized(&cport->port))
-               tty_port_tty_hangup(&cport->port, false);
+       tty_port_tty_hangup(&cport->port, false);
 
        tty_unregister_device(rpmsg_tty_driver, cport->id);
 
-       tty_port_destroy(&cport->port);
-       rpmsg_tty_release_cport(cport);
+       tty_port_put(&cport->port);
 }
 
 static struct rpmsg_device_id rpmsg_driver_tty_id_table[] = {
index bce2872..be86262 100644 (file)
@@ -83,8 +83,17 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
                port->mapsize = resource_size(&resource);
 
                /* Check for shifted address mapping */
-               if (of_property_read_u32(np, "reg-offset", &prop) == 0)
+               if (of_property_read_u32(np, "reg-offset", &prop) == 0) {
+                       if (prop >= port->mapsize) {
+                               dev_warn(&ofdev->dev, "reg-offset %u exceeds region size %pa\n",
+                                        prop, &port->mapsize);
+                               ret = -EINVAL;
+                               goto err_unprepare;
+                       }
+
                        port->mapbase += prop;
+                       port->mapsize -= prop;
+               }
 
                port->iotype = UPIO_MEM;
                if (of_property_read_u32(np, "reg-io-width", &prop) == 0) {
index e8b5469..e17e97e 100644 (file)
@@ -4779,8 +4779,30 @@ static const struct pci_device_id serial_pci_tbl[] = {
        {       PCI_VENDOR_ID_INTASHIELD, PCI_DEVICE_ID_INTASHIELD_IS400,
                PCI_ANY_ID, PCI_ANY_ID, 0, 0,    /* 135a.0dc0 */
                pbn_b2_4_115200 },
+       /* Brainboxes Devices */
        /*
-        * BrainBoxes UC-260
+       * Brainboxes UC-101
+       */
+       {       PCI_VENDOR_ID_INTASHIELD, 0x0BA1,
+               PCI_ANY_ID, PCI_ANY_ID,
+               0, 0,
+               pbn_b2_2_115200 },
+       /*
+        * Brainboxes UC-235/246
+        */
+       {       PCI_VENDOR_ID_INTASHIELD, 0x0AA1,
+               PCI_ANY_ID, PCI_ANY_ID,
+               0, 0,
+               pbn_b2_1_115200 },
+       /*
+        * Brainboxes UC-257
+        */
+       {       PCI_VENDOR_ID_INTASHIELD, 0x0861,
+               PCI_ANY_ID, PCI_ANY_ID,
+               0, 0,
+               pbn_b2_2_115200 },
+       /*
+        * Brainboxes UC-260/271/701/756
         */
        {       PCI_VENDOR_ID_INTASHIELD, 0x0D21,
                PCI_ANY_ID, PCI_ANY_ID,
@@ -4788,7 +4810,81 @@ static const struct pci_device_id serial_pci_tbl[] = {
                pbn_b2_4_115200 },
        {       PCI_VENDOR_ID_INTASHIELD, 0x0E34,
                PCI_ANY_ID, PCI_ANY_ID,
-                PCI_CLASS_COMMUNICATION_MULTISERIAL << 8, 0xffff00,
+               PCI_CLASS_COMMUNICATION_MULTISERIAL << 8, 0xffff00,
+               pbn_b2_4_115200 },
+       /*
+        * Brainboxes UC-268
+        */
+       {       PCI_VENDOR_ID_INTASHIELD, 0x0841,
+               PCI_ANY_ID, PCI_ANY_ID,
+               0, 0,
+               pbn_b2_4_115200 },
+       /*
+        * Brainboxes UC-275/279
+        */
+       {       PCI_VENDOR_ID_INTASHIELD, 0x0881,
+               PCI_ANY_ID, PCI_ANY_ID,
+               0, 0,
+               pbn_b2_8_115200 },
+       /*
+        * Brainboxes UC-302
+        */
+       {       PCI_VENDOR_ID_INTASHIELD, 0x08E1,
+               PCI_ANY_ID, PCI_ANY_ID,
+               0, 0,
+               pbn_b2_2_115200 },
+       /*
+        * Brainboxes UC-310
+        */
+       {       PCI_VENDOR_ID_INTASHIELD, 0x08C1,
+               PCI_ANY_ID, PCI_ANY_ID,
+               0, 0,
+               pbn_b2_2_115200 },
+       /*
+        * Brainboxes UC-313
+        */
+       {       PCI_VENDOR_ID_INTASHIELD, 0x08A3,
+               PCI_ANY_ID, PCI_ANY_ID,
+               0, 0,
+               pbn_b2_2_115200 },
+       /*
+        * Brainboxes UC-320/324
+        */
+       {       PCI_VENDOR_ID_INTASHIELD, 0x0A61,
+               PCI_ANY_ID, PCI_ANY_ID,
+               0, 0,
+               pbn_b2_1_115200 },
+       /*
+        * Brainboxes UC-346
+        */
+       {       PCI_VENDOR_ID_INTASHIELD, 0x0B02,
+               PCI_ANY_ID, PCI_ANY_ID,
+               0, 0,
+               pbn_b2_4_115200 },
+       /*
+        * Brainboxes UC-357
+        */
+       {       PCI_VENDOR_ID_INTASHIELD, 0x0A81,
+               PCI_ANY_ID, PCI_ANY_ID,
+               0, 0,
+               pbn_b2_2_115200 },
+       {       PCI_VENDOR_ID_INTASHIELD, 0x0A83,
+               PCI_ANY_ID, PCI_ANY_ID,
+               0, 0,
+               pbn_b2_2_115200 },
+       /*
+        * Brainboxes UC-368
+        */
+       {       PCI_VENDOR_ID_INTASHIELD, 0x0C41,
+               PCI_ANY_ID, PCI_ANY_ID,
+               0, 0,
+               pbn_b2_4_115200 },
+       /*
+        * Brainboxes UC-420/431
+        */
+       {       PCI_VENDOR_ID_INTASHIELD, 0x0921,
+               PCI_ANY_ID, PCI_ANY_ID,
+               0, 0,
                pbn_b2_4_115200 },
        /*
         * Perle PCI-RAS cards
index 2abb3de..3b12bfc 100644 (file)
@@ -2056,7 +2056,10 @@ static void serial8250_break_ctl(struct uart_port *port, int break_state)
        serial8250_rpm_put(up);
 }
 
-static void wait_for_lsr(struct uart_8250_port *up, int bits)
+/*
+ *     Wait for transmitter & holding register to empty
+ */
+static void wait_for_xmitr(struct uart_8250_port *up, int bits)
 {
        unsigned int status, tmout = 10000;
 
@@ -2073,16 +2076,6 @@ static void wait_for_lsr(struct uart_8250_port *up, int bits)
                udelay(1);
                touch_nmi_watchdog();
        }
-}
-
-/*
- *     Wait for transmitter & holding register to empty
- */
-static void wait_for_xmitr(struct uart_8250_port *up, int bits)
-{
-       unsigned int tmout;
-
-       wait_for_lsr(up, bits);
 
        /* Wait up to 1s for flow control if necessary */
        if (up->port.flags & UPF_CONS_FLOW) {
@@ -3333,35 +3326,6 @@ static void serial8250_console_restore(struct uart_8250_port *up)
 }
 
 /*
- * Print a string to the serial port using the device FIFO
- *
- * It sends fifosize bytes and then waits for the fifo
- * to get empty.
- */
-static void serial8250_console_fifo_write(struct uart_8250_port *up,
-                                         const char *s, unsigned int count)
-{
-       int i;
-       const char *end = s + count;
-       unsigned int fifosize = up->port.fifosize;
-       bool cr_sent = false;
-
-       while (s != end) {
-               wait_for_lsr(up, UART_LSR_THRE);
-
-               for (i = 0; i < fifosize && s != end; ++i) {
-                       if (*s == '\n' && !cr_sent) {
-                               serial_out(up, UART_TX, '\r');
-                               cr_sent = true;
-                       } else {
-                               serial_out(up, UART_TX, *s++);
-                               cr_sent = false;
-                       }
-               }
-       }
-}
-
-/*
  *     Print a string to the serial port trying not to disturb
  *     any possible real use of the port...
  *
@@ -3376,7 +3340,7 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s,
        struct uart_8250_em485 *em485 = up->em485;
        struct uart_port *port = &up->port;
        unsigned long flags;
-       unsigned int ier, use_fifo;
+       unsigned int ier;
        int locked = 1;
 
        touch_nmi_watchdog();
@@ -3408,20 +3372,7 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s,
                mdelay(port->rs485.delay_rts_before_send);
        }
 
-       use_fifo = (up->capabilities & UART_CAP_FIFO) &&
-               port->fifosize > 1 &&
-               (serial_port_in(port, UART_FCR) & UART_FCR_ENABLE_FIFO) &&
-               /*
-                * After we put a data in the fifo, the controller will send
-                * it regardless of the CTS state. Therefore, only use fifo
-                * if we don't use control flow.
-                */
-               !(up->port.flags & UPF_CONS_FLOW);
-
-       if (likely(use_fifo))
-               serial8250_console_fifo_write(up, s, count);
-       else
-               uart_console_write(port, s, count, serial8250_console_putchar);
+       uart_console_write(port, s, count, serial8250_console_putchar);
 
        /*
         *      Finally, wait for transmitter to become empty
index 1f1df46..ba053a6 100644 (file)
@@ -1582,9 +1582,6 @@ static void pl011_set_mctrl(struct uart_port *port, unsigned int mctrl)
            container_of(port, struct uart_amba_port, port);
        unsigned int cr;
 
-       if (port->rs485.flags & SER_RS485_ENABLED)
-               mctrl &= ~TIOCM_RTS;
-
        cr = pl011_read(uap, REG_CR);
 
 #define        TIOCMBIT(tiocmbit, uartbit)             \
@@ -1808,14 +1805,8 @@ static int pl011_startup(struct uart_port *port)
        cr &= UART011_CR_RTS | UART011_CR_DTR;
        cr |= UART01x_CR_UARTEN | UART011_CR_RXE;
 
-       if (port->rs485.flags & SER_RS485_ENABLED) {
-               if (port->rs485.flags & SER_RS485_RTS_AFTER_SEND)
-                       cr &= ~UART011_CR_RTS;
-               else
-                       cr |= UART011_CR_RTS;
-       } else {
+       if (!(port->rs485.flags & SER_RS485_ENABLED))
                cr |= UART011_CR_TXE;
-       }
 
        pl011_write(cr, uap, REG_CR);
 
index dc40c41..0db90be 100644 (file)
@@ -144,6 +144,11 @@ uart_update_mctrl(struct uart_port *port, unsigned int set, unsigned int clear)
        unsigned long flags;
        unsigned int old;
 
+       if (port->rs485.flags & SER_RS485_ENABLED) {
+               set &= ~TIOCM_RTS;
+               clear &= ~TIOCM_RTS;
+       }
+
        spin_lock_irqsave(&port->lock, flags);
        old = port->mctrl;
        port->mctrl = (old & ~clear) | set;
@@ -157,23 +162,10 @@ uart_update_mctrl(struct uart_port *port, unsigned int set, unsigned int clear)
 
 static void uart_port_dtr_rts(struct uart_port *uport, int raise)
 {
-       int rs485_on = uport->rs485_config &&
-               (uport->rs485.flags & SER_RS485_ENABLED);
-       int RTS_after_send = !!(uport->rs485.flags & SER_RS485_RTS_AFTER_SEND);
-
-       if (raise) {
-               if (rs485_on && RTS_after_send) {
-                       uart_set_mctrl(uport, TIOCM_DTR);
-                       uart_clear_mctrl(uport, TIOCM_RTS);
-               } else {
-                       uart_set_mctrl(uport, TIOCM_DTR | TIOCM_RTS);
-               }
-       } else {
-               unsigned int clear = TIOCM_DTR;
-
-               clear |= (!rs485_on || RTS_after_send) ? TIOCM_RTS : 0;
-               uart_clear_mctrl(uport, clear);
-       }
+       if (raise)
+               uart_set_mctrl(uport, TIOCM_DTR | TIOCM_RTS);
+       else
+               uart_clear_mctrl(uport, TIOCM_DTR | TIOCM_RTS);
 }
 
 /*
@@ -1075,11 +1067,6 @@ uart_tiocmset(struct tty_struct *tty, unsigned int set, unsigned int clear)
                goto out;
 
        if (!tty_io_error(tty)) {
-               if (uport->rs485.flags & SER_RS485_ENABLED) {
-                       set &= ~TIOCM_RTS;
-                       clear &= ~TIOCM_RTS;
-               }
-
                uart_update_mctrl(uport, set, clear);
                ret = 0;
        }
@@ -2390,6 +2377,9 @@ uart_configure_port(struct uart_driver *drv, struct uart_state *state,
                 */
                spin_lock_irqsave(&port->lock, flags);
                port->mctrl &= TIOCM_DTR;
+               if (port->rs485.flags & SER_RS485_ENABLED &&
+                   !(port->rs485.flags & SER_RS485_RTS_AFTER_SEND))
+                       port->mctrl |= TIOCM_RTS;
                port->ops->set_mctrl(port, port->mctrl);
                spin_unlock_irqrestore(&port->lock, flags);
 
index 1f89ab0..9570002 100644 (file)
@@ -550,11 +550,23 @@ static void stm32_usart_transmit_chars(struct uart_port *port)
        struct stm32_port *stm32_port = to_stm32_port(port);
        const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
        struct circ_buf *xmit = &port->state->xmit;
+       u32 isr;
+       int ret;
 
        if (port->x_char) {
                if (stm32_usart_tx_dma_started(stm32_port) &&
                    stm32_usart_tx_dma_enabled(stm32_port))
                        stm32_usart_clr_bits(port, ofs->cr3, USART_CR3_DMAT);
+
+               /* Check that TDR is empty before filling FIFO */
+               ret =
+               readl_relaxed_poll_timeout_atomic(port->membase + ofs->isr,
+                                                 isr,
+                                                 (isr & USART_SR_TXE),
+                                                 10, 1000);
+               if (ret)
+                       dev_warn(port->dev, "1 character may be erased\n");
+
                writel_relaxed(port->x_char, port->membase + ofs->tdr);
                port->x_char = 0;
                port->icount.tx++;
@@ -730,7 +742,7 @@ static void stm32_usart_start_tx(struct uart_port *port)
        struct serial_rs485 *rs485conf = &port->rs485;
        struct circ_buf *xmit = &port->state->xmit;
 
-       if (uart_circ_empty(xmit))
+       if (uart_circ_empty(xmit) && !port->x_char)
                return;
 
        if (rs485conf->flags & SER_RS485_ENABLED) {
index 55c73b1..d00ff98 100644 (file)
@@ -483,11 +483,11 @@ int cdns_drd_exit(struct cdns *cdns)
 /* Indicate the cdns3 core was power lost before */
 bool cdns_power_is_lost(struct cdns *cdns)
 {
-       if (cdns->version == CDNS3_CONTROLLER_V1) {
-               if (!(readl(&cdns->otg_v1_regs->simulate) & BIT(0)))
+       if (cdns->version == CDNS3_CONTROLLER_V0) {
+               if (!(readl(&cdns->otg_v0_regs->simulate) & BIT(0)))
                        return true;
        } else {
-               if (!(readl(&cdns->otg_v0_regs->simulate) & BIT(0)))
+               if (!(readl(&cdns->otg_v1_regs->simulate) & BIT(0)))
                        return true;
        }
        return false;
index 4169cf4..8f8405b 100644 (file)
@@ -39,8 +39,11 @@ static int ulpi_match(struct device *dev, struct device_driver *driver)
        struct ulpi *ulpi = to_ulpi_dev(dev);
        const struct ulpi_device_id *id;
 
-       /* Some ULPI devices don't have a vendor id so rely on OF match */
-       if (ulpi->id.vendor == 0)
+       /*
+        * Some ULPI devices don't have a vendor id
+        * or provide an id_table so rely on OF match.
+        */
+       if (ulpi->id.vendor == 0 || !drv->id_table)
                return of_driver_match_device(dev, driver);
 
        for (id = drv->id_table; id->vendor; id++)
index 3e01dd6..d9712c2 100644 (file)
@@ -1563,6 +1563,13 @@ int usb_hcd_submit_urb (struct urb *urb, gfp_t mem_flags)
                urb->hcpriv = NULL;
                INIT_LIST_HEAD(&urb->urb_list);
                atomic_dec(&urb->use_count);
+               /*
+                * Order the write of urb->use_count above before the read
+                * of urb->reject below.  Pairs with the memory barriers in
+                * usb_kill_urb() and usb_poison_urb().
+                */
+               smp_mb__after_atomic();
+
                atomic_dec(&urb->dev->urbnum);
                if (atomic_read(&urb->reject))
                        wake_up(&usb_kill_urb_queue);
@@ -1665,6 +1672,13 @@ static void __usb_hcd_giveback_urb(struct urb *urb)
 
        usb_anchor_resume_wakeups(anchor);
        atomic_dec(&urb->use_count);
+       /*
+        * Order the write of urb->use_count above before the read
+        * of urb->reject below.  Pairs with the memory barriers in
+        * usb_kill_urb() and usb_poison_urb().
+        */
+       smp_mb__after_atomic();
+
        if (unlikely(atomic_read(&urb->reject)))
                wake_up(&usb_kill_urb_queue);
        usb_put_urb(urb);
index 3072772..33d62d7 100644 (file)
@@ -715,6 +715,12 @@ void usb_kill_urb(struct urb *urb)
        if (!(urb && urb->dev && urb->ep))
                return;
        atomic_inc(&urb->reject);
+       /*
+        * Order the write of urb->reject above before the read
+        * of urb->use_count below.  Pairs with the barriers in
+        * __usb_hcd_giveback_urb() and usb_hcd_submit_urb().
+        */
+       smp_mb__after_atomic();
 
        usb_hcd_unlink_urb(urb, -ENOENT);
        wait_event(usb_kill_urb_queue, atomic_read(&urb->use_count) == 0);
@@ -756,6 +762,12 @@ void usb_poison_urb(struct urb *urb)
        if (!urb)
                return;
        atomic_inc(&urb->reject);
+       /*
+        * Order the write of urb->reject above before the read
+        * of urb->use_count below.  Pairs with the barriers in
+        * __usb_hcd_giveback_urb() and usb_hcd_submit_urb().
+        */
+       smp_mb__after_atomic();
 
        if (!urb->dev || !urb->ep)
                return;
index 2bc03f4..eee3504 100644 (file)
@@ -5097,7 +5097,7 @@ int dwc2_hsotg_suspend(struct dwc2_hsotg *hsotg)
                hsotg->gadget.speed = USB_SPEED_UNKNOWN;
                spin_unlock_irqrestore(&hsotg->lock, flags);
 
-               for (ep = 0; ep < hsotg->num_of_eps; ep++) {
+               for (ep = 1; ep < hsotg->num_of_eps; ep++) {
                        if (hsotg->eps_in[ep])
                                dwc2_hsotg_ep_disable_lock(&hsotg->eps_in[ep]->ep);
                        if (hsotg->eps_out[ep])
index 9cc3ad7..e14ac15 100644 (file)
@@ -102,14 +102,26 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data)
        int                     ret;
        u32                     reg;
 
-       usb3_phy = devm_phy_get(dev, "usb3-phy");
-       if (PTR_ERR(usb3_phy) == -EPROBE_DEFER) {
-               ret = -EPROBE_DEFER;
+       usb3_phy = devm_phy_optional_get(dev, "usb3-phy");
+       if (IS_ERR(usb3_phy)) {
+               ret = PTR_ERR(usb3_phy);
+               dev_err_probe(dev, ret,
+                             "failed to get USB3 PHY\n");
                goto err;
-       } else if (IS_ERR(usb3_phy)) {
-               usb3_phy = NULL;
        }
 
+       /*
+        * The following core resets are not required unless a USB3 PHY
+        * is used, and the subsequent register settings are not required
+        * unless a core reset is performed (they should be set properly
+        * by the first-stage boot loader, but may be reverted by a core
+        * reset). They may also break the configuration if USB3 is actually
+        * in use but the usb3-phy entry is missing from the device tree.
+        * Therefore, skip these operations in this case.
+        */
+       if (!usb3_phy)
+               goto skip_usb3_phy;
+
        crst = devm_reset_control_get_exclusive(dev, "usb_crst");
        if (IS_ERR(crst)) {
                ret = PTR_ERR(crst);
@@ -188,6 +200,7 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data)
                goto err;
        }
 
+skip_usb3_phy:
        /*
         * This routes the USB DMA traffic to go through FPD path instead
         * of reaching DDR directly. This traffic routing is needed to
index 1abf08e..6803cd6 100644 (file)
@@ -584,6 +584,7 @@ static int source_sink_start_ep(struct f_sourcesink *ss, bool is_in,
 
        if (is_iso) {
                switch (speed) {
+               case USB_SPEED_SUPER_PLUS:
                case USB_SPEED_SUPER:
                        size = ss->isoc_maxpacket *
                                        (ss->isoc_mult + 1) *
index dd0819d..9040a05 100644 (file)
@@ -1895,7 +1895,7 @@ static int at91udc_probe(struct platform_device *pdev)
                                        at91_vbus_irq, 0, driver_name, udc);
                        if (retval) {
                                DBG("request vbus irq %d failed\n",
-                                   udc->board.vbus_pin);
+                                   desc_to_gpio(udc->board.vbus_pin));
                                goto err_unprepare_iclk;
                        }
                }
index c1edcc9..dc570ce 100644 (file)
@@ -437,6 +437,9 @@ static int __maybe_unused xhci_plat_suspend(struct device *dev)
        struct xhci_hcd *xhci = hcd_to_xhci(hcd);
        int ret;
 
+       if (pm_runtime_suspended(dev))
+               pm_runtime_resume(dev);
+
        ret = xhci_priv_suspend_quirk(hcd);
        if (ret)
                return ret;
index 29191d3..1a05e3d 100644 (file)
@@ -2301,6 +2301,16 @@ UNUSUAL_DEV(  0x2027, 0xa001, 0x0000, 0x9999,
                USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init,
                US_FL_SCM_MULT_TARG ),
 
+/*
+ * Reported by DocMAX <mail@vacharakis.de>
+ * and Thomas Weißschuh <linux@weissschuh.net>
+ */
+UNUSUAL_DEV( 0x2109, 0x0715, 0x9999, 0x9999,
+               "VIA Labs, Inc.",
+               "VL817 SATA Bridge",
+               USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+               US_FL_IGNORE_UAS),
+
 UNUSUAL_DEV( 0x2116, 0x0320, 0x0001, 0x0001,
                "ST",
                "2A",
index 07d3074..a7d5078 100644 (file)
@@ -56,7 +56,12 @@ int typec_link_ports(struct typec_port *con)
 {
        struct each_port_arg arg = { .port = con, .match = NULL };
 
+       if (!has_acpi_companion(&con->dev))
+               return 0;
+
        bus_for_each_dev(&acpi_bus_type, NULL, &arg, typec_port_match);
+       if (!arg.match)
+               return 0;
 
        /*
         * REVISIT: Now each connector can have only a single component master.
@@ -74,5 +79,6 @@ int typec_link_ports(struct typec_port *con)
 
 void typec_unlink_ports(struct typec_port *con)
 {
-       component_master_del(&con->dev, &typec_aggregate_ops);
+       if (has_acpi_companion(&con->dev))
+               component_master_del(&con->dev, &typec_aggregate_ops);
 }
index 35a1307..e07d26a 100644 (file)
@@ -75,9 +75,25 @@ static int tcpci_write16(struct tcpci *tcpci, unsigned int reg, u16 val)
 static int tcpci_set_cc(struct tcpc_dev *tcpc, enum typec_cc_status cc)
 {
        struct tcpci *tcpci = tcpc_to_tcpci(tcpc);
+       bool vconn_pres;
+       enum typec_cc_polarity polarity = TYPEC_POLARITY_CC1;
        unsigned int reg;
        int ret;
 
+       ret = regmap_read(tcpci->regmap, TCPC_POWER_STATUS, &reg);
+       if (ret < 0)
+               return ret;
+
+       vconn_pres = !!(reg & TCPC_POWER_STATUS_VCONN_PRES);
+       if (vconn_pres) {
+               ret = regmap_read(tcpci->regmap, TCPC_TCPC_CTRL, &reg);
+               if (ret < 0)
+                       return ret;
+
+               if (reg & TCPC_TCPC_CTRL_ORIENTATION)
+                       polarity = TYPEC_POLARITY_CC2;
+       }
+
        switch (cc) {
        case TYPEC_CC_RA:
                reg = (TCPC_ROLE_CTRL_CC_RA << TCPC_ROLE_CTRL_CC1_SHIFT) |
@@ -112,6 +128,16 @@ static int tcpci_set_cc(struct tcpc_dev *tcpc, enum typec_cc_status cc)
                break;
        }
 
+       if (vconn_pres) {
+               if (polarity == TYPEC_POLARITY_CC2) {
+                       reg &= ~(TCPC_ROLE_CTRL_CC1_MASK << TCPC_ROLE_CTRL_CC1_SHIFT);
+                       reg |= (TCPC_ROLE_CTRL_CC_OPEN << TCPC_ROLE_CTRL_CC1_SHIFT);
+               } else {
+                       reg &= ~(TCPC_ROLE_CTRL_CC2_MASK << TCPC_ROLE_CTRL_CC2_SHIFT);
+                       reg |= (TCPC_ROLE_CTRL_CC_OPEN << TCPC_ROLE_CTRL_CC2_SHIFT);
+               }
+       }
+
        ret = regmap_write(tcpci->regmap, TCPC_ROLE_CTRL, reg);
        if (ret < 0)
                return ret;
index 2be7a77..b2edd45 100644 (file)
@@ -98,6 +98,7 @@
 #define TCPC_POWER_STATUS_SOURCING_VBUS        BIT(4)
 #define TCPC_POWER_STATUS_VBUS_DET     BIT(3)
 #define TCPC_POWER_STATUS_VBUS_PRES    BIT(2)
+#define TCPC_POWER_STATUS_VCONN_PRES   BIT(1)
 #define TCPC_POWER_STATUS_SINKING_VBUS BIT(0)
 
 #define TCPC_FAULT_STATUS              0x1f
index 59d4fa2..5fce795 100644 (file)
@@ -5156,7 +5156,8 @@ static void _tcpm_pd_vbus_off(struct tcpm_port *port)
        case SNK_TRYWAIT_DEBOUNCE:
                break;
        case SNK_ATTACH_WAIT:
-               tcpm_set_state(port, SNK_UNATTACHED, 0);
+       case SNK_DEBOUNCED:
+               /* Do nothing, as TCPM is still waiting for vbus to reaach VSAFE5V to connect */
                break;
 
        case SNK_NEGOTIATE_CAPABILITIES:
@@ -5263,6 +5264,10 @@ static void _tcpm_pd_vbus_vsafe0v(struct tcpm_port *port)
        case PR_SWAP_SNK_SRC_SOURCE_ON:
                /* Do nothing, vsafe0v is expected during transition */
                break;
+       case SNK_ATTACH_WAIT:
+       case SNK_DEBOUNCED:
+               /*Do nothing, still waiting for VSAFE5V for connect */
+               break;
        default:
                if (port->pwr_role == TYPEC_SINK && port->auto_vbus_discharge_enabled)
                        tcpm_set_state(port, SNK_UNATTACHED, 0);
index bff96d6..6db7c8d 100644 (file)
@@ -325,7 +325,7 @@ static int ucsi_ccg_init(struct ucsi_ccg *uc)
                if (status < 0)
                        return status;
 
-               if (!data)
+               if (!(data & DEV_INT))
                        return 0;
 
                status = ccg_write(uc, CCGX_RAB_INTR_REG, &data, sizeof(data));
index 840d981..fcc4638 100644 (file)
@@ -78,6 +78,26 @@ config FRAMEBUFFER_CONSOLE
        help
          Low-level framebuffer-based console driver.
 
+config FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION
+       bool "Enable legacy fbcon hardware acceleration code"
+       depends on FRAMEBUFFER_CONSOLE
+       default y if PARISC
+       default n
+       help
+         This option enables the fbcon (framebuffer text-based) hardware
+         acceleration for graphics drivers which were written for the fbdev
+         graphics interface.
+
+         On modern machines, on mainstream machines (like x86-64) or when
+         using a modern Linux distribution those fbdev drivers usually aren't used.
+         So enabling this option wouldn't have any effect, which is why you want
+         to disable this option on such newer machines.
+
+         If you compile this kernel for older machines which still require the
+         fbdev drivers, you may want to say Y.
+
+         If unsure, select n.
+
 config FRAMEBUFFER_CONSOLE_DETECT_PRIMARY
        bool "Map the console to the primary display device"
        depends on FRAMEBUFFER_CONSOLE
index 01fae2c..f98e8f2 100644 (file)
@@ -43,6 +43,21 @@ static void update_attr(u8 *dst, u8 *src, int attribute,
        }
 }
 
+static void bit_bmove(struct vc_data *vc, struct fb_info *info, int sy,
+                     int sx, int dy, int dx, int height, int width)
+{
+       struct fb_copyarea area;
+
+       area.sx = sx * vc->vc_font.width;
+       area.sy = sy * vc->vc_font.height;
+       area.dx = dx * vc->vc_font.width;
+       area.dy = dy * vc->vc_font.height;
+       area.height = height * vc->vc_font.height;
+       area.width = width * vc->vc_font.width;
+
+       info->fbops->fb_copyarea(info, &area);
+}
+
 static void bit_clear(struct vc_data *vc, struct fb_info *info, int sy,
                      int sx, int height, int width)
 {
@@ -378,6 +393,7 @@ static int bit_update_start(struct fb_info *info)
 
 void fbcon_set_bitops(struct fbcon_ops *ops)
 {
+       ops->bmove = bit_bmove;
        ops->clear = bit_clear;
        ops->putcs = bit_putcs;
        ops->clear_margins = bit_clear_margins;
index 99ecd9a..f36829e 100644 (file)
@@ -173,6 +173,8 @@ static void fbcon_putcs(struct vc_data *vc, const unsigned short *s,
                        int count, int ypos, int xpos);
 static void fbcon_clear_margins(struct vc_data *vc, int bottom_only);
 static void fbcon_cursor(struct vc_data *vc, int mode);
+static void fbcon_bmove(struct vc_data *vc, int sy, int sx, int dy, int dx,
+                       int height, int width);
 static int fbcon_switch(struct vc_data *vc);
 static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch);
 static void fbcon_set_palette(struct vc_data *vc, const unsigned char *table);
@@ -180,8 +182,16 @@ static void fbcon_set_palette(struct vc_data *vc, const unsigned char *table);
 /*
  *  Internal routines
  */
+static __inline__ void ywrap_up(struct vc_data *vc, int count);
+static __inline__ void ywrap_down(struct vc_data *vc, int count);
+static __inline__ void ypan_up(struct vc_data *vc, int count);
+static __inline__ void ypan_down(struct vc_data *vc, int count);
+static void fbcon_bmove_rec(struct vc_data *vc, struct fbcon_display *p, int sy, int sx,
+                           int dy, int dx, int height, int width, u_int y_break);
 static void fbcon_set_disp(struct fb_info *info, struct fb_var_screeninfo *var,
                           int unit);
+static void fbcon_redraw_move(struct vc_data *vc, struct fbcon_display *p,
+                             int line, int count, int dy);
 static void fbcon_modechanged(struct fb_info *info);
 static void fbcon_set_all_vcs(struct fb_info *info);
 static void fbcon_start(void);
@@ -1015,7 +1025,7 @@ static void fbcon_init(struct vc_data *vc, int init)
        struct vc_data *svc = *default_mode;
        struct fbcon_display *t, *p = &fb_display[vc->vc_num];
        int logo = 1, new_rows, new_cols, rows, cols;
-       int ret;
+       int cap, ret;
 
        if (WARN_ON(info_idx == -1))
            return;
@@ -1024,6 +1034,7 @@ static void fbcon_init(struct vc_data *vc, int init)
                con2fb_map[vc->vc_num] = info_idx;
 
        info = registered_fb[con2fb_map[vc->vc_num]];
+       cap = info->flags;
 
        if (logo_shown < 0 && console_loglevel <= CONSOLE_LOGLEVEL_QUIET)
                logo_shown = FBCON_LOGO_DONTSHOW;
@@ -1125,6 +1136,14 @@ static void fbcon_init(struct vc_data *vc, int init)
 
        ops->graphics = 0;
 
+#ifdef CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION
+       if ((cap & FBINFO_HWACCEL_COPYAREA) &&
+           !(cap & FBINFO_HWACCEL_DISABLED))
+               p->scrollmode = SCROLL_MOVE;
+       else /* default to something safe */
+               p->scrollmode = SCROLL_REDRAW;
+#endif
+
        /*
         *  ++guenther: console.c:vc_allocate() relies on initializing
         *  vc_{cols,rows}, but we must not set those if we are only
@@ -1211,13 +1230,14 @@ finished:
  *  This system is now divided into two levels because of complications
  *  caused by hardware scrolling. Top level functions:
  *
- *     fbcon_clear(), fbcon_putc(), fbcon_clear_margins()
+ *     fbcon_bmove(), fbcon_clear(), fbcon_putc(), fbcon_clear_margins()
  *
  *  handles y values in range [0, scr_height-1] that correspond to real
  *  screen positions. y_wrap shift means that first line of bitmap may be
  *  anywhere on this display. These functions convert lineoffsets to
  *  bitmap offsets and deal with the wrap-around case by splitting blits.
  *
+ *     fbcon_bmove_physical_8()    -- These functions fast implementations
  *     fbcon_clear_physical_8()    -- of original fbcon_XXX fns.
  *     fbcon_putc_physical_8()     -- (font width != 8) may be added later
  *
@@ -1390,6 +1410,224 @@ static void fbcon_set_disp(struct fb_info *info, struct fb_var_screeninfo *var,
        }
 }
 
+static __inline__ void ywrap_up(struct vc_data *vc, int count)
+{
+       struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
+       struct fbcon_ops *ops = info->fbcon_par;
+       struct fbcon_display *p = &fb_display[vc->vc_num];
+
+       p->yscroll += count;
+       if (p->yscroll >= p->vrows)     /* Deal with wrap */
+               p->yscroll -= p->vrows;
+       ops->var.xoffset = 0;
+       ops->var.yoffset = p->yscroll * vc->vc_font.height;
+       ops->var.vmode |= FB_VMODE_YWRAP;
+       ops->update_start(info);
+       scrollback_max += count;
+       if (scrollback_max > scrollback_phys_max)
+               scrollback_max = scrollback_phys_max;
+       scrollback_current = 0;
+}
+
+static __inline__ void ywrap_down(struct vc_data *vc, int count)
+{
+       struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
+       struct fbcon_ops *ops = info->fbcon_par;
+       struct fbcon_display *p = &fb_display[vc->vc_num];
+
+       p->yscroll -= count;
+       if (p->yscroll < 0)     /* Deal with wrap */
+               p->yscroll += p->vrows;
+       ops->var.xoffset = 0;
+       ops->var.yoffset = p->yscroll * vc->vc_font.height;
+       ops->var.vmode |= FB_VMODE_YWRAP;
+       ops->update_start(info);
+       scrollback_max -= count;
+       if (scrollback_max < 0)
+               scrollback_max = 0;
+       scrollback_current = 0;
+}
+
+static __inline__ void ypan_up(struct vc_data *vc, int count)
+{
+       struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
+       struct fbcon_display *p = &fb_display[vc->vc_num];
+       struct fbcon_ops *ops = info->fbcon_par;
+
+       p->yscroll += count;
+       if (p->yscroll > p->vrows - vc->vc_rows) {
+               ops->bmove(vc, info, p->vrows - vc->vc_rows,
+                           0, 0, 0, vc->vc_rows, vc->vc_cols);
+               p->yscroll -= p->vrows - vc->vc_rows;
+       }
+
+       ops->var.xoffset = 0;
+       ops->var.yoffset = p->yscroll * vc->vc_font.height;
+       ops->var.vmode &= ~FB_VMODE_YWRAP;
+       ops->update_start(info);
+       fbcon_clear_margins(vc, 1);
+       scrollback_max += count;
+       if (scrollback_max > scrollback_phys_max)
+               scrollback_max = scrollback_phys_max;
+       scrollback_current = 0;
+}
+
+static __inline__ void ypan_up_redraw(struct vc_data *vc, int t, int count)
+{
+       struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
+       struct fbcon_ops *ops = info->fbcon_par;
+       struct fbcon_display *p = &fb_display[vc->vc_num];
+
+       p->yscroll += count;
+
+       if (p->yscroll > p->vrows - vc->vc_rows) {
+               p->yscroll -= p->vrows - vc->vc_rows;
+               fbcon_redraw_move(vc, p, t + count, vc->vc_rows - count, t);
+       }
+
+       ops->var.xoffset = 0;
+       ops->var.yoffset = p->yscroll * vc->vc_font.height;
+       ops->var.vmode &= ~FB_VMODE_YWRAP;
+       ops->update_start(info);
+       fbcon_clear_margins(vc, 1);
+       scrollback_max += count;
+       if (scrollback_max > scrollback_phys_max)
+               scrollback_max = scrollback_phys_max;
+       scrollback_current = 0;
+}
+
+static __inline__ void ypan_down(struct vc_data *vc, int count)
+{
+       struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
+       struct fbcon_display *p = &fb_display[vc->vc_num];
+       struct fbcon_ops *ops = info->fbcon_par;
+
+       p->yscroll -= count;
+       if (p->yscroll < 0) {
+               ops->bmove(vc, info, 0, 0, p->vrows - vc->vc_rows,
+                           0, vc->vc_rows, vc->vc_cols);
+               p->yscroll += p->vrows - vc->vc_rows;
+       }
+
+       ops->var.xoffset = 0;
+       ops->var.yoffset = p->yscroll * vc->vc_font.height;
+       ops->var.vmode &= ~FB_VMODE_YWRAP;
+       ops->update_start(info);
+       fbcon_clear_margins(vc, 1);
+       scrollback_max -= count;
+       if (scrollback_max < 0)
+               scrollback_max = 0;
+       scrollback_current = 0;
+}
+
+static __inline__ void ypan_down_redraw(struct vc_data *vc, int t, int count)
+{
+       struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
+       struct fbcon_ops *ops = info->fbcon_par;
+       struct fbcon_display *p = &fb_display[vc->vc_num];
+
+       p->yscroll -= count;
+
+       if (p->yscroll < 0) {
+               p->yscroll += p->vrows - vc->vc_rows;
+               fbcon_redraw_move(vc, p, t, vc->vc_rows - count, t + count);
+       }
+
+       ops->var.xoffset = 0;
+       ops->var.yoffset = p->yscroll * vc->vc_font.height;
+       ops->var.vmode &= ~FB_VMODE_YWRAP;
+       ops->update_start(info);
+       fbcon_clear_margins(vc, 1);
+       scrollback_max -= count;
+       if (scrollback_max < 0)
+               scrollback_max = 0;
+       scrollback_current = 0;
+}
+
+static void fbcon_redraw_move(struct vc_data *vc, struct fbcon_display *p,
+                             int line, int count, int dy)
+{
+       unsigned short *s = (unsigned short *)
+               (vc->vc_origin + vc->vc_size_row * line);
+
+       while (count--) {
+               unsigned short *start = s;
+               unsigned short *le = advance_row(s, 1);
+               unsigned short c;
+               int x = 0;
+               unsigned short attr = 1;
+
+               do {
+                       c = scr_readw(s);
+                       if (attr != (c & 0xff00)) {
+                               attr = c & 0xff00;
+                               if (s > start) {
+                                       fbcon_putcs(vc, start, s - start,
+                                                   dy, x);
+                                       x += s - start;
+                                       start = s;
+                               }
+                       }
+                       console_conditional_schedule();
+                       s++;
+               } while (s < le);
+               if (s > start)
+                       fbcon_putcs(vc, start, s - start, dy, x);
+               console_conditional_schedule();
+               dy++;
+       }
+}
+
+static void fbcon_redraw_blit(struct vc_data *vc, struct fb_info *info,
+                       struct fbcon_display *p, int line, int count, int ycount)
+{
+       int offset = ycount * vc->vc_cols;
+       unsigned short *d = (unsigned short *)
+           (vc->vc_origin + vc->vc_size_row * line);
+       unsigned short *s = d + offset;
+       struct fbcon_ops *ops = info->fbcon_par;
+
+       while (count--) {
+               unsigned short *start = s;
+               unsigned short *le = advance_row(s, 1);
+               unsigned short c;
+               int x = 0;
+
+               do {
+                       c = scr_readw(s);
+
+                       if (c == scr_readw(d)) {
+                               if (s > start) {
+                                       ops->bmove(vc, info, line + ycount, x,
+                                                  line, x, 1, s-start);
+                                       x += s - start + 1;
+                                       start = s + 1;
+                               } else {
+                                       x++;
+                                       start++;
+                               }
+                       }
+
+                       scr_writew(c, d);
+                       console_conditional_schedule();
+                       s++;
+                       d++;
+               } while (s < le);
+               if (s > start)
+                       ops->bmove(vc, info, line + ycount, x, line, x, 1,
+                                  s-start);
+               console_conditional_schedule();
+               if (ycount > 0)
+                       line++;
+               else {
+                       line--;
+                       /* NOTE: We subtract two lines from these pointers */
+                       s -= vc->vc_size_row;
+                       d -= vc->vc_size_row;
+               }
+       }
+}
+
 static void fbcon_redraw(struct vc_data *vc, struct fbcon_display *p,
                         int line, int count, int offset)
 {
@@ -1450,6 +1688,7 @@ static bool fbcon_scroll(struct vc_data *vc, unsigned int t, unsigned int b,
 {
        struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
        struct fbcon_display *p = &fb_display[vc->vc_num];
+       int scroll_partial = info->flags & FBINFO_PARTIAL_PAN_OK;
 
        if (fbcon_is_inactive(vc, info))
                return true;
@@ -1466,32 +1705,291 @@ static bool fbcon_scroll(struct vc_data *vc, unsigned int t, unsigned int b,
        case SM_UP:
                if (count > vc->vc_rows)        /* Maximum realistic size */
                        count = vc->vc_rows;
-               fbcon_redraw(vc, p, t, b - t - count,
-                            count * vc->vc_cols);
-               fbcon_clear(vc, b - count, 0, count, vc->vc_cols);
-               scr_memsetw((unsigned short *) (vc->vc_origin +
-                                               vc->vc_size_row *
-                                               (b - count)),
-                           vc->vc_video_erase_char,
-                           vc->vc_size_row * count);
-               return true;
+               if (logo_shown >= 0)
+                       goto redraw_up;
+               switch (fb_scrollmode(p)) {
+               case SCROLL_MOVE:
+                       fbcon_redraw_blit(vc, info, p, t, b - t - count,
+                                    count);
+                       fbcon_clear(vc, b - count, 0, count, vc->vc_cols);
+                       scr_memsetw((unsigned short *) (vc->vc_origin +
+                                                       vc->vc_size_row *
+                                                       (b - count)),
+                                   vc->vc_video_erase_char,
+                                   vc->vc_size_row * count);
+                       return true;
+
+               case SCROLL_WRAP_MOVE:
+                       if (b - t - count > 3 * vc->vc_rows >> 2) {
+                               if (t > 0)
+                                       fbcon_bmove(vc, 0, 0, count, 0, t,
+                                                   vc->vc_cols);
+                               ywrap_up(vc, count);
+                               if (vc->vc_rows - b > 0)
+                                       fbcon_bmove(vc, b - count, 0, b, 0,
+                                                   vc->vc_rows - b,
+                                                   vc->vc_cols);
+                       } else if (info->flags & FBINFO_READS_FAST)
+                               fbcon_bmove(vc, t + count, 0, t, 0,
+                                           b - t - count, vc->vc_cols);
+                       else
+                               goto redraw_up;
+                       fbcon_clear(vc, b - count, 0, count, vc->vc_cols);
+                       break;
+
+               case SCROLL_PAN_REDRAW:
+                       if ((p->yscroll + count <=
+                            2 * (p->vrows - vc->vc_rows))
+                           && ((!scroll_partial && (b - t == vc->vc_rows))
+                               || (scroll_partial
+                                   && (b - t - count >
+                                       3 * vc->vc_rows >> 2)))) {
+                               if (t > 0)
+                                       fbcon_redraw_move(vc, p, 0, t, count);
+                               ypan_up_redraw(vc, t, count);
+                               if (vc->vc_rows - b > 0)
+                                       fbcon_redraw_move(vc, p, b,
+                                                         vc->vc_rows - b, b);
+                       } else
+                               fbcon_redraw_move(vc, p, t + count, b - t - count, t);
+                       fbcon_clear(vc, b - count, 0, count, vc->vc_cols);
+                       break;
+
+               case SCROLL_PAN_MOVE:
+                       if ((p->yscroll + count <=
+                            2 * (p->vrows - vc->vc_rows))
+                           && ((!scroll_partial && (b - t == vc->vc_rows))
+                               || (scroll_partial
+                                   && (b - t - count >
+                                       3 * vc->vc_rows >> 2)))) {
+                               if (t > 0)
+                                       fbcon_bmove(vc, 0, 0, count, 0, t,
+                                                   vc->vc_cols);
+                               ypan_up(vc, count);
+                               if (vc->vc_rows - b > 0)
+                                       fbcon_bmove(vc, b - count, 0, b, 0,
+                                                   vc->vc_rows - b,
+                                                   vc->vc_cols);
+                       } else if (info->flags & FBINFO_READS_FAST)
+                               fbcon_bmove(vc, t + count, 0, t, 0,
+                                           b - t - count, vc->vc_cols);
+                       else
+                               goto redraw_up;
+                       fbcon_clear(vc, b - count, 0, count, vc->vc_cols);
+                       break;
+
+               case SCROLL_REDRAW:
+                     redraw_up:
+                       fbcon_redraw(vc, p, t, b - t - count,
+                                    count * vc->vc_cols);
+                       fbcon_clear(vc, b - count, 0, count, vc->vc_cols);
+                       scr_memsetw((unsigned short *) (vc->vc_origin +
+                                                       vc->vc_size_row *
+                                                       (b - count)),
+                                   vc->vc_video_erase_char,
+                                   vc->vc_size_row * count);
+                       return true;
+               }
+               break;
 
        case SM_DOWN:
                if (count > vc->vc_rows)        /* Maximum realistic size */
                        count = vc->vc_rows;
-               fbcon_redraw(vc, p, b - 1, b - t - count,
-                            -count * vc->vc_cols);
-               fbcon_clear(vc, t, 0, count, vc->vc_cols);
-               scr_memsetw((unsigned short *) (vc->vc_origin +
-                                               vc->vc_size_row *
-                                               t),
-                           vc->vc_video_erase_char,
-                           vc->vc_size_row * count);
-               return true;
+               if (logo_shown >= 0)
+                       goto redraw_down;
+               switch (fb_scrollmode(p)) {
+               case SCROLL_MOVE:
+                       fbcon_redraw_blit(vc, info, p, b - 1, b - t - count,
+                                    -count);
+                       fbcon_clear(vc, t, 0, count, vc->vc_cols);
+                       scr_memsetw((unsigned short *) (vc->vc_origin +
+                                                       vc->vc_size_row *
+                                                       t),
+                                   vc->vc_video_erase_char,
+                                   vc->vc_size_row * count);
+                       return true;
+
+               case SCROLL_WRAP_MOVE:
+                       if (b - t - count > 3 * vc->vc_rows >> 2) {
+                               if (vc->vc_rows - b > 0)
+                                       fbcon_bmove(vc, b, 0, b - count, 0,
+                                                   vc->vc_rows - b,
+                                                   vc->vc_cols);
+                               ywrap_down(vc, count);
+                               if (t > 0)
+                                       fbcon_bmove(vc, count, 0, 0, 0, t,
+                                                   vc->vc_cols);
+                       } else if (info->flags & FBINFO_READS_FAST)
+                               fbcon_bmove(vc, t, 0, t + count, 0,
+                                           b - t - count, vc->vc_cols);
+                       else
+                               goto redraw_down;
+                       fbcon_clear(vc, t, 0, count, vc->vc_cols);
+                       break;
+
+               case SCROLL_PAN_MOVE:
+                       if ((count - p->yscroll <= p->vrows - vc->vc_rows)
+                           && ((!scroll_partial && (b - t == vc->vc_rows))
+                               || (scroll_partial
+                                   && (b - t - count >
+                                       3 * vc->vc_rows >> 2)))) {
+                               if (vc->vc_rows - b > 0)
+                                       fbcon_bmove(vc, b, 0, b - count, 0,
+                                                   vc->vc_rows - b,
+                                                   vc->vc_cols);
+                               ypan_down(vc, count);
+                               if (t > 0)
+                                       fbcon_bmove(vc, count, 0, 0, 0, t,
+                                                   vc->vc_cols);
+                       } else if (info->flags & FBINFO_READS_FAST)
+                               fbcon_bmove(vc, t, 0, t + count, 0,
+                                           b - t - count, vc->vc_cols);
+                       else
+                               goto redraw_down;
+                       fbcon_clear(vc, t, 0, count, vc->vc_cols);
+                       break;
+
+               case SCROLL_PAN_REDRAW:
+                       if ((count - p->yscroll <= p->vrows - vc->vc_rows)
+                           && ((!scroll_partial && (b - t == vc->vc_rows))
+                               || (scroll_partial
+                                   && (b - t - count >
+                                       3 * vc->vc_rows >> 2)))) {
+                               if (vc->vc_rows - b > 0)
+                                       fbcon_redraw_move(vc, p, b, vc->vc_rows - b,
+                                                         b - count);
+                               ypan_down_redraw(vc, t, count);
+                               if (t > 0)
+                                       fbcon_redraw_move(vc, p, count, t, 0);
+                       } else
+                               fbcon_redraw_move(vc, p, t, b - t - count, t + count);
+                       fbcon_clear(vc, t, 0, count, vc->vc_cols);
+                       break;
+
+               case SCROLL_REDRAW:
+                     redraw_down:
+                       fbcon_redraw(vc, p, b - 1, b - t - count,
+                                    -count * vc->vc_cols);
+                       fbcon_clear(vc, t, 0, count, vc->vc_cols);
+                       scr_memsetw((unsigned short *) (vc->vc_origin +
+                                                       vc->vc_size_row *
+                                                       t),
+                                   vc->vc_video_erase_char,
+                                   vc->vc_size_row * count);
+                       return true;
+               }
        }
        return false;
 }
 
+
+static void fbcon_bmove(struct vc_data *vc, int sy, int sx, int dy, int dx,
+                       int height, int width)
+{
+       struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
+       struct fbcon_display *p = &fb_display[vc->vc_num];
+
+       if (fbcon_is_inactive(vc, info))
+               return;
+
+       if (!width || !height)
+               return;
+
+       /*  Split blits that cross physical y_wrap case.
+        *  Pathological case involves 4 blits, better to use recursive
+        *  code rather than unrolled case
+        *
+        *  Recursive invocations don't need to erase the cursor over and
+        *  over again, so we use fbcon_bmove_rec()
+        */
+       fbcon_bmove_rec(vc, p, sy, sx, dy, dx, height, width,
+                       p->vrows - p->yscroll);
+}
+
+static void fbcon_bmove_rec(struct vc_data *vc, struct fbcon_display *p, int sy, int sx,
+                           int dy, int dx, int height, int width, u_int y_break)
+{
+       struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
+       struct fbcon_ops *ops = info->fbcon_par;
+       u_int b;
+
+       if (sy < y_break && sy + height > y_break) {
+               b = y_break - sy;
+               if (dy < sy) {  /* Avoid trashing self */
+                       fbcon_bmove_rec(vc, p, sy, sx, dy, dx, b, width,
+                                       y_break);
+                       fbcon_bmove_rec(vc, p, sy + b, sx, dy + b, dx,
+                                       height - b, width, y_break);
+               } else {
+                       fbcon_bmove_rec(vc, p, sy + b, sx, dy + b, dx,
+                                       height - b, width, y_break);
+                       fbcon_bmove_rec(vc, p, sy, sx, dy, dx, b, width,
+                                       y_break);
+               }
+               return;
+       }
+
+       if (dy < y_break && dy + height > y_break) {
+               b = y_break - dy;
+               if (dy < sy) {  /* Avoid trashing self */
+                       fbcon_bmove_rec(vc, p, sy, sx, dy, dx, b, width,
+                                       y_break);
+                       fbcon_bmove_rec(vc, p, sy + b, sx, dy + b, dx,
+                                       height - b, width, y_break);
+               } else {
+                       fbcon_bmove_rec(vc, p, sy + b, sx, dy + b, dx,
+                                       height - b, width, y_break);
+                       fbcon_bmove_rec(vc, p, sy, sx, dy, dx, b, width,
+                                       y_break);
+               }
+               return;
+       }
+       ops->bmove(vc, info, real_y(p, sy), sx, real_y(p, dy), dx,
+                  height, width);
+}
+
+static void updatescrollmode_accel(struct fbcon_display *p,
+                                       struct fb_info *info,
+                                       struct vc_data *vc)
+{
+#ifdef CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION
+       struct fbcon_ops *ops = info->fbcon_par;
+       int cap = info->flags;
+       u16 t = 0;
+       int ypan = FBCON_SWAP(ops->rotate, info->fix.ypanstep,
+                                 info->fix.xpanstep);
+       int ywrap = FBCON_SWAP(ops->rotate, info->fix.ywrapstep, t);
+       int yres = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);
+       int vyres = FBCON_SWAP(ops->rotate, info->var.yres_virtual,
+                                  info->var.xres_virtual);
+       int good_pan = (cap & FBINFO_HWACCEL_YPAN) &&
+               divides(ypan, vc->vc_font.height) && vyres > yres;
+       int good_wrap = (cap & FBINFO_HWACCEL_YWRAP) &&
+               divides(ywrap, vc->vc_font.height) &&
+               divides(vc->vc_font.height, vyres) &&
+               divides(vc->vc_font.height, yres);
+       int reading_fast = cap & FBINFO_READS_FAST;
+       int fast_copyarea = (cap & FBINFO_HWACCEL_COPYAREA) &&
+               !(cap & FBINFO_HWACCEL_DISABLED);
+       int fast_imageblit = (cap & FBINFO_HWACCEL_IMAGEBLIT) &&
+               !(cap & FBINFO_HWACCEL_DISABLED);
+
+       if (good_wrap || good_pan) {
+               if (reading_fast || fast_copyarea)
+                       p->scrollmode = good_wrap ?
+                               SCROLL_WRAP_MOVE : SCROLL_PAN_MOVE;
+               else
+                       p->scrollmode = good_wrap ? SCROLL_REDRAW :
+                               SCROLL_PAN_REDRAW;
+       } else {
+               if (reading_fast || (fast_copyarea && !fast_imageblit))
+                       p->scrollmode = SCROLL_MOVE;
+               else
+                       p->scrollmode = SCROLL_REDRAW;
+       }
+#endif
+}
+
 static void updatescrollmode(struct fbcon_display *p,
                                        struct fb_info *info,
                                        struct vc_data *vc)
@@ -1507,6 +2005,9 @@ static void updatescrollmode(struct fbcon_display *p,
                p->vrows -= (yres - (fh * vc->vc_rows)) / fh;
        if ((yres % fh) && (vyres % fh < yres % fh))
                p->vrows--;
+
+       /* update scrollmode in case hardware acceleration is used */
+       updatescrollmode_accel(p, info, vc);
 }
 
 #define PITCH(w) (((w) + 7) >> 3)
@@ -1664,7 +2165,21 @@ static int fbcon_switch(struct vc_data *vc)
 
        updatescrollmode(p, info, vc);
 
-       scrollback_phys_max = 0;
+       switch (fb_scrollmode(p)) {
+       case SCROLL_WRAP_MOVE:
+               scrollback_phys_max = p->vrows - vc->vc_rows;
+               break;
+       case SCROLL_PAN_MOVE:
+       case SCROLL_PAN_REDRAW:
+               scrollback_phys_max = p->vrows - 2 * vc->vc_rows;
+               if (scrollback_phys_max < 0)
+                       scrollback_phys_max = 0;
+               break;
+       default:
+               scrollback_phys_max = 0;
+               break;
+       }
+
        scrollback_max = 0;
        scrollback_current = 0;
 
index a00603b..969d41e 100644 (file)
@@ -29,6 +29,9 @@ struct fbcon_display {
     /* Filled in by the low-level console driver */
     const u_char *fontdata;
     int userfont;                   /* != 0 if fontdata kmalloc()ed */
+#ifdef CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION
+    u_short scrollmode;             /* Scroll Method, use fb_scrollmode() */
+#endif
     u_short inverse;                /* != 0 text black on white as default */
     short yscroll;                  /* Hardware scrolling */
     int vrows;                      /* number of virtual rows */
@@ -51,6 +54,8 @@ struct fbcon_display {
 };
 
 struct fbcon_ops {
+       void (*bmove)(struct vc_data *vc, struct fb_info *info, int sy,
+                     int sx, int dy, int dx, int height, int width);
        void (*clear)(struct vc_data *vc, struct fb_info *info, int sy,
                      int sx, int height, int width);
        void (*putcs)(struct vc_data *vc, struct fb_info *info,
@@ -149,6 +154,73 @@ static inline int attr_col_ec(int shift, struct vc_data *vc,
 #define attr_bgcol_ec(bgshift, vc, info) attr_col_ec(bgshift, vc, info, 0)
 #define attr_fgcol_ec(fgshift, vc, info) attr_col_ec(fgshift, vc, info, 1)
 
+    /*
+     *  Scroll Method
+     */
+
+/* There are several methods fbcon can use to move text around the screen:
+ *
+ *                     Operation   Pan    Wrap
+ *---------------------------------------------
+ * SCROLL_MOVE         copyarea    No     No
+ * SCROLL_PAN_MOVE     copyarea    Yes    No
+ * SCROLL_WRAP_MOVE    copyarea    No     Yes
+ * SCROLL_REDRAW       imageblit   No     No
+ * SCROLL_PAN_REDRAW   imageblit   Yes    No
+ * SCROLL_WRAP_REDRAW  imageblit   No     Yes
+ *
+ * (SCROLL_WRAP_REDRAW is not implemented yet)
+ *
+ * In general, fbcon will choose the best scrolling
+ * method based on the rule below:
+ *
+ * Pan/Wrap > accel imageblit > accel copyarea >
+ * soft imageblit > (soft copyarea)
+ *
+ * Exception to the rule: Pan + accel copyarea is
+ * preferred over Pan + accel imageblit.
+ *
+ * The above is typical for PCI/AGP cards. Unless
+ * overridden, fbcon will never use soft copyarea.
+ *
+ * If you need to override the above rule, set the
+ * appropriate flags in fb_info->flags.  For example,
+ * to prefer copyarea over imageblit, set
+ * FBINFO_READS_FAST.
+ *
+ * Other notes:
+ * + use the hardware engine to move the text
+ *    (hw-accelerated copyarea() and fillrect())
+ * + use hardware-supported panning on a large virtual screen
+ * + amifb can not only pan, but also wrap the display by N lines
+ *    (i.e. visible line i = physical line (i+N) % yres).
+ * + read what's already rendered on the screen and
+ *     write it in a different place (this is cfb_copyarea())
+ * + re-render the text to the screen
+ *
+ * Whether to use wrapping or panning can only be figured out at
+ * runtime (when we know whether our font height is a multiple
+ * of the pan/wrap step)
+ *
+ */
+
+#define SCROLL_MOVE       0x001
+#define SCROLL_PAN_MOVE           0x002
+#define SCROLL_WRAP_MOVE   0x003
+#define SCROLL_REDRAW     0x004
+#define SCROLL_PAN_REDRAW  0x005
+
+static inline u_short fb_scrollmode(struct fbcon_display *fb)
+{
+#ifdef CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION
+       return fb->scrollmode;
+#else
+       /* hardcoded to SCROLL_REDRAW if acceleration was disabled. */
+       return SCROLL_REDRAW;
+#endif
+}
+
+
 #ifdef CONFIG_FB_TILEBLITTING
 extern void fbcon_set_tileops(struct vc_data *vc, struct fb_info *info);
 #endif
index ffa7893..2789ace 100644 (file)
@@ -59,12 +59,31 @@ static void ccw_update_attr(u8 *dst, u8 *src, int attribute,
        }
 }
 
+
+static void ccw_bmove(struct vc_data *vc, struct fb_info *info, int sy,
+                    int sx, int dy, int dx, int height, int width)
+{
+       struct fbcon_ops *ops = info->fbcon_par;
+       struct fb_copyarea area;
+       u32 vyres = GETVYRES(ops->p, info);
+
+       area.sx = sy * vc->vc_font.height;
+       area.sy = vyres - ((sx + width) * vc->vc_font.width);
+       area.dx = dy * vc->vc_font.height;
+       area.dy = vyres - ((dx + width) * vc->vc_font.width);
+       area.width = height * vc->vc_font.height;
+       area.height  = width * vc->vc_font.width;
+
+       info->fbops->fb_copyarea(info, &area);
+}
+
 static void ccw_clear(struct vc_data *vc, struct fb_info *info, int sy,
                     int sx, int height, int width)
 {
+       struct fbcon_ops *ops = info->fbcon_par;
        struct fb_fillrect region;
        int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
-       u32 vyres = info->var.yres;
+       u32 vyres = GETVYRES(ops->p, info);
 
        region.color = attr_bgcol_ec(bgshift,vc,info);
        region.dx = sy * vc->vc_font.height;
@@ -121,7 +140,7 @@ static void ccw_putcs(struct vc_data *vc, struct fb_info *info,
        u32 cnt, pitch, size;
        u32 attribute = get_attribute(info, scr_readw(s));
        u8 *dst, *buf = NULL;
-       u32 vyres = info->var.yres;
+       u32 vyres = GETVYRES(ops->p, info);
 
        if (!ops->fontbuffer)
                return;
@@ -210,7 +229,7 @@ static void ccw_cursor(struct vc_data *vc, struct fb_info *info, int mode,
        int attribute, use_sw = vc->vc_cursor_type & CUR_SW;
        int err = 1, dx, dy;
        char *src;
-       u32 vyres = info->var.yres;
+       u32 vyres = GETVYRES(ops->p, info);
 
        if (!ops->fontbuffer)
                return;
@@ -368,7 +387,7 @@ static int ccw_update_start(struct fb_info *info)
 {
        struct fbcon_ops *ops = info->fbcon_par;
        u32 yoffset;
-       u32 vyres = info->var.yres;
+       u32 vyres = GETVYRES(ops->p, info);
        int err;
 
        yoffset = (vyres - info->var.yres) - ops->var.xoffset;
@@ -383,6 +402,7 @@ static int ccw_update_start(struct fb_info *info)
 
 void fbcon_rotate_ccw(struct fbcon_ops *ops)
 {
+       ops->bmove = ccw_bmove;
        ops->clear = ccw_clear;
        ops->putcs = ccw_putcs;
        ops->clear_margins = ccw_clear_margins;
index 92e5b7f..86a254c 100644 (file)
@@ -44,12 +44,31 @@ static void cw_update_attr(u8 *dst, u8 *src, int attribute,
        }
 }
 
+
+static void cw_bmove(struct vc_data *vc, struct fb_info *info, int sy,
+                    int sx, int dy, int dx, int height, int width)
+{
+       struct fbcon_ops *ops = info->fbcon_par;
+       struct fb_copyarea area;
+       u32 vxres = GETVXRES(ops->p, info);
+
+       area.sx = vxres - ((sy + height) * vc->vc_font.height);
+       area.sy = sx * vc->vc_font.width;
+       area.dx = vxres - ((dy + height) * vc->vc_font.height);
+       area.dy = dx * vc->vc_font.width;
+       area.width = height * vc->vc_font.height;
+       area.height  = width * vc->vc_font.width;
+
+       info->fbops->fb_copyarea(info, &area);
+}
+
 static void cw_clear(struct vc_data *vc, struct fb_info *info, int sy,
                     int sx, int height, int width)
 {
+       struct fbcon_ops *ops = info->fbcon_par;
        struct fb_fillrect region;
        int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
-       u32 vxres = info->var.xres;
+       u32 vxres = GETVXRES(ops->p, info);
 
        region.color = attr_bgcol_ec(bgshift,vc,info);
        region.dx = vxres - ((sy + height) * vc->vc_font.height);
@@ -106,7 +125,7 @@ static void cw_putcs(struct vc_data *vc, struct fb_info *info,
        u32 cnt, pitch, size;
        u32 attribute = get_attribute(info, scr_readw(s));
        u8 *dst, *buf = NULL;
-       u32 vxres = info->var.xres;
+       u32 vxres = GETVXRES(ops->p, info);
 
        if (!ops->fontbuffer)
                return;
@@ -193,7 +212,7 @@ static void cw_cursor(struct vc_data *vc, struct fb_info *info, int mode,
        int attribute, use_sw = vc->vc_cursor_type & CUR_SW;
        int err = 1, dx, dy;
        char *src;
-       u32 vxres = info->var.xres;
+       u32 vxres = GETVXRES(ops->p, info);
 
        if (!ops->fontbuffer)
                return;
@@ -350,7 +369,7 @@ static void cw_cursor(struct vc_data *vc, struct fb_info *info, int mode,
 static int cw_update_start(struct fb_info *info)
 {
        struct fbcon_ops *ops = info->fbcon_par;
-       u32 vxres = info->var.xres;
+       u32 vxres = GETVXRES(ops->p, info);
        u32 xoffset;
        int err;
 
@@ -366,6 +385,7 @@ static int cw_update_start(struct fb_info *info)
 
 void fbcon_rotate_cw(struct fbcon_ops *ops)
 {
+       ops->bmove = cw_bmove;
        ops->clear = cw_clear;
        ops->putcs = cw_putcs;
        ops->clear_margins = cw_clear_margins;
index b528b2e..01cbe30 100644 (file)
 #ifndef _FBCON_ROTATE_H
 #define _FBCON_ROTATE_H
 
+#define GETVYRES(s,i) ({                           \
+        (fb_scrollmode(s) == SCROLL_REDRAW || fb_scrollmode(s) == SCROLL_MOVE) ? \
+        (i)->var.yres : (i)->var.yres_virtual; })
+
+#define GETVXRES(s,i) ({                           \
+        (fb_scrollmode(s) == SCROLL_REDRAW || fb_scrollmode(s) == SCROLL_MOVE || !(i)->fix.xpanstep) ? \
+        (i)->var.xres : (i)->var.xres_virtual; })
+
+
 static inline int pattern_test_bit(u32 x, u32 y, u32 pitch, const char *pat)
 {
        u32 tmp = (y * pitch) + x, index = tmp / 8,  bit = tmp % 8;
index 09619bd..23bc045 100644 (file)
@@ -44,13 +44,33 @@ static void ud_update_attr(u8 *dst, u8 *src, int attribute,
        }
 }
 
+
+static void ud_bmove(struct vc_data *vc, struct fb_info *info, int sy,
+                    int sx, int dy, int dx, int height, int width)
+{
+       struct fbcon_ops *ops = info->fbcon_par;
+       struct fb_copyarea area;
+       u32 vyres = GETVYRES(ops->p, info);
+       u32 vxres = GETVXRES(ops->p, info);
+
+       area.sy = vyres - ((sy + height) * vc->vc_font.height);
+       area.sx = vxres - ((sx + width) * vc->vc_font.width);
+       area.dy = vyres - ((dy + height) * vc->vc_font.height);
+       area.dx = vxres - ((dx + width) * vc->vc_font.width);
+       area.height = height * vc->vc_font.height;
+       area.width  = width * vc->vc_font.width;
+
+       info->fbops->fb_copyarea(info, &area);
+}
+
 static void ud_clear(struct vc_data *vc, struct fb_info *info, int sy,
                     int sx, int height, int width)
 {
+       struct fbcon_ops *ops = info->fbcon_par;
        struct fb_fillrect region;
        int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
-       u32 vyres = info->var.yres;
-       u32 vxres = info->var.xres;
+       u32 vyres = GETVYRES(ops->p, info);
+       u32 vxres = GETVXRES(ops->p, info);
 
        region.color = attr_bgcol_ec(bgshift,vc,info);
        region.dy = vyres - ((sy + height) * vc->vc_font.height);
@@ -142,8 +162,8 @@ static void ud_putcs(struct vc_data *vc, struct fb_info *info,
        u32 mod = vc->vc_font.width % 8, cnt, pitch, size;
        u32 attribute = get_attribute(info, scr_readw(s));
        u8 *dst, *buf = NULL;
-       u32 vyres = info->var.yres;
-       u32 vxres = info->var.xres;
+       u32 vyres = GETVYRES(ops->p, info);
+       u32 vxres = GETVXRES(ops->p, info);
 
        if (!ops->fontbuffer)
                return;
@@ -239,8 +259,8 @@ static void ud_cursor(struct vc_data *vc, struct fb_info *info, int mode,
        int attribute, use_sw = vc->vc_cursor_type & CUR_SW;
        int err = 1, dx, dy;
        char *src;
-       u32 vyres = info->var.yres;
-       u32 vxres = info->var.xres;
+       u32 vyres = GETVYRES(ops->p, info);
+       u32 vxres = GETVXRES(ops->p, info);
 
        if (!ops->fontbuffer)
                return;
@@ -390,8 +410,8 @@ static int ud_update_start(struct fb_info *info)
 {
        struct fbcon_ops *ops = info->fbcon_par;
        int xoffset, yoffset;
-       u32 vyres = info->var.yres;
-       u32 vxres = info->var.xres;
+       u32 vyres = GETVYRES(ops->p, info);
+       u32 vxres = GETVXRES(ops->p, info);
        int err;
 
        xoffset = vxres - info->var.xres - ops->var.xoffset;
@@ -409,6 +429,7 @@ static int ud_update_start(struct fb_info *info)
 
 void fbcon_rotate_ud(struct fbcon_ops *ops)
 {
+       ops->bmove = ud_bmove;
        ops->clear = ud_clear;
        ops->putcs = ud_putcs;
        ops->clear_margins = ud_clear_margins;
index 72af950..2768eff 100644 (file)
 #include <asm/types.h>
 #include "fbcon.h"
 
+static void tile_bmove(struct vc_data *vc, struct fb_info *info, int sy,
+                      int sx, int dy, int dx, int height, int width)
+{
+       struct fb_tilearea area;
+
+       area.sx = sx;
+       area.sy = sy;
+       area.dx = dx;
+       area.dy = dy;
+       area.height = height;
+       area.width = width;
+
+       info->tileops->fb_tilecopy(info, &area);
+}
+
 static void tile_clear(struct vc_data *vc, struct fb_info *info, int sy,
                       int sx, int height, int width)
 {
@@ -118,6 +133,7 @@ void fbcon_set_tileops(struct vc_data *vc, struct fb_info *info)
        struct fb_tilemap map;
        struct fbcon_ops *ops = info->fbcon_par;
 
+       ops->bmove = tile_bmove;
        ops->clear = tile_clear;
        ops->putcs = tile_putcs;
        ops->clear_margins = tile_clear_margins;
index 23999df..c8e0ea2 100644 (file)
@@ -287,8 +287,6 @@ struct hvfb_par {
 
 static uint screen_width = HVFB_WIDTH;
 static uint screen_height = HVFB_HEIGHT;
-static uint screen_width_max = HVFB_WIDTH;
-static uint screen_height_max = HVFB_HEIGHT;
 static uint screen_depth;
 static uint screen_fb_size;
 static uint dio_fb_size; /* FB size for deferred IO */
@@ -582,7 +580,6 @@ static int synthvid_get_supported_resolution(struct hv_device *hdev)
        int ret = 0;
        unsigned long t;
        u8 index;
-       int i;
 
        memset(msg, 0, sizeof(struct synthvid_msg));
        msg->vid_hdr.type = SYNTHVID_RESOLUTION_REQUEST;
@@ -613,13 +610,6 @@ static int synthvid_get_supported_resolution(struct hv_device *hdev)
                goto out;
        }
 
-       for (i = 0; i < msg->resolution_resp.resolution_count; i++) {
-               screen_width_max = max_t(unsigned int, screen_width_max,
-                   msg->resolution_resp.supported_resolution[i].width);
-               screen_height_max = max_t(unsigned int, screen_height_max,
-                   msg->resolution_resp.supported_resolution[i].height);
-       }
-
        screen_width =
                msg->resolution_resp.supported_resolution[index].width;
        screen_height =
@@ -941,7 +931,7 @@ static void hvfb_get_option(struct fb_info *info)
 
        if (x < HVFB_WIDTH_MIN || y < HVFB_HEIGHT_MIN ||
            (synthvid_ver_ge(par->synthvid_version, SYNTHVID_VERSION_WIN10) &&
-           (x > screen_width_max || y > screen_height_max)) ||
+           (x * y * screen_depth / 8 > screen_fb_size)) ||
            (par->synthvid_version == SYNTHVID_VERSION_WIN8 &&
             x * y * screen_depth / 8 > SYNTHVID_FB_SIZE_WIN8) ||
            (par->synthvid_version == SYNTHVID_VERSION_WIN7 &&
@@ -1194,8 +1184,8 @@ static int hvfb_probe(struct hv_device *hdev,
        }
 
        hvfb_get_option(info);
-       pr_info("Screen resolution: %dx%d, Color depth: %d\n",
-               screen_width, screen_height, screen_depth);
+       pr_info("Screen resolution: %dx%d, Color depth: %d, Frame buffer size: %d\n",
+               screen_width, screen_height, screen_depth, screen_fb_size);
 
        ret = hvfb_getmem(hdev, info);
        if (ret) {
index 0fe922f..bcacfb6 100644 (file)
@@ -505,15 +505,15 @@ void xxxfb_fillrect(struct fb_info *p, const struct fb_fillrect *region)
 }
 
 /**
- *      xxxfb_copyarea - OBSOLETE function.
+ *      xxxfb_copyarea - REQUIRED function. Can use generic routines if
+ *                       non acclerated hardware and packed pixel based.
  *                       Copies one area of the screen to another area.
- *                       Will be deleted in a future version
  *
  *      @info: frame buffer structure that represents a single frame buffer
  *      @area: Structure providing the data to copy the framebuffer contents
  *            from one region to another.
  *
- *      This drawing operation copied a rectangular area from one area of the
+ *      This drawing operation copies a rectangular area from one area of the
  *     screen to another area.
  */
 void xxxfb_copyarea(struct fb_info *p, const struct fb_copyarea *area) 
@@ -645,9 +645,9 @@ static const struct fb_ops xxxfb_ops = {
        .fb_setcolreg   = xxxfb_setcolreg,
        .fb_blank       = xxxfb_blank,
        .fb_pan_display = xxxfb_pan_display,
-       .fb_fillrect    = xxxfb_fillrect,       /* Needed !!!   */
-       .fb_copyarea    = xxxfb_copyarea,       /* Obsolete     */
-       .fb_imageblit   = xxxfb_imageblit,      /* Needed !!!   */
+       .fb_fillrect    = xxxfb_fillrect,       /* Needed !!! */
+       .fb_copyarea    = xxxfb_copyarea,       /* Needed !!! */
+       .fb_imageblit   = xxxfb_imageblit,      /* Needed !!! */
        .fb_cursor      = xxxfb_cursor,         /* Optional !!! */
        .fb_sync        = xxxfb_sync,
        .fb_ioctl       = xxxfb_ioctl,
index 6aab046..79df61f 100644 (file)
@@ -96,12 +96,8 @@ static struct p9_fid *v9fs_fid_find(struct dentry *dentry, kuid_t uid, int any)
                 dentry, dentry, from_kuid(&init_user_ns, uid),
                 any);
        ret = NULL;
-
-       if (d_inode(dentry))
-               ret = v9fs_fid_find_inode(d_inode(dentry), uid);
-
        /* we'll recheck under lock if there's anything to look in */
-       if (!ret && dentry->d_fsdata) {
+       if (dentry->d_fsdata) {
                struct hlist_head *h = (struct hlist_head *)&dentry->d_fsdata;
 
                spin_lock(&dentry->d_lock);
@@ -113,6 +109,9 @@ static struct p9_fid *v9fs_fid_find(struct dentry *dentry, kuid_t uid, int any)
                        }
                }
                spin_unlock(&dentry->d_lock);
+       } else {
+               if (dentry->d_inode)
+                       ret = v9fs_fid_find_inode(dentry->d_inode, uid);
        }
 
        return ret;
index dab324a..208a74e 100644 (file)
@@ -96,7 +96,7 @@ obj-$(CONFIG_EXPORTFS)                += exportfs/
 obj-$(CONFIG_NFSD)             += nfsd/
 obj-$(CONFIG_LOCKD)            += lockd/
 obj-$(CONFIG_NLS)              += nls/
-obj-$(CONFIG_UNICODE)          += unicode/
+obj-y                          += unicode/
 obj-$(CONFIG_SYSV_FS)          += sysv/
 obj-$(CONFIG_SMBFS_COMMON)     += smbfs_common/
 obj-$(CONFIG_CIFS)             += cifs/
index ddea6ac..c07f357 100644 (file)
@@ -817,20 +817,20 @@ static struct file_system_type bm_fs_type = {
 };
 MODULE_ALIAS_FS("binfmt_misc");
 
+static struct ctl_table_header *binfmt_misc_header;
+
 static int __init init_misc_binfmt(void)
 {
        int err = register_filesystem(&bm_fs_type);
        if (!err)
                insert_binfmt(&misc_format);
-       if (!register_sysctl_mount_point("fs/binfmt_misc")) {
-               pr_warn("Failed to create fs/binfmt_misc sysctl mount point");
-               return -ENOMEM;
-       }
+       binfmt_misc_header = register_sysctl_mount_point("fs/binfmt_misc");
        return 0;
 }
 
 static void __exit exit_misc_binfmt(void)
 {
+       unregister_sysctl_table(binfmt_misc_header);
        unregister_binfmt(&misc_format);
        unregister_filesystem(&bm_fs_type);
 }
index 1db24e6..8202ad6 100644 (file)
@@ -124,7 +124,16 @@ void btrfs_put_block_group(struct btrfs_block_group *cache)
 {
        if (refcount_dec_and_test(&cache->refs)) {
                WARN_ON(cache->pinned > 0);
-               WARN_ON(cache->reserved > 0);
+               /*
+                * If there was a failure to cleanup a log tree, very likely due
+                * to an IO failure on a writeback attempt of one or more of its
+                * extent buffers, we could not do proper (and cheap) unaccounting
+                * of their reserved space, so don't warn on reserved > 0 in that
+                * case.
+                */
+               if (!(cache->flags & BTRFS_BLOCK_GROUP_METADATA) ||
+                   !BTRFS_FS_LOG_CLEANUP_ERROR(cache->fs_info))
+                       WARN_ON(cache->reserved > 0);
 
                /*
                 * A block_group shouldn't be on the discard_list anymore.
@@ -2544,6 +2553,19 @@ int btrfs_inc_block_group_ro(struct btrfs_block_group *cache,
        int ret;
        bool dirty_bg_running;
 
+       /*
+        * This can only happen when we are doing read-only scrub on read-only
+        * mount.
+        * In that case we should not start a new transaction on read-only fs.
+        * Thus here we skip all chunk allocations.
+        */
+       if (sb_rdonly(fs_info->sb)) {
+               mutex_lock(&fs_info->ro_block_group_mutex);
+               ret = inc_block_group_ro(cache, 0);
+               mutex_unlock(&fs_info->ro_block_group_mutex);
+               return ret;
+       }
+
        do {
                trans = btrfs_join_transaction(root);
                if (IS_ERR(trans))
@@ -3974,9 +3996,22 @@ int btrfs_free_block_groups(struct btrfs_fs_info *info)
                 * important and indicates a real bug if this happens.
                 */
                if (WARN_ON(space_info->bytes_pinned > 0 ||
-                           space_info->bytes_reserved > 0 ||
                            space_info->bytes_may_use > 0))
                        btrfs_dump_space_info(info, space_info, 0, 0);
+
+               /*
+                * If there was a failure to cleanup a log tree, very likely due
+                * to an IO failure on a writeback attempt of one or more of its
+                * extent buffers, we could not do proper (and cheap) unaccounting
+                * of their reserved space, so don't warn on bytes_reserved > 0 in
+                * that case.
+                */
+               if (!(space_info->flags & BTRFS_BLOCK_GROUP_METADATA) ||
+                   !BTRFS_FS_LOG_CLEANUP_ERROR(info)) {
+                       if (WARN_ON(space_info->bytes_reserved > 0))
+                               btrfs_dump_space_info(info, space_info, 0, 0);
+               }
+
                WARN_ON(space_info->reclaim_size > 0);
                list_del(&space_info->list);
                btrfs_sysfs_remove_space_info(space_info);
index b4a9b1c..8992e00 100644 (file)
@@ -145,6 +145,9 @@ enum {
        BTRFS_FS_STATE_DUMMY_FS_INFO,
 
        BTRFS_FS_STATE_NO_CSUMS,
+
+       /* Indicates there was an error cleaning up a log tree. */
+       BTRFS_FS_STATE_LOG_CLEANUP_ERROR,
 };
 
 #define BTRFS_BACKREF_REV_MAX          256
@@ -3593,6 +3596,9 @@ do {                                                              \
 
 #define BTRFS_FS_ERROR(fs_info)        (unlikely(test_bit(BTRFS_FS_STATE_ERROR, \
                                                   &(fs_info)->fs_state)))
+#define BTRFS_FS_LOG_CLEANUP_ERROR(fs_info)                            \
+       (unlikely(test_bit(BTRFS_FS_STATE_LOG_CLEANUP_ERROR,            \
+                          &(fs_info)->fs_state)))
 
 __printf(5, 6)
 __cold
index a5bd692..33eda39 100644 (file)
@@ -805,10 +805,7 @@ static int create_snapshot(struct btrfs_root *root, struct inode *dir,
                goto fail;
        }
 
-       spin_lock(&fs_info->trans_lock);
-       list_add(&pending_snapshot->list,
-                &trans->transaction->pending_snapshots);
-       spin_unlock(&fs_info->trans_lock);
+       trans->pending_snapshot = pending_snapshot;
 
        ret = btrfs_commit_transaction(trans);
        if (ret)
@@ -1214,6 +1211,35 @@ static int defrag_collect_targets(struct btrfs_inode *inode,
                        goto next;
 
                /*
+                * Our start offset might be in the middle of an existing extent
+                * map, so take that into account.
+                */
+               range_len = em->len - (cur - em->start);
+               /*
+                * If this range of the extent map is already flagged for delalloc,
+                * skip it, because:
+                *
+                * 1) We could deadlock later, when trying to reserve space for
+                *    delalloc, because in case we can't immediately reserve space
+                *    the flusher can start delalloc and wait for the respective
+                *    ordered extents to complete. The deadlock would happen
+                *    because we do the space reservation while holding the range
+                *    locked, and starting writeback, or finishing an ordered
+                *    extent, requires locking the range;
+                *
+                * 2) If there's delalloc there, it means there's dirty pages for
+                *    which writeback has not started yet (we clean the delalloc
+                *    flag when starting writeback and after creating an ordered
+                *    extent). If we mark pages in an adjacent range for defrag,
+                *    then we will have a larger contiguous range for delalloc,
+                *    very likely resulting in a larger extent after writeback is
+                *    triggered (except in a case of free space fragmentation).
+                */
+               if (test_range_bit(&inode->io_tree, cur, cur + range_len - 1,
+                                  EXTENT_DELALLOC, 0, NULL))
+                       goto next;
+
+               /*
                 * For do_compress case, we want to compress all valid file
                 * extents, thus no @extent_thresh or mergeable check.
                 */
@@ -1221,7 +1247,7 @@ static int defrag_collect_targets(struct btrfs_inode *inode,
                        goto add;
 
                /* Skip too large extent */
-               if (em->len >= extent_thresh)
+               if (range_len >= extent_thresh)
                        goto next;
 
                next_mergeable = defrag_check_next_extent(&inode->vfs_inode, em,
@@ -1442,9 +1468,11 @@ static int defrag_one_cluster(struct btrfs_inode *inode,
        list_for_each_entry(entry, &target_list, list) {
                u32 range_len = entry->len;
 
-               /* Reached the limit */
-               if (max_sectors && max_sectors == *sectors_defragged)
+               /* Reached or beyond the limit */
+               if (max_sectors && *sectors_defragged >= max_sectors) {
+                       ret = 1;
                        break;
+               }
 
                if (max_sectors)
                        range_len = min_t(u32, range_len,
@@ -1465,7 +1493,8 @@ static int defrag_one_cluster(struct btrfs_inode *inode,
                                       extent_thresh, newer_than, do_compress);
                if (ret < 0)
                        break;
-               *sectors_defragged += range_len;
+               *sectors_defragged += range_len >>
+                                     inode->root->fs_info->sectorsize_bits;
        }
 out:
        list_for_each_entry_safe(entry, tmp, &target_list, list) {
@@ -1484,6 +1513,12 @@ out:
  * @newer_than:           minimum transid to defrag
  * @max_to_defrag: max number of sectors to be defragged, if 0, the whole inode
  *                will be defragged.
+ *
+ * Return <0 for error.
+ * Return >=0 for the number of sectors defragged, and range->start will be updated
+ * to indicate the file offset where next defrag should be started at.
+ * (Mostly for autodefrag, which sets @max_to_defrag thus we may exit early without
+ *  defragging all the range).
  */
 int btrfs_defrag_file(struct inode *inode, struct file_ra_state *ra,
                      struct btrfs_ioctl_defrag_range_args *range,
@@ -1499,6 +1534,7 @@ int btrfs_defrag_file(struct inode *inode, struct file_ra_state *ra,
        int compress_type = BTRFS_COMPRESS_ZLIB;
        int ret = 0;
        u32 extent_thresh = range->extent_thresh;
+       pgoff_t start_index;
 
        if (isize == 0)
                return 0;
@@ -1518,12 +1554,16 @@ int btrfs_defrag_file(struct inode *inode, struct file_ra_state *ra,
 
        if (range->start + range->len > range->start) {
                /* Got a specific range */
-               last_byte = min(isize, range->start + range->len) - 1;
+               last_byte = min(isize, range->start + range->len);
        } else {
                /* Defrag until file end */
-               last_byte = isize - 1;
+               last_byte = isize;
        }
 
+       /* Align the range */
+       cur = round_down(range->start, fs_info->sectorsize);
+       last_byte = round_up(last_byte, fs_info->sectorsize) - 1;
+
        /*
         * If we were not given a ra, allocate a readahead context. As
         * readahead is just an optimization, defrag will work without it so
@@ -1536,16 +1576,26 @@ int btrfs_defrag_file(struct inode *inode, struct file_ra_state *ra,
                        file_ra_state_init(ra, inode->i_mapping);
        }
 
-       /* Align the range */
-       cur = round_down(range->start, fs_info->sectorsize);
-       last_byte = round_up(last_byte, fs_info->sectorsize) - 1;
+       /*
+        * Make writeback start from the beginning of the range, so that the
+        * defrag range can be written sequentially.
+        */
+       start_index = cur >> PAGE_SHIFT;
+       if (start_index < inode->i_mapping->writeback_index)
+               inode->i_mapping->writeback_index = start_index;
 
        while (cur < last_byte) {
+               const unsigned long prev_sectors_defragged = sectors_defragged;
                u64 cluster_end;
 
                /* The cluster size 256K should always be page aligned */
                BUILD_BUG_ON(!IS_ALIGNED(CLUSTER_SIZE, PAGE_SIZE));
 
+               if (btrfs_defrag_cancelled(fs_info)) {
+                       ret = -EAGAIN;
+                       break;
+               }
+
                /* We want the cluster end at page boundary when possible */
                cluster_end = (((cur >> PAGE_SHIFT) +
                               (SZ_256K >> PAGE_SHIFT)) << PAGE_SHIFT) - 1;
@@ -1567,14 +1617,27 @@ int btrfs_defrag_file(struct inode *inode, struct file_ra_state *ra,
                                cluster_end + 1 - cur, extent_thresh,
                                newer_than, do_compress,
                                &sectors_defragged, max_to_defrag);
+
+               if (sectors_defragged > prev_sectors_defragged)
+                       balance_dirty_pages_ratelimited(inode->i_mapping);
+
                btrfs_inode_unlock(inode, 0);
                if (ret < 0)
                        break;
                cur = cluster_end + 1;
+               if (ret > 0) {
+                       ret = 0;
+                       break;
+               }
        }
 
        if (ra_allocated)
                kfree(ra);
+       /*
+        * Update range.start for autodefrag, this will indicate where to start
+        * in next run.
+        */
+       range->start = cur;
        if (sectors_defragged) {
                /*
                 * We have defragged some sectors, for compression case they
@@ -3086,10 +3149,8 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file,
        btrfs_inode_lock(inode, 0);
        err = btrfs_delete_subvolume(dir, dentry);
        btrfs_inode_unlock(inode, 0);
-       if (!err) {
-               fsnotify_rmdir(dir, dentry);
-               d_delete(dentry);
-       }
+       if (!err)
+               d_delete_notify(dir, dentry);
 
 out_dput:
        dput(dentry);
@@ -3290,7 +3351,7 @@ static long btrfs_ioctl_rm_dev(struct file *file, void __user *arg)
        struct block_device *bdev = NULL;
        fmode_t mode;
        int ret;
-       bool cancel;
+       bool cancel = false;
 
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
index 8928275..f12dc68 100644 (file)
@@ -1185,9 +1185,24 @@ int btrfs_quota_disable(struct btrfs_fs_info *fs_info)
        struct btrfs_trans_handle *trans = NULL;
        int ret = 0;
 
+       /*
+        * We need to have subvol_sem write locked, to prevent races between
+        * concurrent tasks trying to disable quotas, because we will unlock
+        * and relock qgroup_ioctl_lock across BTRFS_FS_QUOTA_ENABLED changes.
+        */
+       lockdep_assert_held_write(&fs_info->subvol_sem);
+
        mutex_lock(&fs_info->qgroup_ioctl_lock);
        if (!fs_info->quota_root)
                goto out;
+
+       /*
+        * Request qgroup rescan worker to complete and wait for it. This wait
+        * must be done before transaction start for quota disable since it may
+        * deadlock with transaction by the qgroup rescan worker.
+        */
+       clear_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags);
+       btrfs_qgroup_wait_for_completion(fs_info, false);
        mutex_unlock(&fs_info->qgroup_ioctl_lock);
 
        /*
@@ -1205,14 +1220,13 @@ int btrfs_quota_disable(struct btrfs_fs_info *fs_info)
        if (IS_ERR(trans)) {
                ret = PTR_ERR(trans);
                trans = NULL;
+               set_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags);
                goto out;
        }
 
        if (!fs_info->quota_root)
                goto out;
 
-       clear_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags);
-       btrfs_qgroup_wait_for_completion(fs_info, false);
        spin_lock(&fs_info->qgroup_lock);
        quota_root = fs_info->quota_root;
        fs_info->quota_root = NULL;
@@ -3383,6 +3397,9 @@ qgroup_rescan_init(struct btrfs_fs_info *fs_info, u64 progress_objectid,
                        btrfs_warn(fs_info,
                        "qgroup rescan init failed, qgroup is not enabled");
                        ret = -EINVAL;
+               } else if (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags)) {
+                       /* Quota disable is in progress */
+                       ret = -EBUSY;
                }
 
                if (ret) {
index 03de89b..c43bbc7 100644 (file)
@@ -2000,6 +2000,27 @@ static inline void btrfs_wait_delalloc_flush(struct btrfs_fs_info *fs_info)
                btrfs_wait_ordered_roots(fs_info, U64_MAX, 0, (u64)-1);
 }
 
+/*
+ * Add a pending snapshot associated with the given transaction handle to the
+ * respective handle. This must be called after the transaction commit started
+ * and while holding fs_info->trans_lock.
+ * This serves to guarantee a caller of btrfs_commit_transaction() that it can
+ * safely free the pending snapshot pointer in case btrfs_commit_transaction()
+ * returns an error.
+ */
+static void add_pending_snapshot(struct btrfs_trans_handle *trans)
+{
+       struct btrfs_transaction *cur_trans = trans->transaction;
+
+       if (!trans->pending_snapshot)
+               return;
+
+       lockdep_assert_held(&trans->fs_info->trans_lock);
+       ASSERT(cur_trans->state >= TRANS_STATE_COMMIT_START);
+
+       list_add(&trans->pending_snapshot->list, &cur_trans->pending_snapshots);
+}
+
 int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
 {
        struct btrfs_fs_info *fs_info = trans->fs_info;
@@ -2073,6 +2094,8 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
        if (cur_trans->state >= TRANS_STATE_COMMIT_START) {
                enum btrfs_trans_state want_state = TRANS_STATE_COMPLETED;
 
+               add_pending_snapshot(trans);
+
                spin_unlock(&fs_info->trans_lock);
                refcount_inc(&cur_trans->use_count);
 
@@ -2163,6 +2186,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
         * COMMIT_DOING so make sure to wait for num_writers to == 1 again.
         */
        spin_lock(&fs_info->trans_lock);
+       add_pending_snapshot(trans);
        cur_trans->state = TRANS_STATE_COMMIT_DOING;
        spin_unlock(&fs_info->trans_lock);
        wait_event(cur_trans->writer_wait,
index 1852ed9..9402d8d 100644 (file)
@@ -123,6 +123,8 @@ struct btrfs_trans_handle {
        struct btrfs_transaction *transaction;
        struct btrfs_block_rsv *block_rsv;
        struct btrfs_block_rsv *orig_rsv;
+       /* Set by a task that wants to create a snapshot. */
+       struct btrfs_pending_snapshot *pending_snapshot;
        refcount_t use_count;
        unsigned int type;
        /*
index 72e1c94..9fd145f 100644 (file)
@@ -965,6 +965,7 @@ static int check_dev_item(struct extent_buffer *leaf,
                          struct btrfs_key *key, int slot)
 {
        struct btrfs_dev_item *ditem;
+       const u32 item_size = btrfs_item_size(leaf, slot);
 
        if (unlikely(key->objectid != BTRFS_DEV_ITEMS_OBJECTID)) {
                dev_item_err(leaf, slot,
@@ -972,6 +973,13 @@ static int check_dev_item(struct extent_buffer *leaf,
                             key->objectid, BTRFS_DEV_ITEMS_OBJECTID);
                return -EUCLEAN;
        }
+
+       if (unlikely(item_size != sizeof(*ditem))) {
+               dev_item_err(leaf, slot, "invalid item size: has %u expect %zu",
+                            item_size, sizeof(*ditem));
+               return -EUCLEAN;
+       }
+
        ditem = btrfs_item_ptr(leaf, slot, struct btrfs_dev_item);
        if (unlikely(btrfs_device_id(leaf, ditem) != key->offset)) {
                dev_item_err(leaf, slot,
@@ -1007,6 +1015,7 @@ static int check_inode_item(struct extent_buffer *leaf,
        struct btrfs_inode_item *iitem;
        u64 super_gen = btrfs_super_generation(fs_info->super_copy);
        u32 valid_mask = (S_IFMT | S_ISUID | S_ISGID | S_ISVTX | 0777);
+       const u32 item_size = btrfs_item_size(leaf, slot);
        u32 mode;
        int ret;
        u32 flags;
@@ -1016,6 +1025,12 @@ static int check_inode_item(struct extent_buffer *leaf,
        if (unlikely(ret < 0))
                return ret;
 
+       if (unlikely(item_size != sizeof(*iitem))) {
+               generic_err(leaf, slot, "invalid item size: has %u expect %zu",
+                           item_size, sizeof(*iitem));
+               return -EUCLEAN;
+       }
+
        iitem = btrfs_item_ptr(leaf, slot, struct btrfs_inode_item);
 
        /* Here we use super block generation + 1 to handle log tree */
index c1ddbe8..3ee014c 100644 (file)
@@ -3414,6 +3414,29 @@ static void free_log_tree(struct btrfs_trans_handle *trans,
        if (log->node) {
                ret = walk_log_tree(trans, log, &wc);
                if (ret) {
+                       /*
+                        * We weren't able to traverse the entire log tree, the
+                        * typical scenario is getting an -EIO when reading an
+                        * extent buffer of the tree, due to a previous writeback
+                        * failure of it.
+                        */
+                       set_bit(BTRFS_FS_STATE_LOG_CLEANUP_ERROR,
+                               &log->fs_info->fs_state);
+
+                       /*
+                        * Some extent buffers of the log tree may still be dirty
+                        * and not yet written back to storage, because we may
+                        * have updates to a log tree without syncing a log tree,
+                        * such as during rename and link operations. So flush
+                        * them out and wait for their writeback to complete, so
+                        * that we properly cleanup their state and pages.
+                        */
+                       btrfs_write_marked_extents(log->fs_info,
+                                                  &log->dirty_log_pages,
+                                                  EXTENT_DIRTY | EXTENT_NEW);
+                       btrfs_wait_tree_log_extents(log,
+                                                   EXTENT_DIRTY | EXTENT_NEW);
+
                        if (trans)
                                btrfs_abort_transaction(trans, ret);
                        else
index 04eb527..753986e 100644 (file)
@@ -192,6 +192,64 @@ presubmission_error:
 }
 
 /*
+ * Query the occupancy of the cache in a region, returning where the next chunk
+ * of data starts and how long it is.
+ */
+static int cachefiles_query_occupancy(struct netfs_cache_resources *cres,
+                                     loff_t start, size_t len, size_t granularity,
+                                     loff_t *_data_start, size_t *_data_len)
+{
+       struct cachefiles_object *object;
+       struct file *file;
+       loff_t off, off2;
+
+       *_data_start = -1;
+       *_data_len = 0;
+
+       if (!fscache_wait_for_operation(cres, FSCACHE_WANT_READ))
+               return -ENOBUFS;
+
+       object = cachefiles_cres_object(cres);
+       file = cachefiles_cres_file(cres);
+       granularity = max_t(size_t, object->volume->cache->bsize, granularity);
+
+       _enter("%pD,%li,%llx,%zx/%llx",
+              file, file_inode(file)->i_ino, start, len,
+              i_size_read(file_inode(file)));
+
+       off = cachefiles_inject_read_error();
+       if (off == 0)
+               off = vfs_llseek(file, start, SEEK_DATA);
+       if (off == -ENXIO)
+               return -ENODATA; /* Beyond EOF */
+       if (off < 0 && off >= (loff_t)-MAX_ERRNO)
+               return -ENOBUFS; /* Error. */
+       if (round_up(off, granularity) >= start + len)
+               return -ENODATA; /* No data in range */
+
+       off2 = cachefiles_inject_read_error();
+       if (off2 == 0)
+               off2 = vfs_llseek(file, off, SEEK_HOLE);
+       if (off2 == -ENXIO)
+               return -ENODATA; /* Beyond EOF */
+       if (off2 < 0 && off2 >= (loff_t)-MAX_ERRNO)
+               return -ENOBUFS; /* Error. */
+
+       /* Round away partial blocks */
+       off = round_up(off, granularity);
+       off2 = round_down(off2, granularity);
+       if (off2 <= off)
+               return -ENODATA;
+
+       *_data_start = off;
+       if (off2 > start + len)
+               *_data_len = len;
+       else
+               *_data_len = off2 - off;
+       return 0;
+}
+
+/*
  * Handle completion of a write to the cache.
  */
 static void cachefiles_write_complete(struct kiocb *iocb, long ret)
@@ -545,6 +603,7 @@ static const struct netfs_cache_ops cachefiles_netfs_cache_ops = {
        .write                  = cachefiles_write,
        .prepare_read           = cachefiles_prepare_read,
        .prepare_write          = cachefiles_prepare_write,
+       .query_occupancy        = cachefiles_query_occupancy,
 };
 
 /*
index 7d305b9..b472cd0 100644 (file)
@@ -2218,6 +2218,7 @@ static int unsafe_request_wait(struct inode *inode)
        struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc;
        struct ceph_inode_info *ci = ceph_inode(inode);
        struct ceph_mds_request *req1 = NULL, *req2 = NULL;
+       unsigned int max_sessions;
        int ret, err = 0;
 
        spin_lock(&ci->i_unsafe_lock);
@@ -2236,36 +2237,44 @@ static int unsafe_request_wait(struct inode *inode)
        spin_unlock(&ci->i_unsafe_lock);
 
        /*
+        * The mdsc->max_sessions is unlikely to be changed
+        * mostly, here we will retry it by reallocating the
+        * sessions array memory to get rid of the mdsc->mutex
+        * lock.
+        */
+retry:
+       max_sessions = mdsc->max_sessions;
+
+       /*
         * Trigger to flush the journal logs in all the relevant MDSes
         * manually, or in the worst case we must wait at most 5 seconds
         * to wait the journal logs to be flushed by the MDSes periodically.
         */
-       if (req1 || req2) {
+       if ((req1 || req2) && likely(max_sessions)) {
                struct ceph_mds_session **sessions = NULL;
                struct ceph_mds_session *s;
                struct ceph_mds_request *req;
-               unsigned int max;
                int i;
 
-               /*
-                * The mdsc->max_sessions is unlikely to be changed
-                * mostly, here we will retry it by reallocating the
-                * sessions arrary memory to get rid of the mdsc->mutex
-                * lock.
-                */
-retry:
-               max = mdsc->max_sessions;
-               sessions = krealloc(sessions, max * sizeof(s), __GFP_ZERO);
-               if (!sessions)
-                       return -ENOMEM;
+               sessions = kzalloc(max_sessions * sizeof(s), GFP_KERNEL);
+               if (!sessions) {
+                       err = -ENOMEM;
+                       goto out;
+               }
 
                spin_lock(&ci->i_unsafe_lock);
                if (req1) {
                        list_for_each_entry(req, &ci->i_unsafe_dirops,
                                            r_unsafe_dir_item) {
                                s = req->r_session;
-                               if (unlikely(s->s_mds >= max)) {
+                               if (unlikely(s->s_mds >= max_sessions)) {
                                        spin_unlock(&ci->i_unsafe_lock);
+                                       for (i = 0; i < max_sessions; i++) {
+                                               s = sessions[i];
+                                               if (s)
+                                                       ceph_put_mds_session(s);
+                                       }
+                                       kfree(sessions);
                                        goto retry;
                                }
                                if (!sessions[s->s_mds]) {
@@ -2278,8 +2287,14 @@ retry:
                        list_for_each_entry(req, &ci->i_unsafe_iops,
                                            r_unsafe_target_item) {
                                s = req->r_session;
-                               if (unlikely(s->s_mds >= max)) {
+                               if (unlikely(s->s_mds >= max_sessions)) {
                                        spin_unlock(&ci->i_unsafe_lock);
+                                       for (i = 0; i < max_sessions; i++) {
+                                               s = sessions[i];
+                                               if (s)
+                                                       ceph_put_mds_session(s);
+                                       }
+                                       kfree(sessions);
                                        goto retry;
                                }
                                if (!sessions[s->s_mds]) {
@@ -2300,7 +2315,7 @@ retry:
                spin_unlock(&ci->i_ceph_lock);
 
                /* send flush mdlog request to MDSes */
-               for (i = 0; i < max; i++) {
+               for (i = 0; i < max_sessions; i++) {
                        s = sessions[i];
                        if (s) {
                                send_flush_mdlog(s);
@@ -2317,15 +2332,19 @@ retry:
                                        ceph_timeout_jiffies(req1->r_timeout));
                if (ret)
                        err = -EIO;
-               ceph_mdsc_put_request(req1);
        }
        if (req2) {
                ret = !wait_for_completion_timeout(&req2->r_safe_completion,
                                        ceph_timeout_jiffies(req2->r_timeout));
                if (ret)
                        err = -EIO;
-               ceph_mdsc_put_request(req2);
        }
+
+out:
+       if (req1)
+               ceph_mdsc_put_request(req1);
+       if (req2)
+               ceph_mdsc_put_request(req2);
        return err;
 }
 
index 5b9104b..bbed322 100644 (file)
@@ -583,6 +583,7 @@ static int ceph_finish_async_create(struct inode *dir, struct dentry *dentry,
        struct ceph_inode_info *ci = ceph_inode(dir);
        struct inode *inode;
        struct timespec64 now;
+       struct ceph_string *pool_ns;
        struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(dir->i_sb);
        struct ceph_vino vino = { .ino = req->r_deleg_ino,
                                  .snap = CEPH_NOSNAP };
@@ -632,6 +633,12 @@ static int ceph_finish_async_create(struct inode *dir, struct dentry *dentry,
        in.max_size = cpu_to_le64(lo->stripe_unit);
 
        ceph_file_layout_to_legacy(lo, &in.layout);
+       /* lo is private, so pool_ns can't change */
+       pool_ns = rcu_dereference_raw(lo->pool_ns);
+       if (pool_ns) {
+               iinfo.pool_ns_len = pool_ns->len;
+               iinfo.pool_ns_data = pool_ns->str;
+       }
 
        down_read(&mdsc->snap_rwsem);
        ret = ceph_fill_inode(inode, NULL, &iinfo, NULL, req->r_session,
@@ -750,8 +757,10 @@ retry:
                                restore_deleg_ino(dir, req->r_deleg_ino);
                                ceph_mdsc_put_request(req);
                                try_async = false;
+                               ceph_put_string(rcu_dereference_raw(lo.pool_ns));
                                goto retry;
                        }
+                       ceph_put_string(rcu_dereference_raw(lo.pool_ns));
                        goto out_req;
                }
        }
index 11a22a3..0b742bd 100644 (file)
@@ -162,7 +162,7 @@ static void cifs_resolve_server(struct work_struct *work)
        mutex_unlock(&server->srv_mutex);
 }
 
-/**
+/*
  * Mark all sessions and tcons for reconnect.
  *
  * @server needs to be previously set to CifsNeedReconnect.
@@ -1831,13 +1831,9 @@ void cifs_put_smb_ses(struct cifs_ses *ses)
                int i;
 
                for (i = 1; i < chan_count; i++) {
-                       /*
-                        * note: for now, we're okay accessing ses->chans
-                        * without chan_lock. But when chans can go away, we'll
-                        * need to introduce ref counting to make sure that chan
-                        * is not freed from under us.
-                        */
+                       spin_unlock(&ses->chan_lock);
                        cifs_put_tcp_session(ses->chans[i].server, 0);
+                       spin_lock(&ses->chan_lock);
                        ses->chans[i].server = NULL;
                }
        }
@@ -1981,6 +1977,19 @@ cifs_set_cifscreds(struct smb3_fs_context *ctx, struct cifs_ses *ses)
                }
        }
 
+       ctx->workstation_name = kstrdup(ses->workstation_name, GFP_KERNEL);
+       if (!ctx->workstation_name) {
+               cifs_dbg(FYI, "Unable to allocate memory for workstation_name\n");
+               rc = -ENOMEM;
+               kfree(ctx->username);
+               ctx->username = NULL;
+               kfree_sensitive(ctx->password);
+               ctx->password = NULL;
+               kfree(ctx->domainname);
+               ctx->domainname = NULL;
+               goto out_key_put;
+       }
+
 out_key_put:
        up_read(&key->sem);
        key_put(key);
index 59334be..e7af802 100644 (file)
@@ -4269,8 +4269,6 @@ cifs_readv_complete(struct work_struct *work)
        for (i = 0; i < rdata->nr_pages; i++) {
                struct page *page = rdata->pages[i];
 
-               lru_cache_add(page);
-
                if (rdata->result == 0 ||
                    (rdata->result == -EAGAIN && got_bytes)) {
                        flush_dcache_page(page);
@@ -4278,12 +4276,12 @@ cifs_readv_complete(struct work_struct *work)
                } else
                        SetPageError(page);
 
-               unlock_page(page);
-
                if (rdata->result == 0 ||
                    (rdata->result == -EAGAIN && got_bytes))
                        cifs_readpage_to_fscache(rdata->mapping->host, page);
 
+               unlock_page(page);
+
                got_bytes -= min_t(unsigned int, PAGE_SIZE, got_bytes);
 
                put_page(page);
@@ -4340,7 +4338,6 @@ readpages_fill_pages(struct TCP_Server_Info *server,
                         * fill them until the writes are flushed.
                         */
                        zero_user(page, 0, PAGE_SIZE);
-                       lru_cache_add(page);
                        flush_dcache_page(page);
                        SetPageUptodate(page);
                        unlock_page(page);
@@ -4350,7 +4347,6 @@ readpages_fill_pages(struct TCP_Server_Info *server,
                        continue;
                } else {
                        /* no need to hold page hostage */
-                       lru_cache_add(page);
                        unlock_page(page);
                        put_page(page);
                        rdata->pages[i] = NULL;
@@ -4393,92 +4389,20 @@ cifs_readpages_copy_into_pages(struct TCP_Server_Info *server,
        return readpages_fill_pages(server, rdata, iter, iter->count);
 }
 
-static int
-readpages_get_pages(struct address_space *mapping, struct list_head *page_list,
-                   unsigned int rsize, struct list_head *tmplist,
-                   unsigned int *nr_pages, loff_t *offset, unsigned int *bytes)
-{
-       struct page *page, *tpage;
-       unsigned int expected_index;
-       int rc;
-       gfp_t gfp = readahead_gfp_mask(mapping);
-
-       INIT_LIST_HEAD(tmplist);
-
-       page = lru_to_page(page_list);
-
-       /*
-        * Lock the page and put it in the cache. Since no one else
-        * should have access to this page, we're safe to simply set
-        * PG_locked without checking it first.
-        */
-       __SetPageLocked(page);
-       rc = add_to_page_cache_locked(page, mapping,
-                                     page->index, gfp);
-
-       /* give up if we can't stick it in the cache */
-       if (rc) {
-               __ClearPageLocked(page);
-               return rc;
-       }
-
-       /* move first page to the tmplist */
-       *offset = (loff_t)page->index << PAGE_SHIFT;
-       *bytes = PAGE_SIZE;
-       *nr_pages = 1;
-       list_move_tail(&page->lru, tmplist);
-
-       /* now try and add more pages onto the request */
-       expected_index = page->index + 1;
-       list_for_each_entry_safe_reverse(page, tpage, page_list, lru) {
-               /* discontinuity ? */
-               if (page->index != expected_index)
-                       break;
-
-               /* would this page push the read over the rsize? */
-               if (*bytes + PAGE_SIZE > rsize)
-                       break;
-
-               __SetPageLocked(page);
-               rc = add_to_page_cache_locked(page, mapping, page->index, gfp);
-               if (rc) {
-                       __ClearPageLocked(page);
-                       break;
-               }
-               list_move_tail(&page->lru, tmplist);
-               (*bytes) += PAGE_SIZE;
-               expected_index++;
-               (*nr_pages)++;
-       }
-       return rc;
-}
-
-static int cifs_readpages(struct file *file, struct address_space *mapping,
-       struct list_head *page_list, unsigned num_pages)
+static void cifs_readahead(struct readahead_control *ractl)
 {
        int rc;
-       int err = 0;
-       struct list_head tmplist;
-       struct cifsFileInfo *open_file = file->private_data;
-       struct cifs_sb_info *cifs_sb = CIFS_FILE_SB(file);
+       struct cifsFileInfo *open_file = ractl->file->private_data;
+       struct cifs_sb_info *cifs_sb = CIFS_FILE_SB(ractl->file);
        struct TCP_Server_Info *server;
        pid_t pid;
-       unsigned int xid;
+       unsigned int xid, nr_pages, last_batch_size = 0, cache_nr_pages = 0;
+       pgoff_t next_cached = ULONG_MAX;
+       bool caching = fscache_cookie_enabled(cifs_inode_cookie(ractl->mapping->host)) &&
+               cifs_inode_cookie(ractl->mapping->host)->cache_priv;
+       bool check_cache = caching;
 
        xid = get_xid();
-       /*
-        * Reads as many pages as possible from fscache. Returns -ENOBUFS
-        * immediately if the cookie is negative
-        *
-        * After this point, every page in the list might have PG_fscache set,
-        * so we will need to clean that up off of every page we don't use.
-        */
-       rc = cifs_readpages_from_fscache(mapping->host, mapping, page_list,
-                                        &num_pages);
-       if (rc == 0) {
-               free_xid(xid);
-               return rc;
-       }
 
        if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD)
                pid = open_file->pid;
@@ -4489,39 +4413,73 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
        server = cifs_pick_channel(tlink_tcon(open_file->tlink)->ses);
 
        cifs_dbg(FYI, "%s: file=%p mapping=%p num_pages=%u\n",
-                __func__, file, mapping, num_pages);
+                __func__, ractl->file, ractl->mapping, readahead_count(ractl));
 
        /*
-        * Start with the page at end of list and move it to private
-        * list. Do the same with any following pages until we hit
-        * the rsize limit, hit an index discontinuity, or run out of
-        * pages. Issue the async read and then start the loop again
-        * until the list is empty.
-        *
-        * Note that list order is important. The page_list is in
-        * the order of declining indexes. When we put the pages in
-        * the rdata->pages, then we want them in increasing order.
+        * Chop the readahead request up into rsize-sized read requests.
         */
-       while (!list_empty(page_list) && !err) {
-               unsigned int i, nr_pages, bytes, rsize;
-               loff_t offset;
-               struct page *page, *tpage;
+       while ((nr_pages = readahead_count(ractl) - last_batch_size)) {
+               unsigned int i, got, rsize;
+               struct page *page;
                struct cifs_readdata *rdata;
                struct cifs_credits credits_on_stack;
                struct cifs_credits *credits = &credits_on_stack;
+               pgoff_t index = readahead_index(ractl) + last_batch_size;
+
+               /*
+                * Find out if we have anything cached in the range of
+                * interest, and if so, where the next chunk of cached data is.
+                */
+               if (caching) {
+                       if (check_cache) {
+                               rc = cifs_fscache_query_occupancy(
+                                       ractl->mapping->host, index, nr_pages,
+                                       &next_cached, &cache_nr_pages);
+                               if (rc < 0)
+                                       caching = false;
+                               check_cache = false;
+                       }
+
+                       if (index == next_cached) {
+                               /*
+                                * TODO: Send a whole batch of pages to be read
+                                * by the cache.
+                                */
+                               page = readahead_page(ractl);
+                               last_batch_size = 1 << thp_order(page);
+                               if (cifs_readpage_from_fscache(ractl->mapping->host,
+                                                              page) < 0) {
+                                       /*
+                                        * TODO: Deal with cache read failure
+                                        * here, but for the moment, delegate
+                                        * that to readpage.
+                                        */
+                                       caching = false;
+                               }
+                               unlock_page(page);
+                               next_cached++;
+                               cache_nr_pages--;
+                               if (cache_nr_pages == 0)
+                                       check_cache = true;
+                               continue;
+                       }
+               }
 
                if (open_file->invalidHandle) {
                        rc = cifs_reopen_file(open_file, true);
-                       if (rc == -EAGAIN)
-                               continue;
-                       else if (rc)
+                       if (rc) {
+                               if (rc == -EAGAIN)
+                                       continue;
                                break;
+                       }
                }
 
                rc = server->ops->wait_mtu_credits(server, cifs_sb->ctx->rsize,
                                                   &rsize, credits);
                if (rc)
                        break;
+               nr_pages = min_t(size_t, rsize / PAGE_SIZE, readahead_count(ractl));
+               nr_pages = min_t(size_t, nr_pages, next_cached - index);
 
                /*
                 * Give up immediately if rsize is too small to read an entire
@@ -4529,16 +4487,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
                 * reach this point however since we set ra_pages to 0 when the
                 * rsize is smaller than a cache page.
                 */
-               if (unlikely(rsize < PAGE_SIZE)) {
-                       add_credits_and_wake_if(server, credits, 0);
-                       free_xid(xid);
-                       return 0;
-               }
-
-               nr_pages = 0;
-               err = readpages_get_pages(mapping, page_list, rsize, &tmplist,
-                                        &nr_pages, &offset, &bytes);
-               if (!nr_pages) {
+               if (unlikely(!nr_pages)) {
                        add_credits_and_wake_if(server, credits, 0);
                        break;
                }
@@ -4546,36 +4495,31 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
                rdata = cifs_readdata_alloc(nr_pages, cifs_readv_complete);
                if (!rdata) {
                        /* best to give up if we're out of mem */
-                       list_for_each_entry_safe(page, tpage, &tmplist, lru) {
-                               list_del(&page->lru);
-                               lru_cache_add(page);
-                               unlock_page(page);
-                               put_page(page);
-                       }
-                       rc = -ENOMEM;
                        add_credits_and_wake_if(server, credits, 0);
                        break;
                }
 
-               rdata->cfile = cifsFileInfo_get(open_file);
-               rdata->server = server;
-               rdata->mapping = mapping;
-               rdata->offset = offset;
-               rdata->bytes = bytes;
-               rdata->pid = pid;
-               rdata->pagesz = PAGE_SIZE;
-               rdata->tailsz = PAGE_SIZE;
+               got = __readahead_batch(ractl, rdata->pages, nr_pages);
+               if (got != nr_pages) {
+                       pr_warn("__readahead_batch() returned %u/%u\n",
+                               got, nr_pages);
+                       nr_pages = got;
+               }
+
+               rdata->nr_pages = nr_pages;
+               rdata->bytes    = readahead_batch_length(ractl);
+               rdata->cfile    = cifsFileInfo_get(open_file);
+               rdata->server   = server;
+               rdata->mapping  = ractl->mapping;
+               rdata->offset   = readahead_pos(ractl);
+               rdata->pid      = pid;
+               rdata->pagesz   = PAGE_SIZE;
+               rdata->tailsz   = PAGE_SIZE;
                rdata->read_into_pages = cifs_readpages_read_into_pages;
                rdata->copy_into_pages = cifs_readpages_copy_into_pages;
-               rdata->credits = credits_on_stack;
-
-               list_for_each_entry_safe(page, tpage, &tmplist, lru) {
-                       list_del(&page->lru);
-                       rdata->pages[rdata->nr_pages++] = page;
-               }
+               rdata->credits  = credits_on_stack;
 
                rc = adjust_credits(server, &rdata->credits, rdata->bytes);
-
                if (!rc) {
                        if (rdata->cfile->invalidHandle)
                                rc = -EAGAIN;
@@ -4587,7 +4531,6 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
                        add_credits_and_wake_if(server, &rdata->credits, 0);
                        for (i = 0; i < rdata->nr_pages; i++) {
                                page = rdata->pages[i];
-                               lru_cache_add(page);
                                unlock_page(page);
                                put_page(page);
                        }
@@ -4597,10 +4540,10 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
                }
 
                kref_put(&rdata->refcount, cifs_readdata_release);
+               last_batch_size = nr_pages;
        }
 
        free_xid(xid);
-       return rc;
 }
 
 /*
@@ -4924,7 +4867,7 @@ oplock_break_done:
  * In the non-cached mode (mount with cache=none), we shunt off direct read and write requests
  * so this method should never be called.
  *
- * Direct IO is not yet supported in the cached mode. 
+ * Direct IO is not yet supported in the cached mode.
  */
 static ssize_t
 cifs_direct_io(struct kiocb *iocb, struct iov_iter *iter)
@@ -5006,7 +4949,7 @@ static int cifs_set_page_dirty(struct page *page)
 
 const struct address_space_operations cifs_addr_ops = {
        .readpage = cifs_readpage,
-       .readpages = cifs_readpages,
+       .readahead = cifs_readahead,
        .writepage = cifs_writepage,
        .writepages = cifs_writepages,
        .write_begin = cifs_write_begin,
index efaac4d..33af72e 100644 (file)
@@ -134,37 +134,127 @@ void cifs_fscache_release_inode_cookie(struct inode *inode)
        }
 }
 
+static inline void fscache_end_operation(struct netfs_cache_resources *cres)
+{
+       const struct netfs_cache_ops *ops = fscache_operation_valid(cres);
+
+       if (ops)
+               ops->end_operation(cres);
+}
+
 /*
- * Retrieve a page from FS-Cache
+ * Fallback page reading interface.
  */
-int __cifs_readpage_from_fscache(struct inode *inode, struct page *page)
+static int fscache_fallback_read_page(struct inode *inode, struct page *page)
 {
-       cifs_dbg(FYI, "%s: (fsc:%p, p:%p, i:0x%p\n",
-                __func__, CIFS_I(inode)->fscache, page, inode);
-       return -ENOBUFS; // Needs conversion to using netfslib
+       struct netfs_cache_resources cres;
+       struct fscache_cookie *cookie = cifs_inode_cookie(inode);
+       struct iov_iter iter;
+       struct bio_vec bvec[1];
+       int ret;
+
+       memset(&cres, 0, sizeof(cres));
+       bvec[0].bv_page         = page;
+       bvec[0].bv_offset       = 0;
+       bvec[0].bv_len          = PAGE_SIZE;
+       iov_iter_bvec(&iter, READ, bvec, ARRAY_SIZE(bvec), PAGE_SIZE);
+
+       ret = fscache_begin_read_operation(&cres, cookie);
+       if (ret < 0)
+               return ret;
+
+       ret = fscache_read(&cres, page_offset(page), &iter, NETFS_READ_HOLE_FAIL,
+                          NULL, NULL);
+       fscache_end_operation(&cres);
+       return ret;
 }
 
 /*
- * Retrieve a set of pages from FS-Cache
+ * Fallback page writing interface.
  */
-int __cifs_readpages_from_fscache(struct inode *inode,
-                               struct address_space *mapping,
-                               struct list_head *pages,
-                               unsigned *nr_pages)
+static int fscache_fallback_write_page(struct inode *inode, struct page *page,
+                                      bool no_space_allocated_yet)
 {
-       cifs_dbg(FYI, "%s: (0x%p/%u/0x%p)\n",
-                __func__, CIFS_I(inode)->fscache, *nr_pages, inode);
-       return -ENOBUFS; // Needs conversion to using netfslib
+       struct netfs_cache_resources cres;
+       struct fscache_cookie *cookie = cifs_inode_cookie(inode);
+       struct iov_iter iter;
+       struct bio_vec bvec[1];
+       loff_t start = page_offset(page);
+       size_t len = PAGE_SIZE;
+       int ret;
+
+       memset(&cres, 0, sizeof(cres));
+       bvec[0].bv_page         = page;
+       bvec[0].bv_offset       = 0;
+       bvec[0].bv_len          = PAGE_SIZE;
+       iov_iter_bvec(&iter, WRITE, bvec, ARRAY_SIZE(bvec), PAGE_SIZE);
+
+       ret = fscache_begin_write_operation(&cres, cookie);
+       if (ret < 0)
+               return ret;
+
+       ret = cres.ops->prepare_write(&cres, &start, &len, i_size_read(inode),
+                                     no_space_allocated_yet);
+       if (ret == 0)
+               ret = fscache_write(&cres, page_offset(page), &iter, NULL, NULL);
+       fscache_end_operation(&cres);
+       return ret;
 }
 
-void __cifs_readpage_to_fscache(struct inode *inode, struct page *page)
+/*
+ * Retrieve a page from FS-Cache
+ */
+int __cifs_readpage_from_fscache(struct inode *inode, struct page *page)
 {
-       struct cifsInodeInfo *cifsi = CIFS_I(inode);
+       int ret;
 
-       WARN_ON(!cifsi->fscache);
+       cifs_dbg(FYI, "%s: (fsc:%p, p:%p, i:0x%p\n",
+                __func__, cifs_inode_cookie(inode), page, inode);
 
+       ret = fscache_fallback_read_page(inode, page);
+       if (ret < 0)
+               return ret;
+
+       /* Read completed synchronously */
+       SetPageUptodate(page);
+       return 0;
+}
+
+void __cifs_readpage_to_fscache(struct inode *inode, struct page *page)
+{
        cifs_dbg(FYI, "%s: (fsc: %p, p: %p, i: %p)\n",
-                __func__, cifsi->fscache, page, inode);
+                __func__, cifs_inode_cookie(inode), page, inode);
+
+       fscache_fallback_write_page(inode, page, true);
+}
+
+/*
+ * Query the cache occupancy.
+ */
+int __cifs_fscache_query_occupancy(struct inode *inode,
+                                  pgoff_t first, unsigned int nr_pages,
+                                  pgoff_t *_data_first,
+                                  unsigned int *_data_nr_pages)
+{
+       struct netfs_cache_resources cres;
+       struct fscache_cookie *cookie = cifs_inode_cookie(inode);
+       loff_t start, data_start;
+       size_t len, data_len;
+       int ret;
 
-       // Needs conversion to using netfslib
+       ret = fscache_begin_read_operation(&cres, cookie);
+       if (ret < 0)
+               return ret;
+
+       start = first * PAGE_SIZE;
+       len = nr_pages * PAGE_SIZE;
+       ret = cres.ops->query_occupancy(&cres, start, len, PAGE_SIZE,
+                                       &data_start, &data_len);
+       if (ret == 0) {
+               *_data_first = data_start / PAGE_SIZE;
+               *_data_nr_pages = len / PAGE_SIZE;
+       }
+
+       fscache_end_operation(&cres);
+       return ret;
 }
index c6ca49a..5512990 100644 (file)
@@ -9,6 +9,7 @@
 #ifndef _CIFS_FSCACHE_H
 #define _CIFS_FSCACHE_H
 
+#include <linux/swap.h>
 #include <linux/fscache.h>
 
 #include "cifsglob.h"
@@ -58,14 +59,6 @@ void cifs_fscache_fill_coherency(struct inode *inode,
 }
 
 
-extern int cifs_fscache_release_page(struct page *page, gfp_t gfp);
-extern int __cifs_readpage_from_fscache(struct inode *, struct page *);
-extern int __cifs_readpages_from_fscache(struct inode *,
-                                        struct address_space *,
-                                        struct list_head *,
-                                        unsigned *);
-extern void __cifs_readpage_to_fscache(struct inode *, struct page *);
-
 static inline struct fscache_cookie *cifs_inode_cookie(struct inode *inode)
 {
        return CIFS_I(inode)->fscache;
@@ -80,33 +73,52 @@ static inline void cifs_invalidate_cache(struct inode *inode, unsigned int flags
                           i_size_read(inode), flags);
 }
 
-static inline int cifs_readpage_from_fscache(struct inode *inode,
-                                            struct page *page)
-{
-       if (CIFS_I(inode)->fscache)
-               return __cifs_readpage_from_fscache(inode, page);
+extern int __cifs_fscache_query_occupancy(struct inode *inode,
+                                         pgoff_t first, unsigned int nr_pages,
+                                         pgoff_t *_data_first,
+                                         unsigned int *_data_nr_pages);
 
-       return -ENOBUFS;
+static inline int cifs_fscache_query_occupancy(struct inode *inode,
+                                              pgoff_t first, unsigned int nr_pages,
+                                              pgoff_t *_data_first,
+                                              unsigned int *_data_nr_pages)
+{
+       if (!cifs_inode_cookie(inode))
+               return -ENOBUFS;
+       return __cifs_fscache_query_occupancy(inode, first, nr_pages,
+                                             _data_first, _data_nr_pages);
 }
 
-static inline int cifs_readpages_from_fscache(struct inode *inode,
-                                             struct address_space *mapping,
-                                             struct list_head *pages,
-                                             unsigned *nr_pages)
+extern int __cifs_readpage_from_fscache(struct inode *pinode, struct page *ppage);
+extern void __cifs_readpage_to_fscache(struct inode *pinode, struct page *ppage);
+
+
+static inline int cifs_readpage_from_fscache(struct inode *inode,
+                                            struct page *page)
 {
-       if (CIFS_I(inode)->fscache)
-               return __cifs_readpages_from_fscache(inode, mapping, pages,
-                                                    nr_pages);
+       if (cifs_inode_cookie(inode))
+               return __cifs_readpage_from_fscache(inode, page);
        return -ENOBUFS;
 }
 
 static inline void cifs_readpage_to_fscache(struct inode *inode,
                                            struct page *page)
 {
-       if (PageFsCache(page))
+       if (cifs_inode_cookie(inode))
                __cifs_readpage_to_fscache(inode, page);
 }
 
+static inline int cifs_fscache_release_page(struct page *page, gfp_t gfp)
+{
+       if (PageFsCache(page)) {
+               if (current_is_kswapd() || !(gfp & __GFP_FS))
+                       return false;
+               wait_on_page_fscache(page);
+               fscache_note_page_release(cifs_inode_cookie(page->mapping->host));
+       }
+       return true;
+}
+
 #else /* CONFIG_CIFS_FSCACHE */
 static inline
 void cifs_fscache_fill_coherency(struct inode *inode,
@@ -123,22 +135,29 @@ static inline void cifs_fscache_unuse_inode_cookie(struct inode *inode, bool upd
 static inline struct fscache_cookie *cifs_inode_cookie(struct inode *inode) { return NULL; }
 static inline void cifs_invalidate_cache(struct inode *inode, unsigned int flags) {}
 
-static inline int
-cifs_readpage_from_fscache(struct inode *inode, struct page *page)
+static inline int cifs_fscache_query_occupancy(struct inode *inode,
+                                              pgoff_t first, unsigned int nr_pages,
+                                              pgoff_t *_data_first,
+                                              unsigned int *_data_nr_pages)
 {
+       *_data_first = ULONG_MAX;
+       *_data_nr_pages = 0;
        return -ENOBUFS;
 }
 
-static inline int cifs_readpages_from_fscache(struct inode *inode,
-                                             struct address_space *mapping,
-                                             struct list_head *pages,
-                                             unsigned *nr_pages)
+static inline int
+cifs_readpage_from_fscache(struct inode *inode, struct page *page)
 {
        return -ENOBUFS;
 }
 
-static inline void cifs_readpage_to_fscache(struct inode *inode,
-                       struct page *page) {}
+static inline
+void cifs_readpage_to_fscache(struct inode *inode, struct page *page) {}
+
+static inline int nfs_fscache_release_page(struct page *page, gfp_t gfp)
+{
+       return true; /* May release page */
+}
 
 #endif /* CONFIG_CIFS_FSCACHE */
 
index 7d8b3ce..60d853c 100644 (file)
@@ -83,6 +83,7 @@ static void cifs_set_ops(struct inode *inode)
 static void
 cifs_revalidate_cache(struct inode *inode, struct cifs_fattr *fattr)
 {
+       struct cifs_fscache_inode_coherency_data cd;
        struct cifsInodeInfo *cifs_i = CIFS_I(inode);
 
        cifs_dbg(FYI, "%s: revalidating inode %llu\n",
@@ -113,6 +114,9 @@ cifs_revalidate_cache(struct inode *inode, struct cifs_fattr *fattr)
        cifs_dbg(FYI, "%s: invalidating inode %llu mapping\n",
                 __func__, cifs_i->uniqueid);
        set_bit(CIFS_INO_INVALID_MAPPING, &cifs_i->flags);
+       /* Invalidate fscache cookie */
+       cifs_fscache_fill_coherency(&cifs_i->vfs_inode, &cd);
+       fscache_invalidate(cifs_inode_cookie(inode), &cd, i_size_read(inode), 0);
 }
 
 /*
@@ -2261,8 +2265,6 @@ cifs_dentry_needs_reval(struct dentry *dentry)
 int
 cifs_invalidate_mapping(struct inode *inode)
 {
-       struct cifs_fscache_inode_coherency_data cd;
-       struct cifsInodeInfo *cifsi = CIFS_I(inode);
        int rc = 0;
 
        if (inode->i_mapping && inode->i_mapping->nrpages != 0) {
@@ -2272,8 +2274,6 @@ cifs_invalidate_mapping(struct inode *inode)
                                 __func__, inode);
        }
 
-       cifs_fscache_fill_coherency(&cifsi->vfs_inode, &cd);
-       fscache_invalidate(cifs_inode_cookie(inode), &cd, i_size_read(inode), 0);
        return rc;
 }
 
index dc3b16d..5723d50 100644 (file)
@@ -713,7 +713,11 @@ static int size_of_ntlmssp_blob(struct cifs_ses *ses, int base_size)
        else
                sz += sizeof(__le16);
 
-       sz += sizeof(__le16) * strnlen(ses->workstation_name, CIFS_MAX_WORKSTATION_LEN);
+       if (ses->workstation_name)
+               sz += sizeof(__le16) * strnlen(ses->workstation_name,
+                       CIFS_MAX_WORKSTATION_LEN);
+       else
+               sz += sizeof(__le16);
 
        return sz;
 }
index 1466b5d..d3cd2a9 100644 (file)
@@ -1780,8 +1780,8 @@ void configfs_unregister_group(struct config_group *group)
        configfs_detach_group(&group->cg_item);
        d_inode(dentry)->i_flags |= S_DEAD;
        dont_mount(dentry);
+       d_drop(dentry);
        fsnotify_rmdir(d_inode(parent), dentry);
-       d_delete(dentry);
        inode_unlock(d_inode(parent));
 
        dput(dentry);
@@ -1922,10 +1922,10 @@ void configfs_unregister_subsystem(struct configfs_subsystem *subsys)
        configfs_detach_group(&group->cg_item);
        d_inode(dentry)->i_flags |= S_DEAD;
        dont_mount(dentry);
-       fsnotify_rmdir(d_inode(root), dentry);
        inode_unlock(d_inode(dentry));
 
-       d_delete(dentry);
+       d_drop(dentry);
+       fsnotify_rmdir(d_inode(root), dentry);
 
        inode_unlock(d_inode(root));
 
index 42e5a76..4f25015 100644 (file)
@@ -621,8 +621,8 @@ void devpts_pty_kill(struct dentry *dentry)
 
        dentry->d_fsdata = NULL;
        drop_nlink(dentry->d_inode);
-       fsnotify_unlink(d_inode(dentry->d_parent), dentry);
        d_drop(dentry);
+       fsnotify_unlink(d_inode(dentry->d_parent), dentry);
        dput(dentry);   /* d_alloc_name() in devpts_pty_new() */
 }
 
index fa7ddb7..226a57c 100644 (file)
@@ -252,12 +252,10 @@ static int erofs_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
                return ret;
 
        iomap->offset = map.m_la;
-       if (flags & IOMAP_DAX) {
+       if (flags & IOMAP_DAX)
                iomap->dax_dev = mdev.m_daxdev;
-               iomap->offset += mdev.m_dax_part_off;
-       } else {
+       else
                iomap->bdev = mdev.m_bdev;
-       }
        iomap->length = map.m_llen;
        iomap->flags = 0;
        iomap->private = NULL;
@@ -284,6 +282,8 @@ static int erofs_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
        } else {
                iomap->type = IOMAP_MAPPED;
                iomap->addr = mdev.m_pa;
+               if (flags & IOMAP_DAX)
+                       iomap->addr += mdev.m_dax_part_off;
        }
        return 0;
 }
index 498b766..423bc1a 100644 (file)
@@ -810,68 +810,11 @@ static bool z_erofs_get_sync_decompress_policy(struct erofs_sb_info *sbi,
        return false;
 }
 
-static void z_erofs_decompressqueue_work(struct work_struct *work);
-static void z_erofs_decompress_kickoff(struct z_erofs_decompressqueue *io,
-                                      bool sync, int bios)
-{
-       struct erofs_sb_info *const sbi = EROFS_SB(io->sb);
-
-       /* wake up the caller thread for sync decompression */
-       if (sync) {
-               unsigned long flags;
-
-               spin_lock_irqsave(&io->u.wait.lock, flags);
-               if (!atomic_add_return(bios, &io->pending_bios))
-                       wake_up_locked(&io->u.wait);
-               spin_unlock_irqrestore(&io->u.wait.lock, flags);
-               return;
-       }
-
-       if (atomic_add_return(bios, &io->pending_bios))
-               return;
-       /* Use workqueue and sync decompression for atomic contexts only */
-       if (in_atomic() || irqs_disabled()) {
-               queue_work(z_erofs_workqueue, &io->u.work);
-               /* enable sync decompression for readahead */
-               if (sbi->opt.sync_decompress == EROFS_SYNC_DECOMPRESS_AUTO)
-                       sbi->opt.sync_decompress = EROFS_SYNC_DECOMPRESS_FORCE_ON;
-               return;
-       }
-       z_erofs_decompressqueue_work(&io->u.work);
-}
-
 static bool z_erofs_page_is_invalidated(struct page *page)
 {
        return !page->mapping && !z_erofs_is_shortlived_page(page);
 }
 
-static void z_erofs_decompressqueue_endio(struct bio *bio)
-{
-       tagptr1_t t = tagptr_init(tagptr1_t, bio->bi_private);
-       struct z_erofs_decompressqueue *q = tagptr_unfold_ptr(t);
-       blk_status_t err = bio->bi_status;
-       struct bio_vec *bvec;
-       struct bvec_iter_all iter_all;
-
-       bio_for_each_segment_all(bvec, bio, iter_all) {
-               struct page *page = bvec->bv_page;
-
-               DBG_BUGON(PageUptodate(page));
-               DBG_BUGON(z_erofs_page_is_invalidated(page));
-
-               if (err)
-                       SetPageError(page);
-
-               if (erofs_page_is_managed(EROFS_SB(q->sb), page)) {
-                       if (!err)
-                               SetPageUptodate(page);
-                       unlock_page(page);
-               }
-       }
-       z_erofs_decompress_kickoff(q, tagptr_unfold_tags(t), -1);
-       bio_put(bio);
-}
-
 static int z_erofs_decompress_pcluster(struct super_block *sb,
                                       struct z_erofs_pcluster *pcl,
                                       struct page **pagepool)
@@ -1123,6 +1066,35 @@ static void z_erofs_decompressqueue_work(struct work_struct *work)
        kvfree(bgq);
 }
 
+static void z_erofs_decompress_kickoff(struct z_erofs_decompressqueue *io,
+                                      bool sync, int bios)
+{
+       struct erofs_sb_info *const sbi = EROFS_SB(io->sb);
+
+       /* wake up the caller thread for sync decompression */
+       if (sync) {
+               unsigned long flags;
+
+               spin_lock_irqsave(&io->u.wait.lock, flags);
+               if (!atomic_add_return(bios, &io->pending_bios))
+                       wake_up_locked(&io->u.wait);
+               spin_unlock_irqrestore(&io->u.wait.lock, flags);
+               return;
+       }
+
+       if (atomic_add_return(bios, &io->pending_bios))
+               return;
+       /* Use workqueue and sync decompression for atomic contexts only */
+       if (in_atomic() || irqs_disabled()) {
+               queue_work(z_erofs_workqueue, &io->u.work);
+               /* enable sync decompression for readahead */
+               if (sbi->opt.sync_decompress == EROFS_SYNC_DECOMPRESS_AUTO)
+                       sbi->opt.sync_decompress = EROFS_SYNC_DECOMPRESS_FORCE_ON;
+               return;
+       }
+       z_erofs_decompressqueue_work(&io->u.work);
+}
+
 static struct page *pickup_page_for_submission(struct z_erofs_pcluster *pcl,
                                               unsigned int nr,
                                               struct page **pagepool,
@@ -1300,6 +1272,33 @@ static void move_to_bypass_jobqueue(struct z_erofs_pcluster *pcl,
        qtail[JQ_BYPASS] = &pcl->next;
 }
 
+static void z_erofs_decompressqueue_endio(struct bio *bio)
+{
+       tagptr1_t t = tagptr_init(tagptr1_t, bio->bi_private);
+       struct z_erofs_decompressqueue *q = tagptr_unfold_ptr(t);
+       blk_status_t err = bio->bi_status;
+       struct bio_vec *bvec;
+       struct bvec_iter_all iter_all;
+
+       bio_for_each_segment_all(bvec, bio, iter_all) {
+               struct page *page = bvec->bv_page;
+
+               DBG_BUGON(PageUptodate(page));
+               DBG_BUGON(z_erofs_page_is_invalidated(page));
+
+               if (err)
+                       SetPageError(page);
+
+               if (erofs_page_is_managed(EROFS_SB(q->sb), page)) {
+                       if (!err)
+                               SetPageUptodate(page);
+                       unlock_page(page);
+               }
+       }
+       z_erofs_decompress_kickoff(q, tagptr_unfold_tags(t), -1);
+       bio_put(bio);
+}
+
 static void z_erofs_submit_queue(struct super_block *sb,
                                 struct z_erofs_decompress_frontend *f,
                                 struct page **pagepool,
index 18d7fd1..361b1d6 100644 (file)
@@ -630,6 +630,13 @@ static int z_erofs_do_map_blocks(struct inode *inode,
                if (endoff >= m.clusterofs) {
                        m.headtype = m.type;
                        map->m_la = (m.lcn << lclusterbits) | m.clusterofs;
+                       /*
+                        * For ztailpacking files, in order to inline data more
+                        * effectively, special EOF lclusters are now supported
+                        * which can have three parts at most.
+                        */
+                       if (ztailpacking && end > inode->i_size)
+                               end = inode->i_size;
                        break;
                }
                /* m.lcn should be >= 1 if endoff < m.clusterofs */
index 5a35768..57e82e2 100644 (file)
@@ -139,7 +139,7 @@ fail:
 /*
  * Inode operation get_posix_acl().
  *
- * inode->i_mutex: don't care
+ * inode->i_rwsem: don't care
  */
 struct posix_acl *
 ext4_get_acl(struct inode *inode, int type, bool rcu)
@@ -183,7 +183,7 @@ ext4_get_acl(struct inode *inode, int type, bool rcu)
 /*
  * Set the access or default ACL of an inode.
  *
- * inode->i_mutex: down unless called from ext4_new_inode
+ * inode->i_rwsem: down unless called from ext4_new_inode
  */
 static int
 __ext4_set_acl(handle_t *handle, struct inode *inode, int type,
@@ -271,8 +271,8 @@ out_stop:
 /*
  * Initialize the ACLs of a new inode. Called from ext4_new_inode.
  *
- * dir->i_mutex: down
- * inode->i_mutex: up (access to inode is still exclusive)
+ * dir->i_rwsem: down
+ * inode->i_rwsem: up (access to inode is still exclusive)
  */
 int
 ext4_init_acl(handle_t *handle, struct inode *inode, struct inode *dir)
index 71a3cdc..bcd3b9b 100644 (file)
@@ -1028,7 +1028,7 @@ struct ext4_inode_info {
 
        /*
         * Extended attributes can be read independently of the main file
-        * data. Taking i_mutex even when reading would cause contention
+        * data. Taking i_rwsem even when reading would cause contention
         * between readers of EAs and writers of regular file data, so
         * instead we synchronize on xattr_sem when reading or changing
         * EAs.
@@ -1750,6 +1750,7 @@ struct ext4_sb_info {
        spinlock_t s_fc_lock;
        struct buffer_head *s_fc_bh;
        struct ext4_fc_stats s_fc_stats;
+       tid_t s_fc_ineligible_tid;
 #ifdef CONFIG_EXT4_DEBUG
        int s_fc_debug_max_replay;
 #endif
@@ -1795,10 +1796,7 @@ static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
 enum {
        EXT4_MF_MNTDIR_SAMPLED,
        EXT4_MF_FS_ABORTED,     /* Fatal error detected */
-       EXT4_MF_FC_INELIGIBLE,  /* Fast commit ineligible */
-       EXT4_MF_FC_COMMITTING   /* File system underoing a fast
-                                * commit.
-                                */
+       EXT4_MF_FC_INELIGIBLE   /* Fast commit ineligible */
 };
 
 static inline void ext4_set_mount_flag(struct super_block *sb, int bit)
@@ -2485,7 +2483,7 @@ struct ext4_filename {
 #ifdef CONFIG_FS_ENCRYPTION
        struct fscrypt_str crypto_buf;
 #endif
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        struct fscrypt_str cf_name;
 #endif
 };
@@ -2721,7 +2719,7 @@ extern unsigned ext4_free_clusters_after_init(struct super_block *sb,
                                              struct ext4_group_desc *gdp);
 ext4_fsblk_t ext4_inode_to_goal_block(struct inode *);
 
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
 extern int ext4_fname_setup_ci_filename(struct inode *dir,
                                         const struct qstr *iname,
                                         struct ext4_filename *fname);
@@ -2754,7 +2752,7 @@ static inline int ext4_fname_setup_filename(struct inode *dir,
 
        ext4_fname_from_fscrypt_name(fname, &name);
 
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        err = ext4_fname_setup_ci_filename(dir, iname, fname);
 #endif
        return err;
@@ -2773,7 +2771,7 @@ static inline int ext4_fname_prepare_lookup(struct inode *dir,
 
        ext4_fname_from_fscrypt_name(fname, &name);
 
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        err = ext4_fname_setup_ci_filename(dir, &dentry->d_name, fname);
 #endif
        return err;
@@ -2790,7 +2788,7 @@ static inline void ext4_fname_free_filename(struct ext4_filename *fname)
        fname->usr_fname = NULL;
        fname->disk_name.name = NULL;
 
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        kfree(fname->cf_name.name);
        fname->cf_name.name = NULL;
 #endif
@@ -2806,7 +2804,7 @@ static inline int ext4_fname_setup_filename(struct inode *dir,
        fname->disk_name.name = (unsigned char *) iname->name;
        fname->disk_name.len = iname->len;
 
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        err = ext4_fname_setup_ci_filename(dir, iname, fname);
 #endif
 
@@ -2822,7 +2820,7 @@ static inline int ext4_fname_prepare_lookup(struct inode *dir,
 
 static inline void ext4_fname_free_filename(struct ext4_filename *fname)
 {
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        kfree(fname->cf_name.name);
        fname->cf_name.name = NULL;
 #endif
@@ -2926,7 +2924,7 @@ void __ext4_fc_track_create(handle_t *handle, struct inode *inode,
                            struct dentry *dentry);
 void ext4_fc_track_create(handle_t *handle, struct dentry *dentry);
 void ext4_fc_track_inode(handle_t *handle, struct inode *inode);
-void ext4_fc_mark_ineligible(struct super_block *sb, int reason);
+void ext4_fc_mark_ineligible(struct super_block *sb, int reason, handle_t *handle);
 void ext4_fc_start_update(struct inode *inode);
 void ext4_fc_stop_update(struct inode *inode);
 void ext4_fc_del(struct inode *inode);
@@ -2935,6 +2933,9 @@ void ext4_fc_replay_cleanup(struct super_block *sb);
 int ext4_fc_commit(journal_t *journal, tid_t commit_tid);
 int __init ext4_fc_init_dentry_cache(void);
 void ext4_fc_destroy_dentry_cache(void);
+int ext4_fc_record_regions(struct super_block *sb, int ino,
+                          ext4_lblk_t lblk, ext4_fsblk_t pblk,
+                          int len, int replay);
 
 /* mballoc.c */
 extern const struct seq_operations ext4_mb_seq_groups_ops;
@@ -3407,7 +3408,7 @@ do {                                                              \
 #define EXT4_FREECLUSTERS_WATERMARK 0
 #endif
 
-/* Update i_disksize. Requires i_mutex to avoid races with truncate */
+/* Update i_disksize. Requires i_rwsem to avoid races with truncate */
 static inline void ext4_update_i_disksize(struct inode *inode, loff_t newsize)
 {
        WARN_ON_ONCE(S_ISREG(inode->i_mode) &&
@@ -3418,7 +3419,7 @@ static inline void ext4_update_i_disksize(struct inode *inode, loff_t newsize)
        up_write(&EXT4_I(inode)->i_data_sem);
 }
 
-/* Update i_size, i_disksize. Requires i_mutex to avoid races with truncate */
+/* Update i_size, i_disksize. Requires i_rwsem to avoid races with truncate */
 static inline int ext4_update_inode_size(struct inode *inode, loff_t newsize)
 {
        int changed = 0;
index 0e4fa64..db2ae4a 100644 (file)
@@ -491,7 +491,7 @@ static inline int ext4_free_data_revoke_credits(struct inode *inode, int blocks)
 /*
  * This function controls whether or not we should try to go down the
  * dioread_nolock code paths, which makes it safe to avoid taking
- * i_mutex for direct I/O reads.  This only works for extent-based
+ * i_rwsem for direct I/O reads.  This only works for extent-based
  * files, and it doesn't work if data journaling is enabled, since the
  * dioread_nolock code uses b_private to pass information back to the
  * I/O completion handler, and this conflicts with the jbd's use of
index 74c91da..c0f3f83 100644 (file)
@@ -97,7 +97,7 @@ static int ext4_ext_trunc_restart_fn(struct inode *inode, int *dropped)
         * Drop i_data_sem to avoid deadlock with ext4_map_blocks.  At this
         * moment, get_block can be called only for blocks inside i_size since
         * page cache has been already dropped and writes are blocked by
-        * i_mutex. So we can safely drop the i_data_sem here.
+        * i_rwsem. So we can safely drop the i_data_sem here.
         */
        BUG_ON(EXT4_JOURNAL(inode) == NULL);
        ext4_discard_preallocations(inode, 0);
@@ -4572,7 +4572,7 @@ static long ext4_zero_range(struct file *file, loff_t offset,
 
        flags = EXT4_GET_BLOCKS_CREATE_UNWRIT_EXT;
 
-       /* Wait all existing dio workers, newcomers will block on i_mutex */
+       /* Wait all existing dio workers, newcomers will block on i_rwsem */
        inode_dio_wait(inode);
 
        /* Preallocate the range including the unaligned edges */
@@ -4738,7 +4738,7 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
                        goto out;
        }
 
-       /* Wait all existing dio workers, newcomers will block on i_mutex */
+       /* Wait all existing dio workers, newcomers will block on i_rwsem */
        inode_dio_wait(inode);
 
        ret = ext4_alloc_file_blocks(file, lblk, max_blocks, new_size, flags);
@@ -5334,7 +5334,7 @@ static int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len)
                ret = PTR_ERR(handle);
                goto out_mmap;
        }
-       ext4_fc_mark_ineligible(sb, EXT4_FC_REASON_FALLOC_RANGE);
+       ext4_fc_mark_ineligible(sb, EXT4_FC_REASON_FALLOC_RANGE, handle);
 
        down_write(&EXT4_I(inode)->i_data_sem);
        ext4_discard_preallocations(inode, 0);
@@ -5474,7 +5474,7 @@ static int ext4_insert_range(struct inode *inode, loff_t offset, loff_t len)
                ret = PTR_ERR(handle);
                goto out_mmap;
        }
-       ext4_fc_mark_ineligible(sb, EXT4_FC_REASON_FALLOC_RANGE);
+       ext4_fc_mark_ineligible(sb, EXT4_FC_REASON_FALLOC_RANGE, handle);
 
        /* Expand file to avoid data loss if there is error while shifting */
        inode->i_size += len;
@@ -5571,7 +5571,7 @@ out_mutex:
  * stuff such as page-cache locking consistency, bh mapping consistency or
  * extent's data copying must be performed by caller.
  * Locking:
- *             i_mutex is held for both inodes
+ *             i_rwsem is held for both inodes
  *             i_data_sem is locked for write for both inodes
  * Assumptions:
  *             All pages from requested range are locked for both inodes
@@ -6091,11 +6091,15 @@ int ext4_ext_clear_bb(struct inode *inode)
 
                                        ext4_mb_mark_bb(inode->i_sb,
                                                        path[j].p_block, 1, 0);
+                                       ext4_fc_record_regions(inode->i_sb, inode->i_ino,
+                                                       0, path[j].p_block, 1, 1);
                                }
                                ext4_ext_drop_refs(path);
                                kfree(path);
                        }
                        ext4_mb_mark_bb(inode->i_sb, map.m_pblk, map.m_len, 0);
+                       ext4_fc_record_regions(inode->i_sb, inode->i_ino,
+                                       map.m_lblk, map.m_pblk, map.m_len, 1);
                }
                cur = cur + map.m_len;
        }
index 5ae8026..7964ee3 100644 (file)
@@ -300,18 +300,32 @@ restart:
 }
 
 /*
- * Mark file system as fast commit ineligible. This means that next commit
- * operation would result in a full jbd2 commit.
+ * Mark file system as fast commit ineligible, and record latest
+ * ineligible transaction tid. This means until the recorded
+ * transaction, commit operation would result in a full jbd2 commit.
  */
-void ext4_fc_mark_ineligible(struct super_block *sb, int reason)
+void ext4_fc_mark_ineligible(struct super_block *sb, int reason, handle_t *handle)
 {
        struct ext4_sb_info *sbi = EXT4_SB(sb);
+       tid_t tid;
 
        if (!test_opt2(sb, JOURNAL_FAST_COMMIT) ||
            (EXT4_SB(sb)->s_mount_state & EXT4_FC_REPLAY))
                return;
 
        ext4_set_mount_flag(sb, EXT4_MF_FC_INELIGIBLE);
+       if (handle && !IS_ERR(handle))
+               tid = handle->h_transaction->t_tid;
+       else {
+               read_lock(&sbi->s_journal->j_state_lock);
+               tid = sbi->s_journal->j_running_transaction ?
+                               sbi->s_journal->j_running_transaction->t_tid : 0;
+               read_unlock(&sbi->s_journal->j_state_lock);
+       }
+       spin_lock(&sbi->s_fc_lock);
+       if (sbi->s_fc_ineligible_tid < tid)
+               sbi->s_fc_ineligible_tid = tid;
+       spin_unlock(&sbi->s_fc_lock);
        WARN_ON(reason >= EXT4_FC_REASON_MAX);
        sbi->s_fc_stats.fc_ineligible_reason_count[reason]++;
 }
@@ -361,7 +375,8 @@ static int ext4_fc_track_template(
        spin_lock(&sbi->s_fc_lock);
        if (list_empty(&EXT4_I(inode)->i_fc_list))
                list_add_tail(&EXT4_I(inode)->i_fc_list,
-                               (ext4_test_mount_flag(inode->i_sb, EXT4_MF_FC_COMMITTING)) ?
+                               (sbi->s_journal->j_flags & JBD2_FULL_COMMIT_ONGOING ||
+                                sbi->s_journal->j_flags & JBD2_FAST_COMMIT_ONGOING) ?
                                &sbi->s_fc_q[FC_Q_STAGING] :
                                &sbi->s_fc_q[FC_Q_MAIN]);
        spin_unlock(&sbi->s_fc_lock);
@@ -387,7 +402,7 @@ static int __track_dentry_update(struct inode *inode, void *arg, bool update)
        mutex_unlock(&ei->i_fc_lock);
        node = kmem_cache_alloc(ext4_fc_dentry_cachep, GFP_NOFS);
        if (!node) {
-               ext4_fc_mark_ineligible(inode->i_sb, EXT4_FC_REASON_NOMEM);
+               ext4_fc_mark_ineligible(inode->i_sb, EXT4_FC_REASON_NOMEM, NULL);
                mutex_lock(&ei->i_fc_lock);
                return -ENOMEM;
        }
@@ -400,7 +415,7 @@ static int __track_dentry_update(struct inode *inode, void *arg, bool update)
                if (!node->fcd_name.name) {
                        kmem_cache_free(ext4_fc_dentry_cachep, node);
                        ext4_fc_mark_ineligible(inode->i_sb,
-                               EXT4_FC_REASON_NOMEM);
+                               EXT4_FC_REASON_NOMEM, NULL);
                        mutex_lock(&ei->i_fc_lock);
                        return -ENOMEM;
                }
@@ -414,7 +429,8 @@ static int __track_dentry_update(struct inode *inode, void *arg, bool update)
        node->fcd_name.len = dentry->d_name.len;
 
        spin_lock(&sbi->s_fc_lock);
-       if (ext4_test_mount_flag(inode->i_sb, EXT4_MF_FC_COMMITTING))
+       if (sbi->s_journal->j_flags & JBD2_FULL_COMMIT_ONGOING ||
+               sbi->s_journal->j_flags & JBD2_FAST_COMMIT_ONGOING)
                list_add_tail(&node->fcd_list,
                                &sbi->s_fc_dentry_q[FC_Q_STAGING]);
        else
@@ -502,7 +518,7 @@ void ext4_fc_track_inode(handle_t *handle, struct inode *inode)
 
        if (ext4_should_journal_data(inode)) {
                ext4_fc_mark_ineligible(inode->i_sb,
-                                       EXT4_FC_REASON_INODE_JOURNAL_DATA);
+                                       EXT4_FC_REASON_INODE_JOURNAL_DATA, handle);
                return;
        }
 
@@ -879,7 +895,6 @@ static int ext4_fc_submit_inode_data_all(journal_t *journal)
        int ret = 0;
 
        spin_lock(&sbi->s_fc_lock);
-       ext4_set_mount_flag(sb, EXT4_MF_FC_COMMITTING);
        list_for_each_entry(ei, &sbi->s_fc_q[FC_Q_MAIN], i_fc_list) {
                ext4_set_inode_state(&ei->vfs_inode, EXT4_STATE_FC_COMMITTING);
                while (atomic_read(&ei->i_fc_updates)) {
@@ -1179,7 +1194,7 @@ fallback:
  * Fast commit cleanup routine. This is called after every fast commit and
  * full commit. full is true if we are called after a full commit.
  */
-static void ext4_fc_cleanup(journal_t *journal, int full)
+static void ext4_fc_cleanup(journal_t *journal, int full, tid_t tid)
 {
        struct super_block *sb = journal->j_private;
        struct ext4_sb_info *sbi = EXT4_SB(sb);
@@ -1197,7 +1212,8 @@ static void ext4_fc_cleanup(journal_t *journal, int full)
                list_del_init(&iter->i_fc_list);
                ext4_clear_inode_state(&iter->vfs_inode,
                                       EXT4_STATE_FC_COMMITTING);
-               ext4_fc_reset_inode(&iter->vfs_inode);
+               if (iter->i_sync_tid <= tid)
+                       ext4_fc_reset_inode(&iter->vfs_inode);
                /* Make sure EXT4_STATE_FC_COMMITTING bit is clear */
                smp_mb();
 #if (BITS_PER_LONG < 64)
@@ -1226,8 +1242,10 @@ static void ext4_fc_cleanup(journal_t *journal, int full)
        list_splice_init(&sbi->s_fc_q[FC_Q_STAGING],
                                &sbi->s_fc_q[FC_Q_MAIN]);
 
-       ext4_clear_mount_flag(sb, EXT4_MF_FC_COMMITTING);
-       ext4_clear_mount_flag(sb, EXT4_MF_FC_INELIGIBLE);
+       if (tid >= sbi->s_fc_ineligible_tid) {
+               sbi->s_fc_ineligible_tid = 0;
+               ext4_clear_mount_flag(sb, EXT4_MF_FC_INELIGIBLE);
+       }
 
        if (full)
                sbi->s_fc_bytes = 0;
@@ -1392,14 +1410,15 @@ static int ext4_fc_record_modified_inode(struct super_block *sb, int ino)
                if (state->fc_modified_inodes[i] == ino)
                        return 0;
        if (state->fc_modified_inodes_used == state->fc_modified_inodes_size) {
-               state->fc_modified_inodes_size +=
-                       EXT4_FC_REPLAY_REALLOC_INCREMENT;
                state->fc_modified_inodes = krealloc(
-                                       state->fc_modified_inodes, sizeof(int) *
-                                       state->fc_modified_inodes_size,
-                                       GFP_KERNEL);
+                               state->fc_modified_inodes,
+                               sizeof(int) * (state->fc_modified_inodes_size +
+                               EXT4_FC_REPLAY_REALLOC_INCREMENT),
+                               GFP_KERNEL);
                if (!state->fc_modified_inodes)
                        return -ENOMEM;
+               state->fc_modified_inodes_size +=
+                       EXT4_FC_REPLAY_REALLOC_INCREMENT;
        }
        state->fc_modified_inodes[state->fc_modified_inodes_used++] = ino;
        return 0;
@@ -1431,7 +1450,9 @@ static int ext4_fc_replay_inode(struct super_block *sb, struct ext4_fc_tl *tl,
        }
        inode = NULL;
 
-       ext4_fc_record_modified_inode(sb, ino);
+       ret = ext4_fc_record_modified_inode(sb, ino);
+       if (ret)
+               goto out;
 
        raw_fc_inode = (struct ext4_inode *)
                (val + offsetof(struct ext4_fc_inode, fc_raw_inode));
@@ -1563,16 +1584,23 @@ out:
 }
 
 /*
- * Record physical disk regions which are in use as per fast commit area. Our
- * simple replay phase allocator excludes these regions from allocation.
+ * Record physical disk regions which are in use as per fast commit area,
+ * and used by inodes during replay phase. Our simple replay phase
+ * allocator excludes these regions from allocation.
  */
-static int ext4_fc_record_regions(struct super_block *sb, int ino,
-               ext4_lblk_t lblk, ext4_fsblk_t pblk, int len)
+int ext4_fc_record_regions(struct super_block *sb, int ino,
+               ext4_lblk_t lblk, ext4_fsblk_t pblk, int len, int replay)
 {
        struct ext4_fc_replay_state *state;
        struct ext4_fc_alloc_region *region;
 
        state = &EXT4_SB(sb)->s_fc_replay_state;
+       /*
+        * during replay phase, the fc_regions_valid may not same as
+        * fc_regions_used, update it when do new additions.
+        */
+       if (replay && state->fc_regions_used != state->fc_regions_valid)
+               state->fc_regions_used = state->fc_regions_valid;
        if (state->fc_regions_used == state->fc_regions_size) {
                state->fc_regions_size +=
                        EXT4_FC_REPLAY_REALLOC_INCREMENT;
@@ -1590,6 +1618,9 @@ static int ext4_fc_record_regions(struct super_block *sb, int ino,
        region->pblk = pblk;
        region->len = len;
 
+       if (replay)
+               state->fc_regions_valid++;
+
        return 0;
 }
 
@@ -1621,6 +1652,8 @@ static int ext4_fc_replay_add_range(struct super_block *sb,
        }
 
        ret = ext4_fc_record_modified_inode(sb, inode->i_ino);
+       if (ret)
+               goto out;
 
        start = le32_to_cpu(ex->ee_block);
        start_pblk = ext4_ext_pblock(ex);
@@ -1638,18 +1671,14 @@ static int ext4_fc_replay_add_range(struct super_block *sb,
                map.m_pblk = 0;
                ret = ext4_map_blocks(NULL, inode, &map, 0);
 
-               if (ret < 0) {
-                       iput(inode);
-                       return 0;
-               }
+               if (ret < 0)
+                       goto out;
 
                if (ret == 0) {
                        /* Range is not mapped */
                        path = ext4_find_extent(inode, cur, NULL, 0);
-                       if (IS_ERR(path)) {
-                               iput(inode);
-                               return 0;
-                       }
+                       if (IS_ERR(path))
+                               goto out;
                        memset(&newex, 0, sizeof(newex));
                        newex.ee_block = cpu_to_le32(cur);
                        ext4_ext_store_pblock(
@@ -1663,10 +1692,8 @@ static int ext4_fc_replay_add_range(struct super_block *sb,
                        up_write((&EXT4_I(inode)->i_data_sem));
                        ext4_ext_drop_refs(path);
                        kfree(path);
-                       if (ret) {
-                               iput(inode);
-                               return 0;
-                       }
+                       if (ret)
+                               goto out;
                        goto next;
                }
 
@@ -1679,10 +1706,8 @@ static int ext4_fc_replay_add_range(struct super_block *sb,
                        ret = ext4_ext_replay_update_ex(inode, cur, map.m_len,
                                        ext4_ext_is_unwritten(ex),
                                        start_pblk + cur - start);
-                       if (ret) {
-                               iput(inode);
-                               return 0;
-                       }
+                       if (ret)
+                               goto out;
                        /*
                         * Mark the old blocks as free since they aren't used
                         * anymore. We maintain an array of all the modified
@@ -1702,10 +1727,8 @@ static int ext4_fc_replay_add_range(struct super_block *sb,
                        ext4_ext_is_unwritten(ex), map.m_pblk);
                ret = ext4_ext_replay_update_ex(inode, cur, map.m_len,
                                        ext4_ext_is_unwritten(ex), map.m_pblk);
-               if (ret) {
-                       iput(inode);
-                       return 0;
-               }
+               if (ret)
+                       goto out;
                /*
                 * We may have split the extent tree while toggling the state.
                 * Try to shrink the extent tree now.
@@ -1717,6 +1740,7 @@ next:
        }
        ext4_ext_replay_shrink_inode(inode, i_size_read(inode) >>
                                        sb->s_blocksize_bits);
+out:
        iput(inode);
        return 0;
 }
@@ -1746,6 +1770,8 @@ ext4_fc_replay_del_range(struct super_block *sb, struct ext4_fc_tl *tl,
        }
 
        ret = ext4_fc_record_modified_inode(sb, inode->i_ino);
+       if (ret)
+               goto out;
 
        jbd_debug(1, "DEL_RANGE, inode %ld, lblk %d, len %d\n",
                        inode->i_ino, le32_to_cpu(lrange.fc_lblk),
@@ -1755,10 +1781,8 @@ ext4_fc_replay_del_range(struct super_block *sb, struct ext4_fc_tl *tl,
                map.m_len = remaining;
 
                ret = ext4_map_blocks(NULL, inode, &map, 0);
-               if (ret < 0) {
-                       iput(inode);
-                       return 0;
-               }
+               if (ret < 0)
+                       goto out;
                if (ret > 0) {
                        remaining -= ret;
                        cur += ret;
@@ -1770,18 +1794,17 @@ ext4_fc_replay_del_range(struct super_block *sb, struct ext4_fc_tl *tl,
        }
 
        down_write(&EXT4_I(inode)->i_data_sem);
-       ret = ext4_ext_remove_space(inode, lrange.fc_lblk,
-                               lrange.fc_lblk + lrange.fc_len - 1);
+       ret = ext4_ext_remove_space(inode, le32_to_cpu(lrange.fc_lblk),
+                               le32_to_cpu(lrange.fc_lblk) +
+                               le32_to_cpu(lrange.fc_len) - 1);
        up_write(&EXT4_I(inode)->i_data_sem);
-       if (ret) {
-               iput(inode);
-               return 0;
-       }
+       if (ret)
+               goto out;
        ext4_ext_replay_shrink_inode(inode,
                i_size_read(inode) >> sb->s_blocksize_bits);
        ext4_mark_inode_dirty(NULL, inode);
+out:
        iput(inode);
-
        return 0;
 }
 
@@ -1937,7 +1960,7 @@ static int ext4_fc_replay_scan(journal_t *journal,
                        ret = ext4_fc_record_regions(sb,
                                le32_to_cpu(ext.fc_ino),
                                le32_to_cpu(ex->ee_block), ext4_ext_pblock(ex),
-                               ext4_ext_get_actual_len(ex));
+                               ext4_ext_get_actual_len(ex), 0);
                        if (ret < 0)
                                break;
                        ret = JBD2_FC_REPLAY_CONTINUE;
index f34f417..147b524 100644 (file)
@@ -290,7 +290,7 @@ static int __ext4fs_dirhash(const struct inode *dir, const char *name, int len,
 int ext4fs_dirhash(const struct inode *dir, const char *name, int len,
                   struct dx_hash_info *hinfo)
 {
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        const struct unicode_map *um = dir->i_sb->s_encoding;
        int r, dlen;
        unsigned char *buff;
index 89efa78..07a8c75 100644 (file)
@@ -696,7 +696,7 @@ static int ext4_ind_trunc_restart_fn(handle_t *handle, struct inode *inode,
         * Drop i_data_sem to avoid deadlock with ext4_map_blocks.  At this
         * moment, get_block can be called only for blocks inside i_size since
         * page cache has been already dropped and writes are blocked by
-        * i_mutex. So we can safely drop the i_data_sem here.
+        * i_rwsem. So we can safely drop the i_data_sem here.
         */
        BUG_ON(EXT4_JOURNAL(inode) == NULL);
        ext4_discard_preallocations(inode, 0);
index 635bcf6..e429418 100644 (file)
@@ -911,7 +911,7 @@ int ext4_da_write_inline_data_begin(struct address_space *mapping,
                                    struct page **pagep,
                                    void **fsdata)
 {
-       int ret, inline_size;
+       int ret;
        handle_t *handle;
        struct page *page;
        struct ext4_iloc iloc;
@@ -928,14 +928,9 @@ retry_journal:
                goto out;
        }
 
-       inline_size = ext4_get_max_inline_size(inode);
-
-       ret = -ENOSPC;
-       if (inline_size >= pos + len) {
-               ret = ext4_prepare_inline_data(handle, inode, pos + len);
-               if (ret && ret != -ENOSPC)
-                       goto out_journal;
-       }
+       ret = ext4_prepare_inline_data(handle, inode, pos + len);
+       if (ret && ret != -ENOSPC)
+               goto out_journal;
 
        /*
         * We cannot recurse into the filesystem as the transaction
@@ -1133,7 +1128,15 @@ static void ext4_restore_inline_data(handle_t *handle, struct inode *inode,
                                     struct ext4_iloc *iloc,
                                     void *buf, int inline_size)
 {
-       ext4_create_inline_data(handle, inode, inline_size);
+       int ret;
+
+       ret = ext4_create_inline_data(handle, inode, inline_size);
+       if (ret) {
+               ext4_msg(inode->i_sb, KERN_EMERG,
+                       "error restoring inline_data for inode -- potential data loss! (inode %lu, error %d)",
+                       inode->i_ino, ret);
+               return;
+       }
        ext4_write_inline_data(inode, iloc, buf, 0, inline_size);
        ext4_set_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA);
 }
index 5f79d26..01c9e4f 100644 (file)
@@ -338,7 +338,7 @@ stop_handle:
        return;
 no_delete:
        if (!list_empty(&EXT4_I(inode)->i_fc_list))
-               ext4_fc_mark_ineligible(inode->i_sb, EXT4_FC_REASON_NOMEM);
+               ext4_fc_mark_ineligible(inode->i_sb, EXT4_FC_REASON_NOMEM, NULL);
        ext4_clear_inode(inode);        /* We must guarantee clearing of inode... */
 }
 
@@ -1224,7 +1224,7 @@ retry_journal:
                /*
                 * __block_write_begin may have instantiated a few blocks
                 * outside i_size.  Trim these off again. Don't need
-                * i_size_read because we hold i_mutex.
+                * i_size_read because we hold i_rwsem.
                 *
                 * Add inode to orphan list in case we crash before
                 * truncate finishes
@@ -3979,7 +3979,7 @@ int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length)
 
        }
 
-       /* Wait all existing dio workers, newcomers will block on i_mutex */
+       /* Wait all existing dio workers, newcomers will block on i_rwsem */
        inode_dio_wait(inode);
 
        /*
@@ -4129,7 +4129,7 @@ int ext4_truncate(struct inode *inode)
        /*
         * There is a possibility that we're either freeing the inode
         * or it's a completely new inode. In those cases we might not
-        * have i_mutex locked because it's not necessary.
+        * have i_rwsem locked because it's not necessary.
         */
        if (!(inode->i_state & (I_NEW|I_FREEING)))
                WARN_ON(!inode_is_locked(inode));
@@ -5271,7 +5271,7 @@ static void ext4_wait_for_tail_page_commit(struct inode *inode)
  * transaction are already on disk (truncate waits for pages under
  * writeback).
  *
- * Called with inode->i_mutex down.
+ * Called with inode->i_rwsem down.
  */
 int ext4_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
                 struct iattr *attr)
@@ -5983,7 +5983,7 @@ int ext4_change_inode_journal_flag(struct inode *inode, int val)
                return PTR_ERR(handle);
 
        ext4_fc_mark_ineligible(inode->i_sb,
-               EXT4_FC_REASON_JOURNAL_FLAG_CHANGE);
+               EXT4_FC_REASON_JOURNAL_FLAG_CHANGE, handle);
        err = ext4_mark_inode_dirty(handle, inode);
        ext4_handle_sync(handle);
        ext4_journal_stop(handle);
index bbbedf2..a8022c2 100644 (file)
@@ -411,7 +411,7 @@ static long swap_inode_boot_loader(struct super_block *sb,
                err = -EINVAL;
                goto err_out;
        }
-       ext4_fc_mark_ineligible(sb, EXT4_FC_REASON_SWAP_BOOT);
+       ext4_fc_mark_ineligible(sb, EXT4_FC_REASON_SWAP_BOOT, handle);
 
        /* Protect extent tree against block allocations via delalloc */
        ext4_double_down_write_data_sem(inode, inode_bl);
@@ -1373,7 +1373,7 @@ mext_out:
 
                err = ext4_resize_fs(sb, n_blocks_count);
                if (EXT4_SB(sb)->s_journal) {
-                       ext4_fc_mark_ineligible(sb, EXT4_FC_REASON_RESIZE);
+                       ext4_fc_mark_ineligible(sb, EXT4_FC_REASON_RESIZE, NULL);
                        jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal);
                        err2 = jbd2_journal_flush(EXT4_SB(sb)->s_journal, 0);
                        jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal);
index 9f86dd9..67ac95c 100644 (file)
@@ -5753,7 +5753,8 @@ static ext4_fsblk_t ext4_mb_new_blocks_simple(handle_t *handle,
        struct super_block *sb = ar->inode->i_sb;
        ext4_group_t group;
        ext4_grpblk_t blkoff;
-       int i = sb->s_blocksize;
+       ext4_grpblk_t max = EXT4_CLUSTERS_PER_GROUP(sb);
+       ext4_grpblk_t i = 0;
        ext4_fsblk_t goal, block;
        struct ext4_super_block *es = EXT4_SB(sb)->s_es;
 
@@ -5775,19 +5776,26 @@ static ext4_fsblk_t ext4_mb_new_blocks_simple(handle_t *handle,
                ext4_get_group_no_and_offset(sb,
                        max(ext4_group_first_block_no(sb, group), goal),
                        NULL, &blkoff);
-               i = mb_find_next_zero_bit(bitmap_bh->b_data, sb->s_blocksize,
+               while (1) {
+                       i = mb_find_next_zero_bit(bitmap_bh->b_data, max,
                                                blkoff);
+                       if (i >= max)
+                               break;
+                       if (ext4_fc_replay_check_excluded(sb,
+                               ext4_group_first_block_no(sb, group) + i)) {
+                               blkoff = i + 1;
+                       } else
+                               break;
+               }
                brelse(bitmap_bh);
-               if (i >= sb->s_blocksize)
-                       continue;
-               if (ext4_fc_replay_check_excluded(sb,
-                       ext4_group_first_block_no(sb, group) + i))
-                       continue;
-               break;
+               if (i < max)
+                       break;
        }
 
-       if (group >= ext4_get_groups_count(sb) && i >= sb->s_blocksize)
+       if (group >= ext4_get_groups_count(sb) || i >= max) {
+               *errp = -ENOSPC;
                return 0;
+       }
 
        block = ext4_group_first_block_no(sb, group) + i;
        ext4_mb_mark_bb(sb, block, 1, 1);
index ff8916e..7a5353a 100644 (file)
@@ -485,7 +485,7 @@ int ext4_ext_migrate(struct inode *inode)
         * when we add extents we extent the journal
         */
        /*
-        * Even though we take i_mutex we can still cause block
+        * Even though we take i_rwsem we can still cause block
         * allocation via mmap write to holes. If we have allocated
         * new blocks we fail migrate.  New block allocation will
         * clear EXT4_STATE_EXT_MIGRATE flag.  The flag is updated
index 52c9bd1..8cf0a92 100644 (file)
@@ -1317,7 +1317,7 @@ static void dx_insert_block(struct dx_frame *frame, u32 hash, ext4_lblk_t block)
        dx_set_count(entries, count + 1);
 }
 
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
 /*
  * Test whether a case-insensitive directory entry matches the filename
  * being searched for.  If quick is set, assume the name being looked up
@@ -1428,7 +1428,7 @@ static bool ext4_match(struct inode *parent,
        f.crypto_buf = fname->crypto_buf;
 #endif
 
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        if (parent->i_sb->s_encoding && IS_CASEFOLDED(parent) &&
            (!IS_ENCRYPTED(parent) || fscrypt_has_encryption_key(parent))) {
                if (fname->cf_name.name) {
@@ -1800,7 +1800,7 @@ static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, unsi
                }
        }
 
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        if (!inode && IS_CASEFOLDED(dir)) {
                /* Eventually we want to call d_add_ci(dentry, NULL)
                 * for negative dentries in the encoding case as
@@ -2308,7 +2308,7 @@ static int ext4_add_entry(handle_t *handle, struct dentry *dentry,
        if (fscrypt_is_nokey_name(dentry))
                return -ENOKEY;
 
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        if (sb_has_strict_encoding(sb) && IS_CASEFOLDED(dir) &&
            sb->s_encoding && utf8_validate(sb->s_encoding, &dentry->d_name))
                return -EINVAL;
@@ -3126,7 +3126,7 @@ static int ext4_rmdir(struct inode *dir, struct dentry *dentry)
        ext4_fc_track_unlink(handle, dentry);
        retval = ext4_mark_inode_dirty(handle, dir);
 
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        /* VFS negative dentries are incompatible with Encoding and
         * Case-insensitiveness. Eventually we'll want avoid
         * invalidating the dentries here, alongside with returning the
@@ -3231,7 +3231,7 @@ static int ext4_unlink(struct inode *dir, struct dentry *dentry)
        retval = __ext4_unlink(handle, dir, &dentry->d_name, d_inode(dentry));
        if (!retval)
                ext4_fc_track_unlink(handle, dentry);
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        /* VFS negative dentries are incompatible with Encoding and
         * Case-insensitiveness. Eventually we'll want avoid
         * invalidating the dentries here, alongside with returning the
@@ -3889,7 +3889,7 @@ static int ext4_rename(struct user_namespace *mnt_userns, struct inode *old_dir,
                 * dirents in directories.
                 */
                ext4_fc_mark_ineligible(old.inode->i_sb,
-                       EXT4_FC_REASON_RENAME_DIR);
+                       EXT4_FC_REASON_RENAME_DIR, handle);
        } else {
                if (new.inode)
                        ext4_fc_track_unlink(handle, new.dentry);
@@ -4049,7 +4049,7 @@ static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry,
        if (unlikely(retval))
                goto end_rename;
        ext4_fc_mark_ineligible(new.inode->i_sb,
-                               EXT4_FC_REASON_CROSS_RENAME);
+                               EXT4_FC_REASON_CROSS_RENAME, handle);
        if (old.dir_bh) {
                retval = ext4_rename_dir_finish(handle, &old, new.dir->i_ino);
                if (retval)
index 53adc8f..7de0612 100644 (file)
@@ -93,7 +93,7 @@ static int ext4_orphan_file_add(handle_t *handle, struct inode *inode)
  * At filesystem recovery time, we walk this list deleting unlinked
  * inodes and truncating linked inodes in ext4_orphan_cleanup().
  *
- * Orphan list manipulation functions must be called under i_mutex unless
+ * Orphan list manipulation functions must be called under i_rwsem unless
  * we are just creating the inode or deleting it.
  */
 int ext4_orphan_add(handle_t *handle, struct inode *inode)
@@ -119,7 +119,7 @@ int ext4_orphan_add(handle_t *handle, struct inode *inode)
        /*
         * Orphan handling is only valid for files with data blocks
         * being truncated, or files being unlinked. Note that we either
-        * hold i_mutex, or the inode can not be referenced from outside,
+        * hold i_rwsem, or the inode can not be referenced from outside,
         * so i_nlink should not be bumped due to race
         */
        ASSERT((S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
index eee0d9e..c5021ca 100644 (file)
@@ -1301,7 +1301,7 @@ static void ext4_put_super(struct super_block *sb)
        kfree(sbi->s_blockgroup_lock);
        fs_put_dax(sbi->s_daxdev);
        fscrypt_free_dummy_policy(&sbi->s_dummy_enc_policy);
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        utf8_unload(sb->s_encoding);
 #endif
        kfree(sbi);
@@ -1961,7 +1961,7 @@ static const struct mount_opts {
        {Opt_err, 0, 0}
 };
 
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
 static const struct ext4_sb_encodings {
        __u16 magic;
        char *name;
@@ -3606,7 +3606,7 @@ int ext4_feature_set_ok(struct super_block *sb, int readonly)
                return 0;
        }
 
-#ifndef CONFIG_UNICODE
+#if !IS_ENABLED(CONFIG_UNICODE)
        if (ext4_has_feature_casefold(sb)) {
                ext4_msg(sb, KERN_ERR,
                         "Filesystem with casefold feature cannot be "
@@ -4610,7 +4610,7 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
        if (err < 0)
                goto failed_mount;
 
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        if (ext4_has_feature_casefold(sb) && !sb->s_encoding) {
                const struct ext4_sb_encodings *encoding_info;
                struct unicode_map *encoding;
@@ -5082,7 +5082,7 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
        INIT_LIST_HEAD(&sbi->s_fc_dentry_q[FC_Q_STAGING]);
        sbi->s_fc_bytes = 0;
        ext4_clear_mount_flag(sb, EXT4_MF_FC_INELIGIBLE);
-       ext4_clear_mount_flag(sb, EXT4_MF_FC_COMMITTING);
+       sbi->s_fc_ineligible_tid = 0;
        spin_lock_init(&sbi->s_fc_lock);
        memset(&sbi->s_fc_stats, 0, sizeof(sbi->s_fc_stats));
        sbi->s_fc_replay_state.fc_regions = NULL;
@@ -5514,7 +5514,7 @@ failed_mount:
        if (sbi->s_chksum_driver)
                crypto_free_shash(sbi->s_chksum_driver);
 
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        utf8_unload(sb->s_encoding);
 #endif
 
@@ -5540,7 +5540,7 @@ static int ext4_fill_super(struct super_block *sb, struct fs_context *fc)
 
        sbi = ext4_alloc_sbi(sb);
        if (!sbi)
-               ret = -ENOMEM;
+               return -ENOMEM;
 
        fc->s_fs_info = sbi;
 
index f61e65a..d233c24 100644 (file)
@@ -309,7 +309,7 @@ EXT4_ATTR_FEATURE(meta_bg_resize);
 EXT4_ATTR_FEATURE(encryption);
 EXT4_ATTR_FEATURE(test_dummy_encryption_v2);
 #endif
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
 EXT4_ATTR_FEATURE(casefold);
 #endif
 #ifdef CONFIG_FS_VERITY
@@ -317,7 +317,7 @@ EXT4_ATTR_FEATURE(verity);
 #endif
 EXT4_ATTR_FEATURE(metadata_csum_seed);
 EXT4_ATTR_FEATURE(fast_commit);
-#if defined(CONFIG_UNICODE) && defined(CONFIG_FS_ENCRYPTION)
+#if IS_ENABLED(CONFIG_UNICODE) && defined(CONFIG_FS_ENCRYPTION)
 EXT4_ATTR_FEATURE(encrypted_casefold);
 #endif
 
@@ -329,7 +329,7 @@ static struct attribute *ext4_feat_attrs[] = {
        ATTR_LIST(encryption),
        ATTR_LIST(test_dummy_encryption_v2),
 #endif
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        ATTR_LIST(casefold),
 #endif
 #ifdef CONFIG_FS_VERITY
@@ -337,7 +337,7 @@ static struct attribute *ext4_feat_attrs[] = {
 #endif
        ATTR_LIST(metadata_csum_seed),
        ATTR_LIST(fast_commit),
-#if defined(CONFIG_UNICODE) && defined(CONFIG_FS_ENCRYPTION)
+#if IS_ENABLED(CONFIG_UNICODE) && defined(CONFIG_FS_ENCRYPTION)
        ATTR_LIST(encrypted_casefold),
 #endif
        NULL,
index 1e0fc1e..0423253 100644 (file)
@@ -2408,7 +2408,7 @@ retry_inode:
                if (IS_SYNC(inode))
                        ext4_handle_sync(handle);
        }
-       ext4_fc_mark_ineligible(inode->i_sb, EXT4_FC_REASON_XATTR);
+       ext4_fc_mark_ineligible(inode->i_sb, EXT4_FC_REASON_XATTR, handle);
 
 cleanup:
        brelse(is.iloc.bh);
@@ -2486,7 +2486,7 @@ retry:
                if (error == 0)
                        error = error2;
        }
-       ext4_fc_mark_ineligible(inode->i_sb, EXT4_FC_REASON_XATTR);
+       ext4_fc_mark_ineligible(inode->i_sb, EXT4_FC_REASON_XATTR, NULL);
 
        return error;
 }
@@ -2920,7 +2920,7 @@ int ext4_xattr_delete_inode(handle_t *handle, struct inode *inode,
                                         error);
                        goto cleanup;
                }
-               ext4_fc_mark_ineligible(inode->i_sb, EXT4_FC_REASON_XATTR);
+               ext4_fc_mark_ineligible(inode->i_sb, EXT4_FC_REASON_XATTR, handle);
        }
        error = 0;
 cleanup:
index 1820e9c..166f086 100644 (file)
@@ -16,7 +16,7 @@
 #include "xattr.h"
 #include <trace/events/f2fs.h>
 
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
 extern struct kmem_cache *f2fs_cf_name_slab;
 #endif
 
@@ -79,7 +79,7 @@ unsigned char f2fs_get_de_type(struct f2fs_dir_entry *de)
 int f2fs_init_casefolded_name(const struct inode *dir,
                              struct f2fs_filename *fname)
 {
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        struct super_block *sb = dir->i_sb;
 
        if (IS_CASEFOLDED(dir)) {
@@ -174,7 +174,7 @@ void f2fs_free_filename(struct f2fs_filename *fname)
        kfree(fname->crypto_buf.name);
        fname->crypto_buf.name = NULL;
 #endif
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        if (fname->cf_name.name) {
                kmem_cache_free(f2fs_cf_name_slab, fname->cf_name.name);
                fname->cf_name.name = NULL;
@@ -208,7 +208,7 @@ static struct f2fs_dir_entry *find_in_block(struct inode *dir,
        return f2fs_find_target_dentry(&d, fname, max_slots);
 }
 
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
 /*
  * Test whether a case-insensitive directory entry matches the filename
  * being searched for.
@@ -266,7 +266,7 @@ static inline int f2fs_match_name(const struct inode *dir,
 {
        struct fscrypt_name f;
 
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        if (fname->cf_name.name) {
                struct qstr cf = FSTR_TO_QSTR(&fname->cf_name);
 
index eb22fa9..68b4401 100644 (file)
@@ -488,7 +488,7 @@ struct f2fs_filename {
         */
        struct fscrypt_str crypto_buf;
 #endif
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        /*
         * For casefolded directories: the casefolded name, but it's left NULL
         * if the original name is not valid Unicode, if the directory is both
index e3beac5..3cb1e7a 100644 (file)
@@ -105,7 +105,7 @@ void f2fs_hash_filename(const struct inode *dir, struct f2fs_filename *fname)
                return;
        }
 
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        if (IS_CASEFOLDED(dir)) {
                /*
                 * If the casefolded name is provided, hash it instead of the
index a728a0a..5f213f0 100644 (file)
@@ -561,7 +561,7 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry,
                goto out_iput;
        }
 out_splice:
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        if (!inode && IS_CASEFOLDED(dir)) {
                /* Eventually we want to call d_add_ci(dentry, NULL)
                 * for negative dentries in the encoding case as
@@ -622,7 +622,7 @@ static int f2fs_unlink(struct inode *dir, struct dentry *dentry)
                goto fail;
        }
        f2fs_delete_entry(de, page, dir, inode);
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        /* VFS negative dentries are incompatible with Encoding and
         * Case-insensitiveness. Eventually we'll want avoid
         * invalidating the dentries here, alongside with returning the
index 9683c80..79773d3 100644 (file)
@@ -46,7 +46,7 @@
 
 static struct kmem_cache *fsync_entry_slab;
 
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
 extern struct kmem_cache *f2fs_cf_name_slab;
 #endif
 
@@ -149,7 +149,7 @@ static int init_recovered_filename(const struct inode *dir,
                if (err)
                        return err;
                f2fs_hash_filename(dir, fname);
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
                /* Case-sensitive match is fine for recovery */
                kmem_cache_free(f2fs_cf_name_slab, fname->cf_name.name);
                fname->cf_name.name = NULL;
index 76e6a3d..baefd39 100644 (file)
@@ -257,7 +257,7 @@ void f2fs_printk(struct f2fs_sb_info *sbi, const char *fmt, ...)
        va_end(args);
 }
 
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
 static const struct f2fs_sb_encodings {
        __u16 magic;
        char *name;
@@ -1259,7 +1259,7 @@ default_check:
                return -EINVAL;
        }
 #endif
-#ifndef CONFIG_UNICODE
+#if !IS_ENABLED(CONFIG_UNICODE)
        if (f2fs_sb_has_casefold(sbi)) {
                f2fs_err(sbi,
                        "Filesystem with casefold feature cannot be mounted without CONFIG_UNICODE");
@@ -1619,7 +1619,7 @@ static void f2fs_put_super(struct super_block *sb)
        f2fs_destroy_iostat(sbi);
        for (i = 0; i < NR_PAGE_TYPE; i++)
                kvfree(sbi->write_io[i]);
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        utf8_unload(sb->s_encoding);
 #endif
        kfree(sbi);
@@ -3903,7 +3903,7 @@ static int f2fs_scan_devices(struct f2fs_sb_info *sbi)
 
 static int f2fs_setup_casefold(struct f2fs_sb_info *sbi)
 {
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        if (f2fs_sb_has_casefold(sbi) && !sbi->sb->s_encoding) {
                const struct f2fs_sb_encodings *encoding_info;
                struct unicode_map *encoding;
@@ -4458,7 +4458,7 @@ free_bio_info:
        for (i = 0; i < NR_PAGE_TYPE; i++)
                kvfree(sbi->write_io[i]);
 
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        utf8_unload(sb->s_encoding);
        sb->s_encoding = NULL;
 #endif
index df406c1..8ac5066 100644 (file)
@@ -201,7 +201,7 @@ static ssize_t unusable_show(struct f2fs_attr *a,
 static ssize_t encoding_show(struct f2fs_attr *a,
                struct f2fs_sb_info *sbi, char *buf)
 {
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        struct super_block *sb = sbi->sb;
 
        if (f2fs_sb_has_casefold(sbi))
@@ -778,7 +778,7 @@ F2FS_GENERAL_RO_ATTR(avg_vblocks);
 #ifdef CONFIG_FS_ENCRYPTION
 F2FS_FEATURE_RO_ATTR(encryption);
 F2FS_FEATURE_RO_ATTR(test_dummy_encryption_v2);
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
 F2FS_FEATURE_RO_ATTR(encrypted_casefold);
 #endif
 #endif /* CONFIG_FS_ENCRYPTION */
@@ -797,7 +797,7 @@ F2FS_FEATURE_RO_ATTR(lost_found);
 F2FS_FEATURE_RO_ATTR(verity);
 #endif
 F2FS_FEATURE_RO_ATTR(sb_checksum);
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
 F2FS_FEATURE_RO_ATTR(casefold);
 #endif
 F2FS_FEATURE_RO_ATTR(readonly);
@@ -910,7 +910,7 @@ static struct attribute *f2fs_feat_attrs[] = {
 #ifdef CONFIG_FS_ENCRYPTION
        ATTR_LIST(encryption),
        ATTR_LIST(test_dummy_encryption_v2),
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        ATTR_LIST(encrypted_casefold),
 #endif
 #endif /* CONFIG_FS_ENCRYPTION */
@@ -929,7 +929,7 @@ static struct attribute *f2fs_feat_attrs[] = {
        ATTR_LIST(verity),
 #endif
        ATTR_LIST(sb_checksum),
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        ATTR_LIST(casefold),
 #endif
        ATTR_LIST(readonly),
index e54c412..2e04f71 100644 (file)
@@ -7822,10 +7822,15 @@ static __cold void io_rsrc_node_ref_zero(struct percpu_ref *ref)
        struct io_ring_ctx *ctx = node->rsrc_data->ctx;
        unsigned long flags;
        bool first_add = false;
+       unsigned long delay = HZ;
 
        spin_lock_irqsave(&ctx->rsrc_ref_lock, flags);
        node->done = true;
 
+       /* if we are mid-quiesce then do not delay */
+       if (node->rsrc_data->quiesce)
+               delay = 0;
+
        while (!list_empty(&ctx->rsrc_ref_list)) {
                node = list_first_entry(&ctx->rsrc_ref_list,
                                            struct io_rsrc_node, node);
@@ -7838,10 +7843,10 @@ static __cold void io_rsrc_node_ref_zero(struct percpu_ref *ref)
        spin_unlock_irqrestore(&ctx->rsrc_ref_lock, flags);
 
        if (first_add)
-               mod_delayed_work(system_wq, &ctx->rsrc_put_work, HZ);
+               mod_delayed_work(system_wq, &ctx->rsrc_put_work, delay);
 }
 
-static struct io_rsrc_node *io_rsrc_node_alloc(struct io_ring_ctx *ctx)
+static struct io_rsrc_node *io_rsrc_node_alloc(void)
 {
        struct io_rsrc_node *ref_node;
 
@@ -7892,7 +7897,7 @@ static int io_rsrc_node_switch_start(struct io_ring_ctx *ctx)
 {
        if (ctx->rsrc_backup_node)
                return 0;
-       ctx->rsrc_backup_node = io_rsrc_node_alloc(ctx);
+       ctx->rsrc_backup_node = io_rsrc_node_alloc();
        return ctx->rsrc_backup_node ? 0 : -ENOMEM;
 }
 
index c938bba..6c51a75 100644 (file)
@@ -21,6 +21,8 @@
 
 #include "../internal.h"
 
+#define IOEND_BATCH_SIZE       4096
+
 /*
  * Structure allocated for each folio when block size < folio size
  * to track sub-folio uptodate status and I/O completions.
@@ -1039,7 +1041,7 @@ static void iomap_finish_folio_write(struct inode *inode, struct folio *folio,
  * state, release holds on bios, and finally free up memory.  Do not use the
  * ioend after this.
  */
-static void
+static u32
 iomap_finish_ioend(struct iomap_ioend *ioend, int error)
 {
        struct inode *inode = ioend->io_inode;
@@ -1048,6 +1050,7 @@ iomap_finish_ioend(struct iomap_ioend *ioend, int error)
        u64 start = bio->bi_iter.bi_sector;
        loff_t offset = ioend->io_offset;
        bool quiet = bio_flagged(bio, BIO_QUIET);
+       u32 folio_count = 0;
 
        for (bio = &ioend->io_inline_bio; bio; bio = next) {
                struct folio_iter fi;
@@ -1062,9 +1065,11 @@ iomap_finish_ioend(struct iomap_ioend *ioend, int error)
                        next = bio->bi_private;
 
                /* walk all folios in bio, ending page IO on them */
-               bio_for_each_folio_all(fi, bio)
+               bio_for_each_folio_all(fi, bio) {
                        iomap_finish_folio_write(inode, fi.folio, fi.length,
                                        error);
+                       folio_count++;
+               }
                bio_put(bio);
        }
        /* The ioend has been freed by bio_put() */
@@ -1074,20 +1079,36 @@ iomap_finish_ioend(struct iomap_ioend *ioend, int error)
 "%s: writeback error on inode %lu, offset %lld, sector %llu",
                        inode->i_sb->s_id, inode->i_ino, offset, start);
        }
+       return folio_count;
 }
 
+/*
+ * Ioend completion routine for merged bios. This can only be called from task
+ * contexts as merged ioends can be of unbound length. Hence we have to break up
+ * the writeback completions into manageable chunks to avoid long scheduler
+ * holdoffs. We aim to keep scheduler holdoffs down below 10ms so that we get
+ * good batch processing throughput without creating adverse scheduler latency
+ * conditions.
+ */
 void
 iomap_finish_ioends(struct iomap_ioend *ioend, int error)
 {
        struct list_head tmp;
+       u32 completions;
+
+       might_sleep();
 
        list_replace_init(&ioend->io_list, &tmp);
-       iomap_finish_ioend(ioend, error);
+       completions = iomap_finish_ioend(ioend, error);
 
        while (!list_empty(&tmp)) {
+               if (completions > IOEND_BATCH_SIZE * 8) {
+                       cond_resched();
+                       completions = 0;
+               }
                ioend = list_first_entry(&tmp, struct iomap_ioend, io_list);
                list_del_init(&ioend->io_list);
-               iomap_finish_ioend(ioend, error);
+               completions += iomap_finish_ioend(ioend, error);
        }
 }
 EXPORT_SYMBOL_GPL(iomap_finish_ioends);
@@ -1108,6 +1129,18 @@ iomap_ioend_can_merge(struct iomap_ioend *ioend, struct iomap_ioend *next)
                return false;
        if (ioend->io_offset + ioend->io_size != next->io_offset)
                return false;
+       /*
+        * Do not merge physically discontiguous ioends. The filesystem
+        * completion functions will have to iterate the physical
+        * discontiguities even if we merge the ioends at a logical level, so
+        * we don't gain anything by merging physical discontiguities here.
+        *
+        * We cannot use bio->bi_iter.bi_sector here as it is modified during
+        * submission so does not point to the start sector of the bio at
+        * completion.
+        */
+       if (ioend->io_sector + (ioend->io_size >> 9) != next->io_sector)
+               return false;
        return true;
 }
 
@@ -1209,8 +1242,10 @@ iomap_alloc_ioend(struct inode *inode, struct iomap_writepage_ctx *wpc,
        ioend->io_flags = wpc->iomap.flags;
        ioend->io_inode = inode;
        ioend->io_size = 0;
+       ioend->io_folios = 0;
        ioend->io_offset = offset;
        ioend->io_bio = bio;
+       ioend->io_sector = sector;
        return ioend;
 }
 
@@ -1251,6 +1286,13 @@ iomap_can_add_to_ioend(struct iomap_writepage_ctx *wpc, loff_t offset,
                return false;
        if (sector != bio_end_sector(wpc->ioend->io_bio))
                return false;
+       /*
+        * Limit ioend bio chain lengths to minimise IO completion latency. This
+        * also prevents long tight loops ending page writeback on all the
+        * folios in the ioend.
+        */
+       if (wpc->ioend->io_folios >= IOEND_BATCH_SIZE)
+               return false;
        return true;
 }
 
@@ -1335,6 +1377,8 @@ iomap_writepage_map(struct iomap_writepage_ctx *wpc,
                                 &submit_list);
                count++;
        }
+       if (count)
+               wpc->ioend->io_folios++;
 
        WARN_ON_ONCE(!wpc->ioend && !list_empty(&submit_list));
        WARN_ON_ONCE(!folio_test_locked(folio));
index 3cc4ab2..5b9408e 100644 (file)
@@ -484,22 +484,9 @@ void jbd2_journal_commit_transaction(journal_t *journal)
        stats.run.rs_running = jbd2_time_diff(commit_transaction->t_start,
                                              stats.run.rs_locked);
 
-       spin_lock(&commit_transaction->t_handle_lock);
-       while (atomic_read(&commit_transaction->t_updates)) {
-               DEFINE_WAIT(wait);
+       // waits for any t_updates to finish
+       jbd2_journal_wait_updates(journal);
 
-               prepare_to_wait(&journal->j_wait_updates, &wait,
-                                       TASK_UNINTERRUPTIBLE);
-               if (atomic_read(&commit_transaction->t_updates)) {
-                       spin_unlock(&commit_transaction->t_handle_lock);
-                       write_unlock(&journal->j_state_lock);
-                       schedule();
-                       write_lock(&journal->j_state_lock);
-                       spin_lock(&commit_transaction->t_handle_lock);
-               }
-               finish_wait(&journal->j_wait_updates, &wait);
-       }
-       spin_unlock(&commit_transaction->t_handle_lock);
        commit_transaction->t_state = T_SWITCH;
        write_unlock(&journal->j_state_lock);
 
@@ -817,7 +804,7 @@ start_journal_io:
        commit_transaction->t_state = T_COMMIT_DFLUSH;
        write_unlock(&journal->j_state_lock);
 
-       /* 
+       /*
         * If the journal is not located on the file system device,
         * then we must flush the file system device before we issue
         * the commit record
@@ -1170,7 +1157,7 @@ restart_loop:
        if (journal->j_commit_callback)
                journal->j_commit_callback(journal, commit_transaction);
        if (journal->j_fc_cleanup_callback)
-               journal->j_fc_cleanup_callback(journal, 1);
+               journal->j_fc_cleanup_callback(journal, 1, commit_transaction->t_tid);
 
        trace_jbd2_end_commit(journal, commit_transaction);
        jbd_debug(1, "JBD2: commit %d complete, head %d\n",
index f13d548..c2cf74b 100644 (file)
@@ -771,7 +771,7 @@ static int __jbd2_fc_end_commit(journal_t *journal, tid_t tid, bool fallback)
 {
        jbd2_journal_unlock_updates(journal);
        if (journal->j_fc_cleanup_callback)
-               journal->j_fc_cleanup_callback(journal, 0);
+               journal->j_fc_cleanup_callback(journal, 0, tid);
        write_lock(&journal->j_state_lock);
        journal->j_flags &= ~JBD2_FAST_COMMIT_ONGOING;
        if (fallback)
@@ -1287,6 +1287,8 @@ static int jbd2_min_tag_size(void)
 
 /**
  * jbd2_journal_shrink_scan()
+ * @shrink: shrinker to work on
+ * @sc: reclaim request to process
  *
  * Scan the checkpointed buffer on the checkpoint list and release the
  * journal_head.
@@ -1312,6 +1314,8 @@ static unsigned long jbd2_journal_shrink_scan(struct shrinker *shrink,
 
 /**
  * jbd2_journal_shrink_count()
+ * @shrink: shrinker to work on
+ * @sc: reclaim request to process
  *
  * Count the number of checkpoint buffers on the checkpoint list.
  */
@@ -2972,6 +2976,7 @@ struct journal_head *jbd2_journal_grab_journal_head(struct buffer_head *bh)
        jbd_unlock_bh_journal_head(bh);
        return jh;
 }
+EXPORT_SYMBOL(jbd2_journal_grab_journal_head);
 
 static void __journal_remove_journal_head(struct buffer_head *bh)
 {
@@ -3024,6 +3029,7 @@ void jbd2_journal_put_journal_head(struct journal_head *jh)
                jbd_unlock_bh_journal_head(bh);
        }
 }
+EXPORT_SYMBOL(jbd2_journal_put_journal_head);
 
 /*
  * Initialize jbd inode head
index 6a3caed..8e2f827 100644 (file)
@@ -449,7 +449,7 @@ repeat:
        }
 
        /* OK, account for the buffers that this operation expects to
-        * use and add the handle to the running transaction. 
+        * use and add the handle to the running transaction.
         */
        update_t_max_wait(transaction, ts);
        handle->h_transaction = transaction;
@@ -836,6 +836,35 @@ int jbd2_journal_restart(handle_t *handle, int nblocks)
 }
 EXPORT_SYMBOL(jbd2_journal_restart);
 
+/*
+ * Waits for any outstanding t_updates to finish.
+ * This is called with write j_state_lock held.
+ */
+void jbd2_journal_wait_updates(journal_t *journal)
+{
+       transaction_t *commit_transaction = journal->j_running_transaction;
+
+       if (!commit_transaction)
+               return;
+
+       spin_lock(&commit_transaction->t_handle_lock);
+       while (atomic_read(&commit_transaction->t_updates)) {
+               DEFINE_WAIT(wait);
+
+               prepare_to_wait(&journal->j_wait_updates, &wait,
+                                       TASK_UNINTERRUPTIBLE);
+               if (atomic_read(&commit_transaction->t_updates)) {
+                       spin_unlock(&commit_transaction->t_handle_lock);
+                       write_unlock(&journal->j_state_lock);
+                       schedule();
+                       write_lock(&journal->j_state_lock);
+                       spin_lock(&commit_transaction->t_handle_lock);
+               }
+               finish_wait(&journal->j_wait_updates, &wait);
+       }
+       spin_unlock(&commit_transaction->t_handle_lock);
+}
+
 /**
  * jbd2_journal_lock_updates () - establish a transaction barrier.
  * @journal:  Journal to establish a barrier on.
@@ -863,27 +892,9 @@ void jbd2_journal_lock_updates(journal_t *journal)
                write_lock(&journal->j_state_lock);
        }
 
-       /* Wait until there are no running updates */
-       while (1) {
-               transaction_t *transaction = journal->j_running_transaction;
-
-               if (!transaction)
-                       break;
+       /* Wait until there are no running t_updates */
+       jbd2_journal_wait_updates(journal);
 
-               spin_lock(&transaction->t_handle_lock);
-               prepare_to_wait(&journal->j_wait_updates, &wait,
-                               TASK_UNINTERRUPTIBLE);
-               if (!atomic_read(&transaction->t_updates)) {
-                       spin_unlock(&transaction->t_handle_lock);
-                       finish_wait(&journal->j_wait_updates, &wait);
-                       break;
-               }
-               spin_unlock(&transaction->t_handle_lock);
-               write_unlock(&journal->j_state_lock);
-               schedule();
-               finish_wait(&journal->j_wait_updates, &wait);
-               write_lock(&journal->j_state_lock);
-       }
        write_unlock(&journal->j_state_lock);
 
        /*
index ba7438a..9741252 100644 (file)
@@ -1379,7 +1379,7 @@ bool is_empty_dir_inode(struct inode *inode)
                (inode->i_op == &empty_dir_inode_operations);
 }
 
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
 /*
  * Determine if the name of a dentry should be casefolded.
  *
@@ -1473,7 +1473,7 @@ static const struct dentry_operations generic_encrypted_dentry_ops = {
 };
 #endif
 
-#if defined(CONFIG_FS_ENCRYPTION) && defined(CONFIG_UNICODE)
+#if defined(CONFIG_FS_ENCRYPTION) && IS_ENABLED(CONFIG_UNICODE)
 static const struct dentry_operations generic_encrypted_ci_dentry_ops = {
        .d_hash = generic_ci_d_hash,
        .d_compare = generic_ci_d_compare,
@@ -1508,10 +1508,10 @@ void generic_set_encrypted_ci_d_ops(struct dentry *dentry)
 #ifdef CONFIG_FS_ENCRYPTION
        bool needs_encrypt_ops = dentry->d_flags & DCACHE_NOKEY_NAME;
 #endif
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        bool needs_ci_ops = dentry->d_sb->s_encoding;
 #endif
-#if defined(CONFIG_FS_ENCRYPTION) && defined(CONFIG_UNICODE)
+#if defined(CONFIG_FS_ENCRYPTION) && IS_ENABLED(CONFIG_UNICODE)
        if (needs_encrypt_ops && needs_ci_ops) {
                d_set_d_op(dentry, &generic_encrypted_ci_dentry_ops);
                return;
@@ -1523,7 +1523,7 @@ void generic_set_encrypted_ci_d_ops(struct dentry *dentry)
                return;
        }
 #endif
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        if (needs_ci_ops) {
                d_set_d_op(dentry, &generic_ci_dentry_ops);
                return;
index cb3a751..0a22a2f 100644 (file)
@@ -179,19 +179,21 @@ nlm_delete_file(struct nlm_file *file)
 static int nlm_unlock_files(struct nlm_file *file)
 {
        struct file_lock lock;
-       struct file *f;
 
+       locks_init_lock(&lock);
        lock.fl_type  = F_UNLCK;
        lock.fl_start = 0;
        lock.fl_end   = OFFSET_MAX;
-       for (f = file->f_file[0]; f <= file->f_file[1]; f++) {
-               if (f && vfs_lock_file(f, F_SETLK, &lock, NULL) < 0) {
-                       pr_warn("lockd: unlock failure in %s:%d\n",
-                               __FILE__, __LINE__);
-                       return 1;
-               }
-       }
+       if (file->f_file[O_RDONLY] &&
+           vfs_lock_file(file->f_file[O_RDONLY], F_SETLK, &lock, NULL))
+               goto out_err;
+       if (file->f_file[O_WRONLY] &&
+           vfs_lock_file(file->f_file[O_WRONLY], F_SETLK, &lock, NULL))
+               goto out_err;
        return 0;
+out_err:
+       pr_warn("lockd: unlock failure in %s:%d\n", __FILE__, __LINE__);
+       return 1;
 }
 
 /*
index b867a92..3f1829b 100644 (file)
@@ -4024,13 +4024,12 @@ int vfs_rmdir(struct user_namespace *mnt_userns, struct inode *dir,
        dentry->d_inode->i_flags |= S_DEAD;
        dont_mount(dentry);
        detach_mounts(dentry);
-       fsnotify_rmdir(dir, dentry);
 
 out:
        inode_unlock(dentry->d_inode);
        dput(dentry);
        if (!error)
-               d_delete(dentry);
+               d_delete_notify(dir, dentry);
        return error;
 }
 EXPORT_SYMBOL(vfs_rmdir);
@@ -4152,7 +4151,6 @@ int vfs_unlink(struct user_namespace *mnt_userns, struct inode *dir,
                        if (!error) {
                                dont_mount(dentry);
                                detach_mounts(dentry);
-                               fsnotify_unlink(dir, dentry);
                        }
                }
        }
@@ -4160,9 +4158,11 @@ out:
        inode_unlock(target);
 
        /* We don't d_delete() NFS sillyrenamed files--they still exist. */
-       if (!error && !(dentry->d_flags & DCACHE_NFSFS_RENAMED)) {
+       if (!error && dentry->d_flags & DCACHE_NFSFS_RENAMED) {
+               fsnotify_unlink(dir, dentry);
+       } else if (!error) {
                fsnotify_link_count(target);
-               d_delete(dentry);
+               d_delete_notify(dir, dentry);
        }
 
        return error;
index 6a20331..ccd4f24 100644 (file)
@@ -170,7 +170,7 @@ struct cb_devicenotifyitem {
 };
 
 struct cb_devicenotifyargs {
-       int                              ndevs;
+       uint32_t                         ndevs;
        struct cb_devicenotifyitem       *devs;
 };
 
index 09c5b1c..c343666 100644 (file)
@@ -358,7 +358,7 @@ __be32 nfs4_callback_devicenotify(void *argp, void *resp,
                                  struct cb_process_state *cps)
 {
        struct cb_devicenotifyargs *args = argp;
-       int i;
+       uint32_t i;
        __be32 res = 0;
        struct nfs_client *clp = cps->clp;
        struct nfs_server *server = NULL;
index a67c41e..f90de80 100644 (file)
@@ -258,11 +258,9 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp,
                                void *argp)
 {
        struct cb_devicenotifyargs *args = argp;
+       uint32_t tmp, n, i;
        __be32 *p;
        __be32 status = 0;
-       u32 tmp;
-       int n, i;
-       args->ndevs = 0;
 
        /* Num of device notifications */
        p = xdr_inline_decode(xdr, sizeof(uint32_t));
@@ -271,7 +269,7 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp,
                goto out;
        }
        n = ntohl(*p++);
-       if (n <= 0)
+       if (n == 0)
                goto out;
        if (n > ULONG_MAX / sizeof(*args->devs)) {
                status = htonl(NFS4ERR_BADXDR);
@@ -330,19 +328,21 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp,
                        dev->cbd_immediate = 0;
                }
 
-               args->ndevs++;
-
                dprintk("%s: type %d layout 0x%x immediate %d\n",
                        __func__, dev->cbd_notify_type, dev->cbd_layout_type,
                        dev->cbd_immediate);
        }
+       args->ndevs = n;
+       dprintk("%s: ndevs %d\n", __func__, args->ndevs);
+       return 0;
+err:
+       kfree(args->devs);
 out:
+       args->devs = NULL;
+       args->ndevs = 0;
        dprintk("%s: status %d ndevs %d\n",
                __func__, ntohl(status), args->ndevs);
        return status;
-err:
-       kfree(args->devs);
-       goto out;
 }
 
 static __be32 decode_sessionid(struct xdr_stream *xdr,
index 8d8b85b..f18e80f 100644 (file)
@@ -856,6 +856,13 @@ static int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, str
                        server->namelen = pathinfo.max_namelen;
        }
 
+       if (clp->rpc_ops->discover_trunking != NULL &&
+                       (server->caps & NFS_CAP_FS_LOCATIONS)) {
+               error = clp->rpc_ops->discover_trunking(server, mntfh);
+               if (error < 0)
+                       return error;
+       }
+
        return 0;
 }
 
index 3477936..848f3b8 100644 (file)
@@ -1325,6 +1325,14 @@ void nfs_clear_verifier_delegated(struct inode *inode)
 EXPORT_SYMBOL_GPL(nfs_clear_verifier_delegated);
 #endif /* IS_ENABLED(CONFIG_NFS_V4) */
 
+static int nfs_dentry_verify_change(struct inode *dir, struct dentry *dentry)
+{
+       if (nfs_server_capable(dir, NFS_CAP_CASE_INSENSITIVE) &&
+           d_really_is_negative(dentry))
+               return dentry->d_time == inode_peek_iversion_raw(dir);
+       return nfs_verify_change_attribute(dir, dentry->d_time);
+}
+
 /*
  * A check for whether or not the parent directory has changed.
  * In the case it has, we assume that the dentries are untrustworthy
@@ -1338,7 +1346,7 @@ static int nfs_check_verifier(struct inode *dir, struct dentry *dentry,
                return 1;
        if (NFS_SERVER(dir)->flags & NFS_MOUNT_LOOKUP_CACHE_NONE)
                return 0;
-       if (!nfs_verify_change_attribute(dir, dentry->d_time))
+       if (!nfs_dentry_verify_change(dir, dentry))
                return 0;
        /* Revalidate nfsi->cache_change_attribute before we declare a match */
        if (nfs_mapping_need_revalidate_inode(dir)) {
@@ -1347,7 +1355,7 @@ static int nfs_check_verifier(struct inode *dir, struct dentry *dentry,
                if (__nfs_revalidate_inode(NFS_SERVER(dir), dir) < 0)
                        return 0;
        }
-       if (!nfs_verify_change_attribute(dir, dentry->d_time))
+       if (!nfs_dentry_verify_change(dir, dentry))
                return 0;
        return 1;
 }
@@ -1437,6 +1445,9 @@ int nfs_neg_need_reval(struct inode *dir, struct dentry *dentry,
                return 0;
        if (NFS_SERVER(dir)->flags & NFS_MOUNT_LOOKUP_CACHE_NONEG)
                return 1;
+       /* Case insensitive server? Revalidate negative dentries */
+       if (nfs_server_capable(dir, NFS_CAP_CASE_INSENSITIVE))
+               return 1;
        return !nfs_check_verifier(dir, dentry, flags & LOOKUP_RCU);
 }
 
@@ -1537,7 +1548,7 @@ out:
         * If the lookup failed despite the dentry change attribute being
         * a match, then we should revalidate the directory cache.
         */
-       if (!ret && nfs_verify_change_attribute(dir, dentry->d_time))
+       if (!ret && nfs_dentry_verify_change(dir, dentry))
                nfs_mark_dir_for_revalidate(dir);
        return nfs_lookup_revalidate_done(dir, dentry, inode, ret);
 }
@@ -1776,8 +1787,11 @@ struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned in
        dir_verifier = nfs_save_change_attribute(dir);
        trace_nfs_lookup_enter(dir, dentry, flags);
        error = NFS_PROTO(dir)->lookup(dir, dentry, fhandle, fattr);
-       if (error == -ENOENT)
+       if (error == -ENOENT) {
+               if (nfs_server_capable(dir, NFS_CAP_CASE_INSENSITIVE))
+                       dir_verifier = inode_peek_iversion_raw(dir);
                goto no_entry;
+       }
        if (error < 0) {
                res = ERR_PTR(error);
                goto out;
@@ -1806,6 +1820,14 @@ out:
 }
 EXPORT_SYMBOL_GPL(nfs_lookup);
 
+void nfs_d_prune_case_insensitive_aliases(struct inode *inode)
+{
+       /* Case insensitive server? Revalidate dentries */
+       if (inode && nfs_server_capable(inode, NFS_CAP_CASE_INSENSITIVE))
+               d_prune_aliases(inode);
+}
+EXPORT_SYMBOL_GPL(nfs_d_prune_case_insensitive_aliases);
+
 #if IS_ENABLED(CONFIG_NFS_V4)
 static int nfs4_lookup_revalidate(struct dentry *, unsigned int);
 
@@ -1867,6 +1889,7 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
        struct iattr attr = { .ia_valid = ATTR_OPEN };
        struct inode *inode;
        unsigned int lookup_flags = 0;
+       unsigned long dir_verifier;
        bool switched = false;
        int created = 0;
        int err;
@@ -1940,7 +1963,11 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
                switch (err) {
                case -ENOENT:
                        d_splice_alias(NULL, dentry);
-                       nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
+                       if (nfs_server_capable(dir, NFS_CAP_CASE_INSENSITIVE))
+                               dir_verifier = inode_peek_iversion_raw(dir);
+                       else
+                               dir_verifier = nfs_save_change_attribute(dir);
+                       nfs_set_verifier(dentry, dir_verifier);
                        break;
                case -EISDIR:
                case -ENOTDIR:
@@ -1968,6 +1995,24 @@ out:
 
 no_open:
        res = nfs_lookup(dir, dentry, lookup_flags);
+       if (!res) {
+               inode = d_inode(dentry);
+               if ((lookup_flags & LOOKUP_DIRECTORY) && inode &&
+                   !S_ISDIR(inode->i_mode))
+                       res = ERR_PTR(-ENOTDIR);
+               else if (inode && S_ISREG(inode->i_mode))
+                       res = ERR_PTR(-EOPENSTALE);
+       } else if (!IS_ERR(res)) {
+               inode = d_inode(res);
+               if ((lookup_flags & LOOKUP_DIRECTORY) && inode &&
+                   !S_ISDIR(inode->i_mode)) {
+                       dput(res);
+                       res = ERR_PTR(-ENOTDIR);
+               } else if (inode && S_ISREG(inode->i_mode)) {
+                       dput(res);
+                       res = ERR_PTR(-EOPENSTALE);
+               }
+       }
        if (switched) {
                d_lookup_done(dentry);
                if (!res)
@@ -2186,8 +2231,10 @@ static void nfs_dentry_remove_handle_error(struct inode *dir,
        switch (error) {
        case -ENOENT:
                d_delete(dentry);
-               fallthrough;
+               nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
+               break;
        case 0:
+               nfs_d_prune_case_insensitive_aliases(d_inode(dentry));
                nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
        }
 }
@@ -2380,6 +2427,8 @@ nfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
 
        trace_nfs_link_enter(inode, dir, dentry);
        d_drop(dentry);
+       if (S_ISREG(inode->i_mode))
+               nfs_sync_inode(inode);
        error = NFS_PROTO(dir)->link(inode, dir, &dentry->d_name);
        if (error == 0) {
                nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
@@ -2469,6 +2518,8 @@ int nfs_rename(struct user_namespace *mnt_userns, struct inode *old_dir,
                }
        }
 
+       if (S_ISREG(old_inode->i_mode))
+               nfs_sync_inode(old_inode);
        task = nfs_async_rename(old_dir, new_dir, old_dentry, new_dentry, NULL);
        if (IS_ERR(task)) {
                error = PTR_ERR(task);
@@ -2529,7 +2580,7 @@ MODULE_PARM_DESC(nfs_access_max_cachesize, "NFS access maximum total cache lengt
 
 static void nfs_access_free_entry(struct nfs_access_entry *entry)
 {
-       put_cred(entry->cred);
+       put_group_info(entry->group_info);
        kfree_rcu(entry, rcu_head);
        smp_mb__before_atomic();
        atomic_long_dec(&nfs_access_nr_entries);
@@ -2655,6 +2706,43 @@ void nfs_access_zap_cache(struct inode *inode)
 }
 EXPORT_SYMBOL_GPL(nfs_access_zap_cache);
 
+static int access_cmp(const struct cred *a, const struct nfs_access_entry *b)
+{
+       struct group_info *ga, *gb;
+       int g;
+
+       if (uid_lt(a->fsuid, b->fsuid))
+               return -1;
+       if (uid_gt(a->fsuid, b->fsuid))
+               return 1;
+
+       if (gid_lt(a->fsgid, b->fsgid))
+               return -1;
+       if (gid_gt(a->fsgid, b->fsgid))
+               return 1;
+
+       ga = a->group_info;
+       gb = b->group_info;
+       if (ga == gb)
+               return 0;
+       if (ga == NULL)
+               return -1;
+       if (gb == NULL)
+               return 1;
+       if (ga->ngroups < gb->ngroups)
+               return -1;
+       if (ga->ngroups > gb->ngroups)
+               return 1;
+
+       for (g = 0; g < ga->ngroups; g++) {
+               if (gid_lt(ga->gid[g], gb->gid[g]))
+                       return -1;
+               if (gid_gt(ga->gid[g], gb->gid[g]))
+                       return 1;
+       }
+       return 0;
+}
+
 static struct nfs_access_entry *nfs_access_search_rbtree(struct inode *inode, const struct cred *cred)
 {
        struct rb_node *n = NFS_I(inode)->access_cache.rb_node;
@@ -2662,7 +2750,7 @@ static struct nfs_access_entry *nfs_access_search_rbtree(struct inode *inode, co
        while (n != NULL) {
                struct nfs_access_entry *entry =
                        rb_entry(n, struct nfs_access_entry, rb_node);
-               int cmp = cred_fscmp(cred, entry->cred);
+               int cmp = access_cmp(cred, entry);
 
                if (cmp < 0)
                        n = n->rb_left;
@@ -2674,7 +2762,7 @@ static struct nfs_access_entry *nfs_access_search_rbtree(struct inode *inode, co
        return NULL;
 }
 
-static int nfs_access_get_cached_locked(struct inode *inode, const struct cred *cred, struct nfs_access_entry *res, bool may_block)
+static int nfs_access_get_cached_locked(struct inode *inode, const struct cred *cred, u32 *mask, bool may_block)
 {
        struct nfs_inode *nfsi = NFS_I(inode);
        struct nfs_access_entry *cache;
@@ -2704,8 +2792,7 @@ static int nfs_access_get_cached_locked(struct inode *inode, const struct cred *
                spin_lock(&inode->i_lock);
                retry = false;
        }
-       res->cred = cache->cred;
-       res->mask = cache->mask;
+       *mask = cache->mask;
        list_move_tail(&cache->lru, &nfsi->access_cache_entry_lru);
        err = 0;
 out:
@@ -2717,7 +2804,7 @@ out_zap:
        return -ENOENT;
 }
 
-static int nfs_access_get_cached_rcu(struct inode *inode, const struct cred *cred, struct nfs_access_entry *res)
+static int nfs_access_get_cached_rcu(struct inode *inode, const struct cred *cred, u32 *mask)
 {
        /* Only check the most recently returned cache entry,
         * but do it without locking.
@@ -2733,35 +2820,36 @@ static int nfs_access_get_cached_rcu(struct inode *inode, const struct cred *cre
        lh = rcu_dereference(list_tail_rcu(&nfsi->access_cache_entry_lru));
        cache = list_entry(lh, struct nfs_access_entry, lru);
        if (lh == &nfsi->access_cache_entry_lru ||
-           cred_fscmp(cred, cache->cred) != 0)
+           access_cmp(cred, cache) != 0)
                cache = NULL;
        if (cache == NULL)
                goto out;
        if (nfs_check_cache_invalid(inode, NFS_INO_INVALID_ACCESS))
                goto out;
-       res->cred = cache->cred;
-       res->mask = cache->mask;
+       *mask = cache->mask;
        err = 0;
 out:
        rcu_read_unlock();
        return err;
 }
 
-int nfs_access_get_cached(struct inode *inode, const struct cred *cred, struct
-nfs_access_entry *res, bool may_block)
+int nfs_access_get_cached(struct inode *inode, const struct cred *cred,
+                         u32 *mask, bool may_block)
 {
        int status;
 
-       status = nfs_access_get_cached_rcu(inode, cred, res);
+       status = nfs_access_get_cached_rcu(inode, cred, mask);
        if (status != 0)
-               status = nfs_access_get_cached_locked(inode, cred, res,
+               status = nfs_access_get_cached_locked(inode, cred, mask,
                    may_block);
 
        return status;
 }
 EXPORT_SYMBOL_GPL(nfs_access_get_cached);
 
-static void nfs_access_add_rbtree(struct inode *inode, struct nfs_access_entry *set)
+static void nfs_access_add_rbtree(struct inode *inode,
+                                 struct nfs_access_entry *set,
+                                 const struct cred *cred)
 {
        struct nfs_inode *nfsi = NFS_I(inode);
        struct rb_root *root_node = &nfsi->access_cache;
@@ -2774,7 +2862,7 @@ static void nfs_access_add_rbtree(struct inode *inode, struct nfs_access_entry *
        while (*p != NULL) {
                parent = *p;
                entry = rb_entry(parent, struct nfs_access_entry, rb_node);
-               cmp = cred_fscmp(set->cred, entry->cred);
+               cmp = access_cmp(cred, entry);
 
                if (cmp < 0)
                        p = &parent->rb_left;
@@ -2796,13 +2884,16 @@ found:
        nfs_access_free_entry(entry);
 }
 
-void nfs_access_add_cache(struct inode *inode, struct nfs_access_entry *set)
+void nfs_access_add_cache(struct inode *inode, struct nfs_access_entry *set,
+                         const struct cred *cred)
 {
        struct nfs_access_entry *cache = kmalloc(sizeof(*cache), GFP_KERNEL);
        if (cache == NULL)
                return;
        RB_CLEAR_NODE(&cache->rb_node);
-       cache->cred = get_cred(set->cred);
+       cache->fsuid = cred->fsuid;
+       cache->fsgid = cred->fsgid;
+       cache->group_info = get_group_info(cred->group_info);
        cache->mask = set->mask;
 
        /* The above field assignments must be visible
@@ -2810,7 +2901,7 @@ void nfs_access_add_cache(struct inode *inode, struct nfs_access_entry *set)
         * use rcu_assign_pointer, so just force the memory barrier.
         */
        smp_wmb();
-       nfs_access_add_rbtree(inode, cache);
+       nfs_access_add_rbtree(inode, cache, cred);
 
        /* Update accounting */
        smp_mb__before_atomic();
@@ -2875,7 +2966,7 @@ static int nfs_do_access(struct inode *inode, const struct cred *cred, int mask)
 
        trace_nfs_access_enter(inode);
 
-       status = nfs_access_get_cached(inode, cred, &cache, may_block);
+       status = nfs_access_get_cached(inode, cred, &cache.mask, may_block);
        if (status == 0)
                goto out_cached;
 
@@ -2895,8 +2986,7 @@ static int nfs_do_access(struct inode *inode, const struct cred *cred, int mask)
                cache.mask |= NFS_ACCESS_DELETE | NFS_ACCESS_LOOKUP;
        else
                cache.mask |= NFS_ACCESS_EXECUTE;
-       cache.cred = cred;
-       status = NFS_PROTO(inode)->access(inode, &cache);
+       status = NFS_PROTO(inode)->access(inode, &cache, cred);
        if (status != 0) {
                if (status == -ESTALE) {
                        if (!S_ISDIR(inode->i_mode))
@@ -2906,7 +2996,7 @@ static int nfs_do_access(struct inode *inode, const struct cred *cred, int mask)
                }
                goto out;
        }
-       nfs_access_add_cache(inode, &cache);
+       nfs_access_add_cache(inode, &cache, cred);
 out_cached:
        cache_mask = nfs_access_calc_mask(cache.mask, inode->i_mode);
        if ((mask & ~cache_mask & (MAY_READ | MAY_WRITE | MAY_EXEC)) != 0)
index 79323b5..aed0748 100644 (file)
@@ -51,7 +51,7 @@ struct nfs4_file_layout_dsaddr {
        u32                             stripe_count;
        u8                              *stripe_indices;
        u32                             ds_num;
-       struct nfs4_pnfs_ds             *ds_list[1];
+       struct nfs4_pnfs_ds             *ds_list[];
 };
 
 struct nfs4_filelayout_segment {
index 86c3f7e..acf4b88 100644 (file)
@@ -136,9 +136,7 @@ nfs4_fl_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
                goto out_err_free_stripe_indices;
        }
 
-       dsaddr = kzalloc(sizeof(*dsaddr) +
-                       (sizeof(struct nfs4_pnfs_ds *) * (num - 1)),
-                       gfp_flags);
+       dsaddr = kzalloc(struct_size(dsaddr, ds_list, num), gfp_flags);
        if (!dsaddr)
                goto out_err_free_stripe_indices;
 
index 12f6acb..2de7c56 100644 (file)
@@ -373,6 +373,7 @@ extern unsigned long nfs_access_cache_count(struct shrinker *shrink,
 extern unsigned long nfs_access_cache_scan(struct shrinker *shrink,
                                           struct shrink_control *sc);
 struct dentry *nfs_lookup(struct inode *, struct dentry *, unsigned int);
+void nfs_d_prune_case_insensitive_aliases(struct inode *inode);
 int nfs_create(struct user_namespace *, struct inode *, struct dentry *,
               umode_t, bool);
 int nfs_mkdir(struct user_namespace *, struct inode *, struct dentry *,
index 7100514..1597eef 100644 (file)
@@ -220,7 +220,8 @@ static int nfs3_proc_lookupp(struct inode *inode, struct nfs_fh *fhandle,
                                  task_flags);
 }
 
-static int nfs3_proc_access(struct inode *inode, struct nfs_access_entry *entry)
+static int nfs3_proc_access(struct inode *inode, struct nfs_access_entry *entry,
+                           const struct cred *cred)
 {
        struct nfs3_accessargs  arg = {
                .fh             = NFS_FH(inode),
@@ -231,7 +232,7 @@ static int nfs3_proc_access(struct inode *inode, struct nfs_access_entry *entry)
                .rpc_proc       = &nfs3_procedures[NFS3PROC_ACCESS],
                .rpc_argp       = &arg,
                .rpc_resp       = &res,
-               .rpc_cred       = entry->cred,
+               .rpc_cred       = cred,
        };
        int status = -ENOMEM;
 
index 8b21ff1..3212944 100644 (file)
@@ -46,7 +46,7 @@ static int _nfs42_proc_fallocate(struct rpc_message *msg, struct file *filep,
 {
        struct inode *inode = file_inode(filep);
        struct nfs_server *server = NFS_SERVER(inode);
-       u32 bitmask[3];
+       u32 bitmask[NFS_BITMASK_SZ];
        struct nfs42_falloc_args args = {
                .falloc_fh      = NFS_FH(inode),
                .falloc_offset  = offset,
@@ -69,9 +69,8 @@ static int _nfs42_proc_fallocate(struct rpc_message *msg, struct file *filep,
                return status;
        }
 
-       memcpy(bitmask, server->cache_consistency_bitmask, sizeof(bitmask));
-       if (server->attr_bitmask[1] & FATTR4_WORD1_SPACE_USED)
-               bitmask[1] |= FATTR4_WORD1_SPACE_USED;
+       nfs4_bitmask_set(bitmask, server->cache_consistency_bitmask, inode,
+                        NFS_INO_INVALID_BLOCKS);
 
        res.falloc_fattr = nfs_alloc_fattr();
        if (!res.falloc_fattr)
@@ -1044,13 +1043,14 @@ static int _nfs42_proc_clone(struct rpc_message *msg, struct file *src_f,
        struct inode *src_inode = file_inode(src_f);
        struct inode *dst_inode = file_inode(dst_f);
        struct nfs_server *server = NFS_SERVER(dst_inode);
+       __u32 dst_bitmask[NFS_BITMASK_SZ];
        struct nfs42_clone_args args = {
                .src_fh = NFS_FH(src_inode),
                .dst_fh = NFS_FH(dst_inode),
                .src_offset = src_offset,
                .dst_offset = dst_offset,
                .count = count,
-               .dst_bitmask = server->cache_consistency_bitmask,
+               .dst_bitmask = dst_bitmask,
        };
        struct nfs42_clone_res res = {
                .server = server,
@@ -1079,6 +1079,9 @@ static int _nfs42_proc_clone(struct rpc_message *msg, struct file *src_f,
        if (!res.dst_fattr)
                return -ENOMEM;
 
+       nfs4_bitmask_set(dst_bitmask, server->cache_consistency_bitmask,
+                        dst_inode, NFS_INO_INVALID_BLOCKS);
+
        status = nfs4_call_sync(server->client, server, msg,
                                &args.seq_args, &res.seq_res, 0);
        trace_nfs4_clone(src_inode, dst_inode, &args, status);
index ed5eaca..84f39b6 100644 (file)
@@ -260,8 +260,8 @@ struct nfs4_state_maintenance_ops {
 };
 
 struct nfs4_mig_recovery_ops {
-       int (*get_locations)(struct inode *, struct nfs4_fs_locations *,
-               struct page *, const struct cred *);
+       int (*get_locations)(struct nfs_server *, struct nfs_fh *,
+               struct nfs4_fs_locations *, struct page *, const struct cred *);
        int (*fsid_present)(struct inode *, const struct cred *);
 };
 
@@ -280,7 +280,8 @@ struct rpc_clnt *nfs4_negotiate_security(struct rpc_clnt *, struct inode *,
 int nfs4_submount(struct fs_context *, struct nfs_server *);
 int nfs4_replace_transport(struct nfs_server *server,
                                const struct nfs4_fs_locations *locations);
-
+size_t nfs_parse_server_name(char *string, size_t len, struct sockaddr *sa,
+                            size_t salen, struct net *net, int port);
 /* nfs4proc.c */
 extern int nfs4_handle_exception(struct nfs_server *, int, struct nfs4_exception *);
 extern int nfs4_async_handle_error(struct rpc_task *task,
@@ -302,8 +303,9 @@ extern int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait);
 extern int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle);
 extern int nfs4_proc_fs_locations(struct rpc_clnt *, struct inode *, const struct qstr *,
                                  struct nfs4_fs_locations *, struct page *);
-extern int nfs4_proc_get_locations(struct inode *, struct nfs4_fs_locations *,
-               struct page *page, const struct cred *);
+extern int nfs4_proc_get_locations(struct nfs_server *, struct nfs_fh *,
+                                  struct nfs4_fs_locations *,
+                                  struct page *page, const struct cred *);
 extern int nfs4_proc_fsid_present(struct inode *, const struct cred *);
 extern struct rpc_clnt *nfs4_proc_lookup_mountpoint(struct inode *,
                                                    struct dentry *,
@@ -315,6 +317,8 @@ extern int nfs4_set_rw_stateid(nfs4_stateid *stateid,
                const struct nfs_open_context *ctx,
                const struct nfs_lock_context *l_ctx,
                fmode_t fmode);
+extern void nfs4_bitmask_set(__u32 bitmask[], const __u32 src[],
+                            struct inode *inode, unsigned long cache_validity);
 extern int nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,
                             struct nfs_fattr *fattr, struct inode *inode);
 extern int update_open_stateid(struct nfs4_state *state,
index d8b5a25..47a6cf8 100644 (file)
@@ -1343,8 +1343,11 @@ int nfs4_update_server(struct nfs_server *server, const char *hostname,
        }
        nfs_put_client(clp);
 
-       if (server->nfs_client->cl_hostname == NULL)
+       if (server->nfs_client->cl_hostname == NULL) {
                server->nfs_client->cl_hostname = kstrdup(hostname, GFP_KERNEL);
+               if (server->nfs_client->cl_hostname == NULL)
+                       return -ENOMEM;
+       }
        nfs_server_insert_lists(server);
 
        return nfs_probe_server(server, NFS_FH(d_inode(server->super->s_root)));
index 8733423..3680c8d 100644 (file)
@@ -164,16 +164,21 @@ static int nfs4_validate_fspath(struct dentry *dentry,
        return 0;
 }
 
-static size_t nfs_parse_server_name(char *string, size_t len,
-               struct sockaddr *sa, size_t salen, struct net *net)
+size_t nfs_parse_server_name(char *string, size_t len, struct sockaddr *sa,
+                            size_t salen, struct net *net, int port)
 {
        ssize_t ret;
 
        ret = rpc_pton(net, string, len, sa, salen);
        if (ret == 0) {
-               ret = nfs_dns_resolve_name(net, string, len, sa, salen);
-               if (ret < 0)
-                       ret = 0;
+               ret = rpc_uaddr2sockaddr(net, string, len, sa, salen);
+               if (ret == 0) {
+                       ret = nfs_dns_resolve_name(net, string, len, sa, salen);
+                       if (ret < 0)
+                               ret = 0;
+               }
+       } else if (port) {
+               rpc_set_port(sa, port);
        }
        return ret;
 }
@@ -328,7 +333,7 @@ static int try_location(struct fs_context *fc,
                        nfs_parse_server_name(buf->data, buf->len,
                                              &ctx->nfs_server.address,
                                              sizeof(ctx->nfs_server._address),
-                                             fc->net_ns);
+                                             fc->net_ns, 0);
                if (ctx->nfs_server.addrlen == 0)
                        continue;
 
@@ -496,7 +501,7 @@ static int nfs4_try_replacing_one_location(struct nfs_server *server,
                        continue;
 
                salen = nfs_parse_server_name(buf->data, buf->len,
-                                               sap, addr_bufsize, net);
+                                               sap, addr_bufsize, net, 0);
                if (salen == 0)
                        continue;
                rpc_set_port(sap, NFS_PORT);
index ee3bc79..b18f31b 100644 (file)
@@ -108,10 +108,6 @@ static int nfs41_test_stateid(struct nfs_server *, nfs4_stateid *,
 static int nfs41_free_stateid(struct nfs_server *, const nfs4_stateid *,
                const struct cred *, bool);
 #endif
-static void nfs4_bitmask_set(__u32 bitmask[NFS4_BITMASK_SZ],
-                            const __u32 *src, struct inode *inode,
-                            struct nfs_server *server,
-                            struct nfs4_label *label);
 
 #ifdef CONFIG_NFS_V4_SECURITY_LABEL
 static inline struct nfs4_label *
@@ -2653,9 +2649,8 @@ static int nfs4_opendata_access(const struct cred *cred,
        } else if ((fmode & FMODE_READ) && !opendata->file_created)
                mask = NFS4_ACCESS_READ;
 
-       cache.cred = cred;
        nfs_access_set_mask(&cache, opendata->o_res.access_result);
-       nfs_access_add_cache(state->inode, &cache);
+       nfs_access_add_cache(state->inode, &cache, cred);
 
        flags = NFS4_ACCESS_READ | NFS4_ACCESS_EXECUTE | NFS4_ACCESS_LOOKUP;
        if ((mask & ~cache.mask & flags) == 0)
@@ -3670,7 +3665,7 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data)
                if (!nfs4_have_delegation(inode, FMODE_READ)) {
                        nfs4_bitmask_set(calldata->arg.bitmask_store,
                                         server->cache_consistency_bitmask,
-                                        inode, server, NULL);
+                                        inode, 0);
                        calldata->arg.bitmask = calldata->arg.bitmask_store;
                } else
                        calldata->arg.bitmask = NULL;
@@ -3841,7 +3836,9 @@ static int _nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *f
                     FATTR4_WORD0_FH_EXPIRE_TYPE |
                     FATTR4_WORD0_LINK_SUPPORT |
                     FATTR4_WORD0_SYMLINK_SUPPORT |
-                    FATTR4_WORD0_ACLSUPPORT;
+                    FATTR4_WORD0_ACLSUPPORT |
+                    FATTR4_WORD0_CASE_INSENSITIVE |
+                    FATTR4_WORD0_CASE_PRESERVING;
        if (minorversion)
                bitmask[2] = FATTR4_WORD2_SUPPATTR_EXCLCREAT;
 
@@ -3870,10 +3867,16 @@ static int _nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *f
                        server->caps |= NFS_CAP_HARDLINKS;
                if (res.has_symlinks != 0)
                        server->caps |= NFS_CAP_SYMLINKS;
+               if (res.case_insensitive)
+                       server->caps |= NFS_CAP_CASE_INSENSITIVE;
+               if (res.case_preserving)
+                       server->caps |= NFS_CAP_CASE_PRESERVING;
 #ifdef CONFIG_NFS_V4_SECURITY_LABEL
                if (res.attr_bitmask[2] & FATTR4_WORD2_SECURITY_LABEL)
                        server->caps |= NFS_CAP_SECURITY_LABEL;
 #endif
+               if (res.attr_bitmask[0] & FATTR4_WORD0_FS_LOCATIONS)
+                       server->caps |= NFS_CAP_FS_LOCATIONS;
                if (!(res.attr_bitmask[0] & FATTR4_WORD0_FILEID))
                        server->fattr_valid &= ~NFS_ATTR_FATTR_FILEID;
                if (!(res.attr_bitmask[1] & FATTR4_WORD1_MODE))
@@ -3932,6 +3935,114 @@ int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle)
        return err;
 }
 
+static void test_fs_location_for_trunking(struct nfs4_fs_location *location,
+                                         struct nfs_client *clp,
+                                         struct nfs_server *server)
+{
+       int i;
+
+       for (i = 0; i < location->nservers; i++) {
+               struct nfs4_string *srv_loc = &location->servers[i];
+               struct sockaddr addr;
+               size_t addrlen;
+               struct xprt_create xprt_args = {
+                       .ident = 0,
+                       .net = clp->cl_net,
+               };
+               struct nfs4_add_xprt_data xprtdata = {
+                       .clp = clp,
+               };
+               struct rpc_add_xprt_test rpcdata = {
+                       .add_xprt_test = clp->cl_mvops->session_trunk,
+                       .data = &xprtdata,
+               };
+               char *servername = NULL;
+
+               if (!srv_loc->len)
+                       continue;
+
+               addrlen = nfs_parse_server_name(srv_loc->data, srv_loc->len,
+                                               &addr, sizeof(addr),
+                                               clp->cl_net, server->port);
+               if (!addrlen)
+                       return;
+               xprt_args.dstaddr = &addr;
+               xprt_args.addrlen = addrlen;
+               servername = kmalloc(srv_loc->len + 1, GFP_KERNEL);
+               if (!servername)
+                       return;
+               memcpy(servername, srv_loc->data, srv_loc->len);
+               servername[srv_loc->len] = '\0';
+               xprt_args.servername = servername;
+
+               xprtdata.cred = nfs4_get_clid_cred(clp);
+               rpc_clnt_add_xprt(clp->cl_rpcclient, &xprt_args,
+                                 rpc_clnt_setup_test_and_add_xprt,
+                                 &rpcdata);
+               if (xprtdata.cred)
+                       put_cred(xprtdata.cred);
+               kfree(servername);
+       }
+}
+
+static int _nfs4_discover_trunking(struct nfs_server *server,
+                                  struct nfs_fh *fhandle)
+{
+       struct nfs4_fs_locations *locations = NULL;
+       struct page *page;
+       const struct cred *cred;
+       struct nfs_client *clp = server->nfs_client;
+       const struct nfs4_state_maintenance_ops *ops =
+               clp->cl_mvops->state_renewal_ops;
+       int status = -ENOMEM, i;
+
+       cred = ops->get_state_renewal_cred(clp);
+       if (cred == NULL) {
+               cred = nfs4_get_clid_cred(clp);
+               if (cred == NULL)
+                       return -ENOKEY;
+       }
+
+       page = alloc_page(GFP_KERNEL);
+       locations = kmalloc(sizeof(struct nfs4_fs_locations), GFP_KERNEL);
+       if (page == NULL || locations == NULL)
+               goto out;
+
+       status = nfs4_proc_get_locations(server, fhandle, locations, page,
+                                        cred);
+       if (status)
+               goto out;
+
+       for (i = 0; i < locations->nlocations; i++)
+               test_fs_location_for_trunking(&locations->locations[i], clp,
+                                             server);
+out:
+       if (page)
+               __free_page(page);
+       kfree(locations);
+       return status;
+}
+
+static int nfs4_discover_trunking(struct nfs_server *server,
+                                 struct nfs_fh *fhandle)
+{
+       struct nfs4_exception exception = {
+               .interruptible = true,
+       };
+       struct nfs_client *clp = server->nfs_client;
+       int err = 0;
+
+       if (!nfs4_has_session(clp))
+               goto out;
+       do {
+               err = nfs4_handle_exception(server,
+                               _nfs4_discover_trunking(server, fhandle),
+                               &exception);
+       } while (exception.retry);
+out:
+       return err;
+}
+
 static int _nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle,
                struct nfs_fsinfo *info)
 {
@@ -4441,7 +4552,8 @@ static int nfs4_proc_lookupp(struct inode *inode, struct nfs_fh *fhandle,
        return err;
 }
 
-static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry)
+static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry,
+                            const struct cred *cred)
 {
        struct nfs_server *server = NFS_SERVER(inode);
        struct nfs4_accessargs args = {
@@ -4455,7 +4567,7 @@ static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry
                .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_ACCESS],
                .rpc_argp = &args,
                .rpc_resp = &res,
-               .rpc_cred = entry->cred,
+               .rpc_cred = cred,
        };
        int status = 0;
 
@@ -4475,14 +4587,15 @@ static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry
        return status;
 }
 
-static int nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry)
+static int nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry,
+                           const struct cred *cred)
 {
        struct nfs4_exception exception = {
                .interruptible = true,
        };
        int err;
        do {
-               err = _nfs4_proc_access(inode, entry);
+               err = _nfs4_proc_access(inode, entry, cred);
                trace_nfs4_access(inode, err);
                err = nfs4_handle_exception(NFS_SERVER(inode), err,
                                &exception);
@@ -4663,8 +4776,10 @@ static void nfs4_proc_unlink_setup(struct rpc_message *msg,
 
        nfs_fattr_init(res->dir_attr);
 
-       if (inode)
+       if (inode) {
                nfs4_inode_return_delegation(inode);
+               nfs_d_prune_case_insensitive_aliases(inode);
+       }
 }
 
 static void nfs4_proc_unlink_rpc_prepare(struct rpc_task *task, struct nfs_unlinkdata *data)
@@ -4730,6 +4845,7 @@ static int nfs4_proc_rename_done(struct rpc_task *task, struct inode *old_dir,
                return 0;
 
        if (task->tk_status == 0) {
+               nfs_d_prune_case_insensitive_aliases(d_inode(data->old_dentry));
                if (new_dir != old_dir) {
                        /* Note: If we moved a directory, nlink will change */
                        nfs4_update_changeattr(old_dir, &res->old_cinfo,
@@ -5422,14 +5538,14 @@ bool nfs4_write_need_cache_consistency_data(struct nfs_pgio_header *hdr)
        return nfs4_have_delegation(hdr->inode, FMODE_READ) == 0;
 }
 
-static void nfs4_bitmask_set(__u32 bitmask[NFS4_BITMASK_SZ], const __u32 *src,
-                            struct inode *inode, struct nfs_server *server,
-                            struct nfs4_label *label)
+void nfs4_bitmask_set(__u32 bitmask[], const __u32 src[],
+                     struct inode *inode, unsigned long cache_validity)
 {
-       unsigned long cache_validity = READ_ONCE(NFS_I(inode)->cache_validity);
+       struct nfs_server *server = NFS_SERVER(inode);
        unsigned int i;
 
        memcpy(bitmask, src, sizeof(*bitmask) * NFS4_BITMASK_SZ);
+       cache_validity |= READ_ONCE(NFS_I(inode)->cache_validity);
 
        if (cache_validity & NFS_INO_INVALID_CHANGE)
                bitmask[0] |= FATTR4_WORD0_CHANGE;
@@ -5441,8 +5557,6 @@ static void nfs4_bitmask_set(__u32 bitmask[NFS4_BITMASK_SZ], const __u32 *src,
                bitmask[1] |= FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP;
        if (cache_validity & NFS_INO_INVALID_NLINK)
                bitmask[1] |= FATTR4_WORD1_NUMLINKS;
-       if (label && label->len && cache_validity & NFS_INO_INVALID_LABEL)
-               bitmask[2] |= FATTR4_WORD2_SECURITY_LABEL;
        if (cache_validity & NFS_INO_INVALID_CTIME)
                bitmask[1] |= FATTR4_WORD1_TIME_METADATA;
        if (cache_validity & NFS_INO_INVALID_MTIME)
@@ -5469,7 +5583,7 @@ static void nfs4_proc_write_setup(struct nfs_pgio_header *hdr,
        } else {
                nfs4_bitmask_set(hdr->args.bitmask_store,
                                 server->cache_consistency_bitmask,
-                                hdr->inode, server, NULL);
+                                hdr->inode, NFS_INO_INVALID_BLOCKS);
                hdr->args.bitmask = hdr->args.bitmask_store;
        }
 
@@ -6507,8 +6621,7 @@ static int _nfs4_proc_delegreturn(struct inode *inode, const struct cred *cred,
        data->args.fhandle = &data->fh;
        data->args.stateid = &data->stateid;
        nfs4_bitmask_set(data->args.bitmask_store,
-                        server->cache_consistency_bitmask, inode, server,
-                        NULL);
+                        server->cache_consistency_bitmask, inode, 0);
        data->args.bitmask = data->args.bitmask_store;
        nfs_copy_fh(&data->fh, NFS_FH(inode));
        nfs4_stateid_copy(&data->stateid, stateid);
@@ -7611,7 +7724,7 @@ static int nfs4_xattr_set_nfs4_user(const struct xattr_handler *handler,
                                    const char *key, const void *buf,
                                    size_t buflen, int flags)
 {
-       struct nfs_access_entry cache;
+       u32 mask;
        int ret;
 
        if (!nfs_server_capable(inode, NFS_CAP_XATTR))
@@ -7626,8 +7739,8 @@ static int nfs4_xattr_set_nfs4_user(const struct xattr_handler *handler,
         * do a cached access check for the XA* flags to possibly avoid
         * doing an RPC and getting EACCES back.
         */
-       if (!nfs_access_get_cached(inode, current_cred(), &cache, true)) {
-               if (!(cache.mask & NFS_ACCESS_XAWRITE))
+       if (!nfs_access_get_cached(inode, current_cred(), &mask, true)) {
+               if (!(mask & NFS_ACCESS_XAWRITE))
                        return -EACCES;
        }
 
@@ -7648,14 +7761,14 @@ static int nfs4_xattr_get_nfs4_user(const struct xattr_handler *handler,
                                    struct dentry *unused, struct inode *inode,
                                    const char *key, void *buf, size_t buflen)
 {
-       struct nfs_access_entry cache;
+       u32 mask;
        ssize_t ret;
 
        if (!nfs_server_capable(inode, NFS_CAP_XATTR))
                return -EOPNOTSUPP;
 
-       if (!nfs_access_get_cached(inode, current_cred(), &cache, true)) {
-               if (!(cache.mask & NFS_ACCESS_XAREAD))
+       if (!nfs_access_get_cached(inode, current_cred(), &mask, true)) {
+               if (!(mask & NFS_ACCESS_XAREAD))
                        return -EACCES;
        }
 
@@ -7680,13 +7793,13 @@ nfs4_listxattr_nfs4_user(struct inode *inode, char *list, size_t list_len)
        ssize_t ret, size;
        char *buf;
        size_t buflen;
-       struct nfs_access_entry cache;
+       u32 mask;
 
        if (!nfs_server_capable(inode, NFS_CAP_XATTR))
                return 0;
 
-       if (!nfs_access_get_cached(inode, current_cred(), &cache, true)) {
-               if (!(cache.mask & NFS_ACCESS_XALIST))
+       if (!nfs_access_get_cached(inode, current_cred(), &mask, true)) {
+               if (!(mask & NFS_ACCESS_XALIST))
                        return 0;
        }
 
@@ -7818,18 +7931,18 @@ int nfs4_proc_fs_locations(struct rpc_clnt *client, struct inode *dir,
  * appended to this compound to identify the client ID which is
  * performing recovery.
  */
-static int _nfs40_proc_get_locations(struct inode *inode,
+static int _nfs40_proc_get_locations(struct nfs_server *server,
+                                    struct nfs_fh *fhandle,
                                     struct nfs4_fs_locations *locations,
                                     struct page *page, const struct cred *cred)
 {
-       struct nfs_server *server = NFS_SERVER(inode);
        struct rpc_clnt *clnt = server->client;
        u32 bitmask[2] = {
                [0] = FATTR4_WORD0_FSID | FATTR4_WORD0_FS_LOCATIONS,
        };
        struct nfs4_fs_locations_arg args = {
                .clientid       = server->nfs_client->cl_clientid,
-               .fh             = NFS_FH(inode),
+               .fh             = fhandle,
                .page           = page,
                .bitmask        = bitmask,
                .migration      = 1,            /* skip LOOKUP */
@@ -7875,17 +7988,17 @@ static int _nfs40_proc_get_locations(struct inode *inode,
  * When the client supports GETATTR(fs_locations_info), it can
  * be plumbed in here.
  */
-static int _nfs41_proc_get_locations(struct inode *inode,
+static int _nfs41_proc_get_locations(struct nfs_server *server,
+                                    struct nfs_fh *fhandle,
                                     struct nfs4_fs_locations *locations,
                                     struct page *page, const struct cred *cred)
 {
-       struct nfs_server *server = NFS_SERVER(inode);
        struct rpc_clnt *clnt = server->client;
        u32 bitmask[2] = {
                [0] = FATTR4_WORD0_FSID | FATTR4_WORD0_FS_LOCATIONS,
        };
        struct nfs4_fs_locations_arg args = {
-               .fh             = NFS_FH(inode),
+               .fh             = fhandle,
                .page           = page,
                .bitmask        = bitmask,
                .migration      = 1,            /* skip LOOKUP */
@@ -7934,11 +8047,11 @@ static int _nfs41_proc_get_locations(struct inode *inode,
  * -NFS4ERR_LEASE_MOVED is returned if the server still has leases
  * from this client that require migration recovery.
  */
-int nfs4_proc_get_locations(struct inode *inode,
+int nfs4_proc_get_locations(struct nfs_server *server,
+                           struct nfs_fh *fhandle,
                            struct nfs4_fs_locations *locations,
                            struct page *page, const struct cred *cred)
 {
-       struct nfs_server *server = NFS_SERVER(inode);
        struct nfs_client *clp = server->nfs_client;
        const struct nfs4_mig_recovery_ops *ops =
                                        clp->cl_mvops->mig_recovery_ops;
@@ -7951,10 +8064,11 @@ int nfs4_proc_get_locations(struct inode *inode,
                (unsigned long long)server->fsid.major,
                (unsigned long long)server->fsid.minor,
                clp->cl_hostname);
-       nfs_display_fhandle(NFS_FH(inode), __func__);
+       nfs_display_fhandle(fhandle, __func__);
 
        do {
-               status = ops->get_locations(inode, locations, page, cred);
+               status = ops->get_locations(server, fhandle, locations, page,
+                                           cred);
                if (status != -NFS4ERR_DELAY)
                        break;
                nfs4_handle_exception(server, status, &exception);
@@ -10423,6 +10537,7 @@ const struct nfs_rpc_ops nfs_v4_clientops = {
        .free_client    = nfs4_free_client,
        .create_server  = nfs4_create_server,
        .clone_server   = nfs_clone_server,
+       .discover_trunking = nfs4_discover_trunking,
 };
 
 static const struct xattr_handler nfs4_xattr_nfs4_acl_handler = {
index d88b779..f5a62c0 100644 (file)
@@ -2098,7 +2098,8 @@ static int nfs4_try_migration(struct nfs_server *server, const struct cred *cred
        }
 
        inode = d_inode(server->super->s_root);
-       result = nfs4_proc_get_locations(inode, locations, page, cred);
+       result = nfs4_proc_get_locations(server, NFS_FH(inode), locations,
+                                        page, cred);
        if (result) {
                dprintk("<-- %s: failed to retrieve fs_locations: %d\n",
                        __func__, result);
@@ -2106,6 +2107,9 @@ static int nfs4_try_migration(struct nfs_server *server, const struct cred *cred
        }
 
        result = -NFS4ERR_NXIO;
+       if (!locations->nlocations)
+               goto out;
+
        if (!(locations->fattr.valid & NFS_ATTR_FATTR_V4_LOCATIONS)) {
                dprintk("<-- %s: No fs_locations data, migration skipped\n",
                        __func__);
index 69862bf..8e70b92 100644 (file)
@@ -3533,6 +3533,42 @@ static int decode_attr_aclsupport(struct xdr_stream *xdr, uint32_t *bitmap, uint
        return 0;
 }
 
+static int decode_attr_case_insensitive(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res)
+{
+       __be32 *p;
+
+       *res = 0;
+       if (unlikely(bitmap[0] & (FATTR4_WORD0_CASE_INSENSITIVE - 1U)))
+               return -EIO;
+       if (likely(bitmap[0] & FATTR4_WORD0_CASE_INSENSITIVE)) {
+               p = xdr_inline_decode(xdr, 4);
+               if (unlikely(!p))
+                       return -EIO;
+               *res = be32_to_cpup(p);
+               bitmap[0] &= ~FATTR4_WORD0_CASE_INSENSITIVE;
+       }
+       dprintk("%s: case_insensitive=%s\n", __func__, *res == 0 ? "false" : "true");
+       return 0;
+}
+
+static int decode_attr_case_preserving(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res)
+{
+       __be32 *p;
+
+       *res = 0;
+       if (unlikely(bitmap[0] & (FATTR4_WORD0_CASE_PRESERVING - 1U)))
+               return -EIO;
+       if (likely(bitmap[0] & FATTR4_WORD0_CASE_PRESERVING)) {
+               p = xdr_inline_decode(xdr, 4);
+               if (unlikely(!p))
+                       return -EIO;
+               *res = be32_to_cpup(p);
+               bitmap[0] &= ~FATTR4_WORD0_CASE_PRESERVING;
+       }
+       dprintk("%s: case_preserving=%s\n", __func__, *res == 0 ? "false" : "true");
+       return 0;
+}
+
 static int decode_attr_fileid(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *fileid)
 {
        __be32 *p;
@@ -3696,8 +3732,6 @@ static int decode_attr_fs_locations(struct xdr_stream *xdr, uint32_t *bitmap, st
        if (unlikely(!p))
                goto out_eio;
        n = be32_to_cpup(p);
-       if (n <= 0)
-               goto out_eio;
        for (res->nlocations = 0; res->nlocations < n; res->nlocations++) {
                u32 m;
                struct nfs4_fs_location *loc;
@@ -4200,10 +4234,11 @@ static int decode_attr_security_label(struct xdr_stream *xdr, uint32_t *bitmap,
                } else
                        printk(KERN_WARNING "%s: label too long (%u)!\n",
                                        __func__, len);
+               if (label && label->label)
+                       dprintk("%s: label=%.*s, len=%d, PI=%d, LFS=%d\n",
+                               __func__, label->len, (char *)label->label,
+                               label->len, label->pi, label->lfs);
        }
-       if (label && label->label)
-               dprintk("%s: label=%s, len=%d, PI=%d, LFS=%d\n", __func__,
-                       (char *)label->label, label->len, label->pi, label->lfs);
        return status;
 }
 
@@ -4412,6 +4447,10 @@ static int decode_server_caps(struct xdr_stream *xdr, struct nfs4_server_caps_re
                goto xdr_error;
        if ((status = decode_attr_aclsupport(xdr, bitmap, &res->acl_bitmask)) != 0)
                goto xdr_error;
+       if ((status = decode_attr_case_insensitive(xdr, bitmap, &res->case_insensitive)) != 0)
+               goto xdr_error;
+       if ((status = decode_attr_case_preserving(xdr, bitmap, &res->case_preserving)) != 0)
+               goto xdr_error;
        if ((status = decode_attr_exclcreat_supported(xdr, bitmap,
                                res->exclcreat_bitmask)) != 0)
                goto xdr_error;
index 8cb7075..a6f7403 100644 (file)
@@ -142,10 +142,11 @@ static struct attribute *nfs_netns_client_attrs[] = {
        &nfs_netns_client_id.attr,
        NULL,
 };
+ATTRIBUTE_GROUPS(nfs_netns_client);
 
 static struct kobj_type nfs_netns_client_type = {
        .release = nfs_netns_client_release,
-       .default_attrs = nfs_netns_client_attrs,
+       .default_groups = nfs_netns_client_groups,
        .sysfs_ops = &kobj_sysfs_ops,
        .namespace = nfs_netns_client_namespace,
 };
index 72900b8..3206373 100644 (file)
@@ -4130,8 +4130,10 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
                        status = nfserr_clid_inuse;
                        if (client_has_state(old)
                                        && !same_creds(&unconf->cl_cred,
-                                                       &old->cl_cred))
+                                                       &old->cl_cred)) {
+                               old = NULL;
                                goto out;
+                       }
                        status = mark_client_expired_locked(old);
                        if (status) {
                                old = NULL;
index b9f27fb..68b020f 100644 (file)
@@ -1247,7 +1247,8 @@ static void nfsdfs_remove_file(struct inode *dir, struct dentry *dentry)
        clear_ncl(d_inode(dentry));
        dget(dentry);
        ret = simple_unlink(dir, dentry);
-       d_delete(dentry);
+       d_drop(dentry);
+       fsnotify_unlink(dir, dentry);
        dput(dentry);
        WARN_ON_ONCE(ret);
 }
@@ -1338,8 +1339,8 @@ void nfsd_client_rmdir(struct dentry *dentry)
        dget(dentry);
        ret = simple_rmdir(dir, dentry);
        WARN_ON_ONCE(ret);
+       d_drop(dentry);
        fsnotify_rmdir(dir, dentry);
-       d_delete(dentry);
        dput(dentry);
        inode_unlock(dir);
 }
index 73b1615..2ff6bd8 100644 (file)
@@ -158,7 +158,6 @@ static size_t fanotify_event_len(unsigned int info_mode,
                                 struct fanotify_event *event)
 {
        size_t event_len = FAN_EVENT_METADATA_LEN;
-       struct fanotify_info *info;
        int fh_len;
        int dot_len = 0;
 
@@ -168,8 +167,6 @@ static size_t fanotify_event_len(unsigned int info_mode,
        if (fanotify_is_error_event(event->mask))
                event_len += FANOTIFY_ERROR_INFO_LEN;
 
-       info = fanotify_event_info(event);
-
        if (fanotify_event_has_any_dir_fh(event)) {
                event_len += fanotify_dir_name_info_len(event);
        } else if ((info_mode & FAN_REPORT_NAME) &&
@@ -704,9 +701,6 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group,
        if (fanotify_is_perm_event(event->mask))
                FANOTIFY_PERM(event)->fd = fd;
 
-       if (f)
-               fd_install(fd, f);
-
        if (info_mode) {
                ret = copy_info_records_to_user(event, info, info_mode, pidfd,
                                                buf, count);
@@ -714,6 +708,9 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group,
                        goto out_close_fd;
        }
 
+       if (f)
+               fd_install(fd, f);
+
        return metadata.event_len;
 
 out_close_fd:
index 731558a..dd77b7a 100644 (file)
@@ -661,17 +661,6 @@ static struct ctl_table ocfs2_nm_table[] = {
        { }
 };
 
-static struct ctl_table ocfs2_mod_table[] = {
-       {
-               .procname       = "nm",
-               .data           = NULL,
-               .maxlen         = 0,
-               .mode           = 0555,
-               .child          = ocfs2_nm_table
-       },
-       { }
-};
-
 static struct ctl_table_header *ocfs2_table_header;
 
 /*
@@ -682,7 +671,7 @@ static int __init ocfs2_stack_glue_init(void)
 {
        strcpy(cluster_stack_name, OCFS2_STACK_PLUGIN_O2CB);
 
-       ocfs2_table_header = register_sysctl("fs/ocfs2", ocfs2_mod_table);
+       ocfs2_table_header = register_sysctl("fs/ocfs2/nm", ocfs2_nm_table);
        if (!ocfs2_table_header) {
                printk(KERN_ERR
                       "ocfs2 stack glue: unable to register sysctl\n");
index 481017e..166c891 100644 (file)
@@ -1251,26 +1251,23 @@ static int ocfs2_test_bg_bit_allocatable(struct buffer_head *bg_bh,
 {
        struct ocfs2_group_desc *bg = (struct ocfs2_group_desc *) bg_bh->b_data;
        struct journal_head *jh;
-       int ret = 1;
+       int ret;
 
        if (ocfs2_test_bit(nr, (unsigned long *)bg->bg_bitmap))
                return 0;
 
-       if (!buffer_jbd(bg_bh))
+       jh = jbd2_journal_grab_journal_head(bg_bh);
+       if (!jh)
                return 1;
 
-       jbd_lock_bh_journal_head(bg_bh);
-       if (buffer_jbd(bg_bh)) {
-               jh = bh2jh(bg_bh);
-               spin_lock(&jh->b_state_lock);
-               bg = (struct ocfs2_group_desc *) jh->b_committed_data;
-               if (bg)
-                       ret = !ocfs2_test_bit(nr, (unsigned long *)bg->bg_bitmap);
-               else
-                       ret = 1;
-               spin_unlock(&jh->b_state_lock);
-       }
-       jbd_unlock_bh_journal_head(bg_bh);
+       spin_lock(&jh->b_state_lock);
+       bg = (struct ocfs2_group_desc *) jh->b_committed_data;
+       if (bg)
+               ret = !ocfs2_test_bit(nr, (unsigned long *)bg->bg_bitmap);
+       else
+               ret = 1;
+       spin_unlock(&jh->b_state_lock);
+       jbd2_journal_put_journal_head(jh);
 
        return ret;
 }
index b193d08..e040970 100644 (file)
@@ -145,7 +145,7 @@ static int ovl_copy_fileattr(struct inode *inode, struct path *old,
                if (err == -ENOTTY || err == -EINVAL)
                        return 0;
                pr_warn("failed to retrieve lower fileattr (%pd2, err=%i)\n",
-                       old, err);
+                       old->dentry, err);
                return err;
        }
 
@@ -157,7 +157,9 @@ static int ovl_copy_fileattr(struct inode *inode, struct path *old,
         */
        if (oldfa.flags & OVL_PROT_FS_FLAGS_MASK) {
                err = ovl_set_protattr(inode, new->dentry, &oldfa);
-               if (err)
+               if (err == -EPERM)
+                       pr_warn_once("copying fileattr: no xattr on upper\n");
+               else if (err)
                        return err;
        }
 
@@ -167,8 +169,16 @@ static int ovl_copy_fileattr(struct inode *inode, struct path *old,
 
        err = ovl_real_fileattr_get(new, &newfa);
        if (err) {
+               /*
+                * Returning an error if upper doesn't support fileattr will
+                * result in a regression, so revert to the old behavior.
+                */
+               if (err == -ENOTTY || err == -EINVAL) {
+                       pr_warn_once("copying fileattr: no support on upper\n");
+                       return 0;
+               }
                pr_warn("failed to retrieve upper fileattr (%pd2, err=%i)\n",
-                       new, err);
+                       new->dentry, err);
                return err;
        }
 
index 22d904b..a74aef9 100644 (file)
@@ -690,9 +690,14 @@ int dquot_quota_sync(struct super_block *sb, int type)
        /* This is not very clever (and fast) but currently I don't know about
         * any other simple way of getting quota data to disk and we must get
         * them there for userspace to be visible... */
-       if (sb->s_op->sync_fs)
-               sb->s_op->sync_fs(sb, 1);
-       sync_blockdev(sb->s_bdev);
+       if (sb->s_op->sync_fs) {
+               ret = sb->s_op->sync_fs(sb, 1);
+               if (ret)
+                       return ret;
+       }
+       ret = sync_blockdev(sb->s_bdev);
+       if (ret)
+               return ret;
 
        /*
         * Now when everything is written we can discard the pagecache so
index 7af820b..f1d4a19 100644 (file)
@@ -1616,11 +1616,9 @@ static void lockdep_sb_freeze_acquire(struct super_block *sb)
                percpu_rwsem_acquire(sb->s_writers.rw_sem + level, 0, _THIS_IP_);
 }
 
-static void sb_freeze_unlock(struct super_block *sb)
+static void sb_freeze_unlock(struct super_block *sb, int level)
 {
-       int level;
-
-       for (level = SB_FREEZE_LEVELS - 1; level >= 0; level--)
+       for (level--; level >= 0; level--)
                percpu_up_write(sb->s_writers.rw_sem + level);
 }
 
@@ -1691,7 +1689,14 @@ int freeze_super(struct super_block *sb)
        sb_wait_write(sb, SB_FREEZE_PAGEFAULT);
 
        /* All writers are done so after syncing there won't be dirty data */
-       sync_filesystem(sb);
+       ret = sync_filesystem(sb);
+       if (ret) {
+               sb->s_writers.frozen = SB_UNFROZEN;
+               sb_freeze_unlock(sb, SB_FREEZE_PAGEFAULT);
+               wake_up(&sb->s_writers.wait_unfrozen);
+               deactivate_locked_super(sb);
+               return ret;
+       }
 
        /* Now wait for internal filesystem counter */
        sb->s_writers.frozen = SB_FREEZE_FS;
@@ -1703,7 +1708,7 @@ int freeze_super(struct super_block *sb)
                        printk(KERN_ERR
                                "VFS:Filesystem freeze failed\n");
                        sb->s_writers.frozen = SB_UNFROZEN;
-                       sb_freeze_unlock(sb);
+                       sb_freeze_unlock(sb, SB_FREEZE_FS);
                        wake_up(&sb->s_writers.wait_unfrozen);
                        deactivate_locked_super(sb);
                        return ret;
@@ -1748,7 +1753,7 @@ static int thaw_super_locked(struct super_block *sb)
        }
 
        sb->s_writers.frozen = SB_UNFROZEN;
-       sb_freeze_unlock(sb);
+       sb_freeze_unlock(sb, SB_FREEZE_FS);
 out:
        wake_up(&sb->s_writers.wait_unfrozen);
        deactivate_locked_super(sb);
index 3ce8e21..c769001 100644 (file)
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -29,7 +29,7 @@
  */
 int sync_filesystem(struct super_block *sb)
 {
-       int ret;
+       int ret = 0;
 
        /*
         * We need to be protected against the filesystem going from
@@ -52,15 +52,21 @@ int sync_filesystem(struct super_block *sb)
         * at a time.
         */
        writeback_inodes_sb(sb, WB_REASON_SYNC);
-       if (sb->s_op->sync_fs)
-               sb->s_op->sync_fs(sb, 0);
+       if (sb->s_op->sync_fs) {
+               ret = sb->s_op->sync_fs(sb, 0);
+               if (ret)
+                       return ret;
+       }
        ret = sync_blockdev_nowait(sb->s_bdev);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        sync_inodes_sb(sb);
-       if (sb->s_op->sync_fs)
-               sb->s_op->sync_fs(sb, 1);
+       if (sb->s_op->sync_fs) {
+               ret = sb->s_op->sync_fs(sb, 1);
+               if (ret)
+                       return ret;
+       }
        return sync_blockdev(sb->s_bdev);
 }
 EXPORT_SYMBOL(sync_filesystem);
index 1d6b7a5..ea8f6cd 100644 (file)
@@ -258,10 +258,6 @@ int udf_expand_file_adinicb(struct inode *inode)
        char *kaddr;
        struct udf_inode_info *iinfo = UDF_I(inode);
        int err;
-       struct writeback_control udf_wbc = {
-               .sync_mode = WB_SYNC_NONE,
-               .nr_to_write = 1,
-       };
 
        WARN_ON_ONCE(!inode_is_locked(inode));
        if (!iinfo->i_lenAlloc) {
@@ -305,8 +301,10 @@ int udf_expand_file_adinicb(struct inode *inode)
                iinfo->i_alloc_type = ICBTAG_FLAG_AD_LONG;
        /* from now on we have normal address_space methods */
        inode->i_data.a_ops = &udf_aops;
+       set_page_dirty(page);
+       unlock_page(page);
        up_write(&iinfo->i_data_sem);
-       err = inode->i_data.a_ops->writepage(page, &udf_wbc);
+       err = filemap_fdatawrite(inode->i_mapping);
        if (err) {
                /* Restore everything back so that we don't lose data... */
                lock_page(page);
@@ -317,6 +315,7 @@ int udf_expand_file_adinicb(struct inode *inode)
                unlock_page(page);
                iinfo->i_alloc_type = ICBTAG_FLAG_AD_IN_ICB;
                inode->i_data.a_ops = &udf_adinicb_aops;
+               iinfo->i_lenAlloc = inode->i_size;
                up_write(&iinfo->i_data_sem);
        }
        put_page(page);
index 610d7bc..da786a6 100644 (file)
@@ -3,21 +3,13 @@
 # UTF-8 normalization
 #
 config UNICODE
-       bool "UTF-8 normalization and casefolding support"
+       tristate "UTF-8 normalization and casefolding support"
        help
          Say Y here to enable UTF-8 NFD normalization and NFD+CF casefolding
-         support.
-
-config UNICODE_UTF8_DATA
-       tristate "UTF-8 normalization and casefolding tables"
-       depends on UNICODE
-       default UNICODE
-       help
-         This contains a large table of case foldings, which can be loaded as
-         a separate module if you say M here.  To be on the safe side stick
-         to the default of Y.  Saying N here makes no sense, if you do not want
-         utf8 casefolding support, disable CONFIG_UNICODE instead.
+         support.  If you say M here the large table of case foldings will
+         be a separate loadable module that gets requested only when a file
+         system actually use it.
 
 config UNICODE_NORMALIZATION_SELFTEST
        tristate "Test UTF-8 normalization support"
-       depends on UNICODE_UTF8_DATA
+       depends on UNICODE
index 2f9d918..0cc8742 100644 (file)
@@ -1,8 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0
 
-obj-$(CONFIG_UNICODE) += unicode.o
+ifneq ($(CONFIG_UNICODE),)
+obj-y                  += unicode.o
+endif
+obj-$(CONFIG_UNICODE)  += utf8data.o
 obj-$(CONFIG_UNICODE_NORMALIZATION_SELFTEST) += utf8-selftest.o
-obj-$(CONFIG_UNICODE_UTF8_DATA) += utf8data.o
 
 unicode-y := utf8-norm.o utf8-core.o
 
index 2705f91..9d6a67c 100644 (file)
@@ -136,7 +136,20 @@ done:
        memalloc_nofs_restore(nofs_flag);
 }
 
-/* Finish all pending io completions. */
+/*
+ * Finish all pending IO completions that require transactional modifications.
+ *
+ * We try to merge physical and logically contiguous ioends before completion to
+ * minimise the number of transactions we need to perform during IO completion.
+ * Both unwritten extent conversion and COW remapping need to iterate and modify
+ * one physical extent at a time, so we gain nothing by merging physically
+ * discontiguous extents here.
+ *
+ * The ioend chain length that we can be processing here is largely unbound in
+ * length and we may have to perform significant amounts of work on each ioend
+ * to complete it. Hence we have to be careful about holding the CPU for too
+ * long in this loop.
+ */
 void
 xfs_end_io(
        struct work_struct      *work)
@@ -157,6 +170,7 @@ xfs_end_io(
                list_del_init(&ioend->io_list);
                iomap_ioend_try_merge(ioend, &tmp);
                xfs_end_ioend(ioend);
+               cond_resched();
        }
 }
 
index d4a387d..eb2e387 100644 (file)
@@ -850,9 +850,6 @@ xfs_alloc_file_space(
                        rblocks = 0;
                }
 
-               /*
-                * Allocate and setup the transaction.
-                */
                error = xfs_trans_alloc_inode(ip, &M_RES(mp)->tr_write,
                                dblocks, rblocks, false, &tp);
                if (error)
@@ -869,9 +866,9 @@ xfs_alloc_file_space(
                if (error)
                        goto error;
 
-               /*
-                * Complete the transaction
-                */
+               ip->i_diflags |= XFS_DIFLAG_PREALLOC;
+               xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
+
                error = xfs_trans_commit(tp);
                xfs_iunlock(ip, XFS_ILOCK_EXCL);
                if (error)
index 22ad207..5bddb1e 100644 (file)
@@ -66,40 +66,6 @@ xfs_is_falloc_aligned(
        return !((pos | len) & mask);
 }
 
-int
-xfs_update_prealloc_flags(
-       struct xfs_inode        *ip,
-       enum xfs_prealloc_flags flags)
-{
-       struct xfs_trans        *tp;
-       int                     error;
-
-       error = xfs_trans_alloc(ip->i_mount, &M_RES(ip->i_mount)->tr_writeid,
-                       0, 0, 0, &tp);
-       if (error)
-               return error;
-
-       xfs_ilock(ip, XFS_ILOCK_EXCL);
-       xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
-
-       if (!(flags & XFS_PREALLOC_INVISIBLE)) {
-               VFS_I(ip)->i_mode &= ~S_ISUID;
-               if (VFS_I(ip)->i_mode & S_IXGRP)
-                       VFS_I(ip)->i_mode &= ~S_ISGID;
-               xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
-       }
-
-       if (flags & XFS_PREALLOC_SET)
-               ip->i_diflags |= XFS_DIFLAG_PREALLOC;
-       if (flags & XFS_PREALLOC_CLEAR)
-               ip->i_diflags &= ~XFS_DIFLAG_PREALLOC;
-
-       xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
-       if (flags & XFS_PREALLOC_SYNC)
-               xfs_trans_set_sync(tp);
-       return xfs_trans_commit(tp);
-}
-
 /*
  * Fsync operations on directories are much simpler than on regular files,
  * as there is no file data to flush, and thus also no need for explicit
@@ -895,6 +861,21 @@ xfs_break_layouts(
        return error;
 }
 
+/* Does this file, inode, or mount want synchronous writes? */
+static inline bool xfs_file_sync_writes(struct file *filp)
+{
+       struct xfs_inode        *ip = XFS_I(file_inode(filp));
+
+       if (xfs_has_wsync(ip->i_mount))
+               return true;
+       if (filp->f_flags & (__O_SYNC | O_DSYNC))
+               return true;
+       if (IS_SYNC(file_inode(filp)))
+               return true;
+
+       return false;
+}
+
 #define        XFS_FALLOC_FL_SUPPORTED                                         \
                (FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE |           \
                 FALLOC_FL_COLLAPSE_RANGE | FALLOC_FL_ZERO_RANGE |      \
@@ -910,7 +891,6 @@ xfs_file_fallocate(
        struct inode            *inode = file_inode(file);
        struct xfs_inode        *ip = XFS_I(inode);
        long                    error;
-       enum xfs_prealloc_flags flags = 0;
        uint                    iolock = XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL;
        loff_t                  new_size = 0;
        bool                    do_file_insert = false;
@@ -955,6 +935,10 @@ xfs_file_fallocate(
                        goto out_unlock;
        }
 
+       error = file_modified(file);
+       if (error)
+               goto out_unlock;
+
        if (mode & FALLOC_FL_PUNCH_HOLE) {
                error = xfs_free_file_space(ip, offset, len);
                if (error)
@@ -1004,8 +988,6 @@ xfs_file_fallocate(
                }
                do_file_insert = true;
        } else {
-               flags |= XFS_PREALLOC_SET;
-
                if (!(mode & FALLOC_FL_KEEP_SIZE) &&
                    offset + len > i_size_read(inode)) {
                        new_size = offset + len;
@@ -1057,13 +1039,6 @@ xfs_file_fallocate(
                }
        }
 
-       if (file->f_flags & O_DSYNC)
-               flags |= XFS_PREALLOC_SYNC;
-
-       error = xfs_update_prealloc_flags(ip, flags);
-       if (error)
-               goto out_unlock;
-
        /* Change file size if needed */
        if (new_size) {
                struct iattr iattr;
@@ -1082,8 +1057,14 @@ xfs_file_fallocate(
         * leave shifted extents past EOF and hence losing access to
         * the data that is contained within them.
         */
-       if (do_file_insert)
+       if (do_file_insert) {
                error = xfs_insert_file_space(ip, offset, len);
+               if (error)
+                       goto out_unlock;
+       }
+
+       if (xfs_file_sync_writes(file))
+               error = xfs_log_force_inode(ip);
 
 out_unlock:
        xfs_iunlock(ip, iolock);
@@ -1115,21 +1096,6 @@ xfs_file_fadvise(
        return ret;
 }
 
-/* Does this file, inode, or mount want synchronous writes? */
-static inline bool xfs_file_sync_writes(struct file *filp)
-{
-       struct xfs_inode        *ip = XFS_I(file_inode(filp));
-
-       if (xfs_has_wsync(ip->i_mount))
-               return true;
-       if (filp->f_flags & (__O_SYNC | O_DSYNC))
-               return true;
-       if (IS_SYNC(file_inode(filp)))
-               return true;
-
-       return false;
-}
-
 STATIC loff_t
 xfs_file_remap_range(
        struct file             *file_in,
index c447bf0..b7e8f14 100644 (file)
@@ -462,15 +462,6 @@ xfs_itruncate_extents(
 }
 
 /* from xfs_file.c */
-enum xfs_prealloc_flags {
-       XFS_PREALLOC_SET        = (1 << 1),
-       XFS_PREALLOC_CLEAR      = (1 << 2),
-       XFS_PREALLOC_SYNC       = (1 << 3),
-       XFS_PREALLOC_INVISIBLE  = (1 << 4),
-};
-
-int    xfs_update_prealloc_flags(struct xfs_inode *ip,
-                                 enum xfs_prealloc_flags flags);
 int    xfs_break_layouts(struct inode *inode, uint *iolock,
                enum layout_break_reason reason);
 
index 03a6198..2515fe8 100644 (file)
@@ -1464,7 +1464,7 @@ xfs_ioc_getbmap(
 
        if (bmx.bmv_count < 2)
                return -EINVAL;
-       if (bmx.bmv_count > ULONG_MAX / recsize)
+       if (bmx.bmv_count >= INT_MAX / recsize)
                return -ENOMEM;
 
        buf = kvcalloc(bmx.bmv_count, sizeof(*buf), GFP_KERNEL);
index d6334ab..4abe173 100644 (file)
@@ -71,6 +71,40 @@ xfs_fs_get_uuid(
 }
 
 /*
+ * We cannot use file based VFS helpers such as file_modified() to update
+ * inode state as we modify the data/metadata in the inode here. Hence we have
+ * to open code the timestamp updates and SUID/SGID stripping. We also need
+ * to set the inode prealloc flag to ensure that the extents we allocate are not
+ * removed if the inode is reclaimed from memory before xfs_fs_block_commit()
+ * is from the client to indicate that data has been written and the file size
+ * can be extended.
+ */
+static int
+xfs_fs_map_update_inode(
+       struct xfs_inode        *ip)
+{
+       struct xfs_trans        *tp;
+       int                     error;
+
+       error = xfs_trans_alloc(ip->i_mount, &M_RES(ip->i_mount)->tr_writeid,
+                       0, 0, 0, &tp);
+       if (error)
+               return error;
+
+       xfs_ilock(ip, XFS_ILOCK_EXCL);
+       xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
+
+       VFS_I(ip)->i_mode &= ~S_ISUID;
+       if (VFS_I(ip)->i_mode & S_IXGRP)
+               VFS_I(ip)->i_mode &= ~S_ISGID;
+       xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
+       ip->i_diflags |= XFS_DIFLAG_PREALLOC;
+
+       xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
+       return xfs_trans_commit(tp);
+}
+
+/*
  * Get a layout for the pNFS client.
  */
 int
@@ -164,10 +198,12 @@ xfs_fs_map_blocks(
                 * that the blocks allocated and handed out to the client are
                 * guaranteed to be present even after a server crash.
                 */
-               error = xfs_update_prealloc_flags(ip,
-                               XFS_PREALLOC_SET | XFS_PREALLOC_SYNC);
+               error = xfs_fs_map_update_inode(ip);
+               if (!error)
+                       error = xfs_log_force_inode(ip);
                if (error)
                        goto out_unlock;
+
        } else {
                xfs_iunlock(ip, lock_flags);
        }
@@ -255,7 +291,7 @@ xfs_fs_commit_blocks(
                length = end - start;
                if (!length)
                        continue;
-       
+
                /*
                 * Make sure reads through the pagecache see the new data.
                 */
index e8f37bd..4c0dee7 100644 (file)
@@ -735,6 +735,7 @@ xfs_fs_sync_fs(
        int                     wait)
 {
        struct xfs_mount        *mp = XFS_M(sb);
+       int                     error;
 
        trace_xfs_fs_sync_fs(mp, __return_address);
 
@@ -744,7 +745,10 @@ xfs_fs_sync_fs(
        if (!wait)
                return 0;
 
-       xfs_log_force(mp, XFS_LOG_SYNC);
+       error = xfs_log_force(mp, XFS_LOG_SYNC);
+       if (error)
+               return error;
+
        if (laptop_mode) {
                /*
                 * The disk must be active because we're syncing.
index d39cfa0..52363ee 100644 (file)
@@ -24,14 +24,11 @@ static inline void blake2s_set_lastblock(struct blake2s_state *state)
        state->f[0] = -1;
 }
 
-typedef void (*blake2s_compress_t)(struct blake2s_state *state,
-                                  const u8 *block, size_t nblocks, u32 inc);
-
 /* Helper functions for BLAKE2s shared by the library and shash APIs */
 
-static inline void __blake2s_update(struct blake2s_state *state,
-                                   const u8 *in, size_t inlen,
-                                   blake2s_compress_t compress)
+static __always_inline void
+__blake2s_update(struct blake2s_state *state, const u8 *in, size_t inlen,
+                bool force_generic)
 {
        const size_t fill = BLAKE2S_BLOCK_SIZE - state->buflen;
 
@@ -39,7 +36,12 @@ static inline void __blake2s_update(struct blake2s_state *state,
                return;
        if (inlen > fill) {
                memcpy(state->buf + state->buflen, in, fill);
-               (*compress)(state, state->buf, 1, BLAKE2S_BLOCK_SIZE);
+               if (force_generic)
+                       blake2s_compress_generic(state, state->buf, 1,
+                                                BLAKE2S_BLOCK_SIZE);
+               else
+                       blake2s_compress(state, state->buf, 1,
+                                        BLAKE2S_BLOCK_SIZE);
                state->buflen = 0;
                in += fill;
                inlen -= fill;
@@ -47,7 +49,12 @@ static inline void __blake2s_update(struct blake2s_state *state,
        if (inlen > BLAKE2S_BLOCK_SIZE) {
                const size_t nblocks = DIV_ROUND_UP(inlen, BLAKE2S_BLOCK_SIZE);
                /* Hash one less (full) block than strictly possible */
-               (*compress)(state, in, nblocks - 1, BLAKE2S_BLOCK_SIZE);
+               if (force_generic)
+                       blake2s_compress_generic(state, in, nblocks - 1,
+                                                BLAKE2S_BLOCK_SIZE);
+               else
+                       blake2s_compress(state, in, nblocks - 1,
+                                        BLAKE2S_BLOCK_SIZE);
                in += BLAKE2S_BLOCK_SIZE * (nblocks - 1);
                inlen -= BLAKE2S_BLOCK_SIZE * (nblocks - 1);
        }
@@ -55,13 +62,16 @@ static inline void __blake2s_update(struct blake2s_state *state,
        state->buflen += inlen;
 }
 
-static inline void __blake2s_final(struct blake2s_state *state, u8 *out,
-                                  blake2s_compress_t compress)
+static __always_inline void
+__blake2s_final(struct blake2s_state *state, u8 *out, bool force_generic)
 {
        blake2s_set_lastblock(state);
        memset(state->buf + state->buflen, 0,
               BLAKE2S_BLOCK_SIZE - state->buflen); /* Padding */
-       (*compress)(state, state->buf, 1, state->buflen);
+       if (force_generic)
+               blake2s_compress_generic(state, state->buf, 1, state->buflen);
+       else
+               blake2s_compress(state, state->buf, 1, state->buflen);
        cpu_to_le32_array(state->h, ARRAY_SIZE(state->h));
        memcpy(out, state->h, state->outlen);
 }
@@ -99,20 +109,20 @@ static inline int crypto_blake2s_init(struct shash_desc *desc)
 
 static inline int crypto_blake2s_update(struct shash_desc *desc,
                                        const u8 *in, unsigned int inlen,
-                                       blake2s_compress_t compress)
+                                       bool force_generic)
 {
        struct blake2s_state *state = shash_desc_ctx(desc);
 
-       __blake2s_update(state, in, inlen, compress);
+       __blake2s_update(state, in, inlen, force_generic);
        return 0;
 }
 
 static inline int crypto_blake2s_final(struct shash_desc *desc, u8 *out,
-                                      blake2s_compress_t compress)
+                                      bool force_generic)
 {
        struct blake2s_state *state = shash_desc_ctx(desc);
 
-       __blake2s_final(state, out, compress);
+       __blake2s_final(state, out, force_generic);
        return 0;
 }
 
diff --git a/include/dt-bindings/clock/fsd-clk.h b/include/dt-bindings/clock/fsd-clk.h
new file mode 100644 (file)
index 0000000..c8a2af1
--- /dev/null
@@ -0,0 +1,150 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (c) 2017 - 2022: Samsung Electronics Co., Ltd.
+ *             https://www.samsung.com
+ * Copyright (c) 2017-2022 Tesla, Inc.
+ *             https://www.tesla.com
+ *
+ * The constants defined in this header are being used in dts
+ * and fsd platform driver.
+ */
+
+#ifndef _DT_BINDINGS_CLOCK_FSD_H
+#define _DT_BINDINGS_CLOCK_FSD_H
+
+/* CMU */
+#define DOUT_CMU_PLL_SHARED0_DIV4              1
+#define DOUT_CMU_PERIC_SHARED1DIV36            2
+#define DOUT_CMU_PERIC_SHARED0DIV3_TBUCLK      3
+#define DOUT_CMU_PERIC_SHARED0DIV20            4
+#define DOUT_CMU_PERIC_SHARED1DIV4_DMACLK      5
+#define DOUT_CMU_PLL_SHARED0_DIV6              6
+#define DOUT_CMU_FSYS0_SHARED1DIV4             7
+#define DOUT_CMU_FSYS0_SHARED0DIV4             8
+#define DOUT_CMU_FSYS1_SHARED0DIV8             9
+#define DOUT_CMU_FSYS1_SHARED0DIV4             10
+#define CMU_CPUCL_SWITCH_GATE                  11
+#define DOUT_CMU_IMEM_TCUCLK                   12
+#define DOUT_CMU_IMEM_ACLK                     13
+#define DOUT_CMU_IMEM_DMACLK                   14
+#define GAT_CMU_FSYS0_SHARED0DIV4              15
+#define CMU_NR_CLK                             16
+
+/* PERIC */
+#define PERIC_SCLK_UART0                       1
+#define PERIC_PCLK_UART0                       2
+#define PERIC_SCLK_UART1                       3
+#define PERIC_PCLK_UART1                       4
+#define PERIC_DMA0_IPCLKPORT_ACLK              5
+#define PERIC_DMA1_IPCLKPORT_ACLK              6
+#define PERIC_PWM0_IPCLKPORT_I_PCLK_S0         7
+#define PERIC_PWM1_IPCLKPORT_I_PCLK_S0         8
+#define PERIC_PCLK_SPI0                         9
+#define PERIC_SCLK_SPI0                         10
+#define PERIC_PCLK_SPI1                         11
+#define PERIC_SCLK_SPI1                         12
+#define PERIC_PCLK_SPI2                         13
+#define PERIC_SCLK_SPI2                         14
+#define PERIC_PCLK_TDM0                         15
+#define PERIC_PCLK_HSI2C0                      16
+#define PERIC_PCLK_HSI2C1                      17
+#define PERIC_PCLK_HSI2C2                      18
+#define PERIC_PCLK_HSI2C3                      19
+#define PERIC_PCLK_HSI2C4                      20
+#define PERIC_PCLK_HSI2C5                      21
+#define PERIC_PCLK_HSI2C6                      22
+#define PERIC_PCLK_HSI2C7                      23
+#define PERIC_MCAN0_IPCLKPORT_CCLK             24
+#define PERIC_MCAN0_IPCLKPORT_PCLK             25
+#define PERIC_MCAN1_IPCLKPORT_CCLK             26
+#define PERIC_MCAN1_IPCLKPORT_PCLK             27
+#define PERIC_MCAN2_IPCLKPORT_CCLK             28
+#define PERIC_MCAN2_IPCLKPORT_PCLK             29
+#define PERIC_MCAN3_IPCLKPORT_CCLK             30
+#define PERIC_MCAN3_IPCLKPORT_PCLK             31
+#define PERIC_PCLK_ADCIF                       32
+#define PERIC_EQOS_TOP_IPCLKPORT_CLK_PTP_REF_I  33
+#define PERIC_EQOS_TOP_IPCLKPORT_ACLK_I                34
+#define PERIC_EQOS_TOP_IPCLKPORT_HCLK_I                35
+#define PERIC_EQOS_TOP_IPCLKPORT_RGMII_CLK_I   36
+#define PERIC_EQOS_TOP_IPCLKPORT_CLK_RX_I      37
+#define PERIC_BUS_D_PERIC_IPCLKPORT_EQOSCLK    38
+#define PERIC_BUS_P_PERIC_IPCLKPORT_EQOSCLK    39
+#define PERIC_HCLK_TDM0                                40
+#define PERIC_PCLK_TDM1                                41
+#define PERIC_HCLK_TDM1                                42
+#define PERIC_EQOS_PHYRXCLK_MUX                        43
+#define PERIC_EQOS_PHYRXCLK                    44
+#define PERIC_DOUT_RGMII_CLK                   45
+#define PERIC_NR_CLK                           46
+
+/* FSYS0 */
+#define UFS0_MPHY_REFCLK_IXTAL24               1
+#define UFS0_MPHY_REFCLK_IXTAL26               2
+#define UFS1_MPHY_REFCLK_IXTAL24               3
+#define UFS1_MPHY_REFCLK_IXTAL26               4
+#define UFS0_TOP0_HCLK_BUS                     5
+#define UFS0_TOP0_ACLK                         6
+#define UFS0_TOP0_CLK_UNIPRO                   7
+#define UFS0_TOP0_FMP_CLK                      8
+#define UFS1_TOP1_HCLK_BUS                     9
+#define UFS1_TOP1_ACLK                         10
+#define UFS1_TOP1_CLK_UNIPRO                   11
+#define UFS1_TOP1_FMP_CLK                      12
+#define PCIE_SUBCTRL_INST0_DBI_ACLK_SOC                13
+#define PCIE_SUBCTRL_INST0_AUX_CLK_SOC         14
+#define PCIE_SUBCTRL_INST0_MSTR_ACLK_SOC       15
+#define PCIE_SUBCTRL_INST0_SLV_ACLK_SOC                16
+#define FSYS0_EQOS_TOP0_IPCLKPORT_CLK_PTP_REF_I 17
+#define FSYS0_EQOS_TOP0_IPCLKPORT_ACLK_I       18
+#define FSYS0_EQOS_TOP0_IPCLKPORT_HCLK_I       19
+#define FSYS0_EQOS_TOP0_IPCLKPORT_RGMII_CLK_I  20
+#define FSYS0_EQOS_TOP0_IPCLKPORT_CLK_RX_I     21
+#define FSYS0_DOUT_FSYS0_PERIBUS_GRP           22
+#define FSYS0_NR_CLK                           23
+
+/* FSYS1 */
+#define PCIE_LINK0_IPCLKPORT_DBI_ACLK          1
+#define PCIE_LINK0_IPCLKPORT_AUX_ACLK          2
+#define PCIE_LINK0_IPCLKPORT_MSTR_ACLK         3
+#define PCIE_LINK0_IPCLKPORT_SLV_ACLK          4
+#define PCIE_LINK1_IPCLKPORT_DBI_ACLK          5
+#define PCIE_LINK1_IPCLKPORT_AUX_ACLK          6
+#define PCIE_LINK1_IPCLKPORT_MSTR_ACLK         7
+#define PCIE_LINK1_IPCLKPORT_SLV_ACLK          8
+#define FSYS1_NR_CLK                           9
+
+/* IMEM */
+#define IMEM_DMA0_IPCLKPORT_ACLK               1
+#define IMEM_DMA1_IPCLKPORT_ACLK               2
+#define IMEM_WDT0_IPCLKPORT_PCLK               3
+#define IMEM_WDT1_IPCLKPORT_PCLK               4
+#define IMEM_WDT2_IPCLKPORT_PCLK               5
+#define IMEM_MCT_PCLK                          6
+#define IMEM_TMU_CPU0_IPCLKPORT_I_CLK_TS       7
+#define IMEM_TMU_CPU2_IPCLKPORT_I_CLK_TS       8
+#define IMEM_TMU_TOP_IPCLKPORT_I_CLK_TS                9
+#define IMEM_TMU_GPU_IPCLKPORT_I_CLK_TS                10
+#define IMEM_TMU_GT_IPCLKPORT_I_CLK_TS         11
+#define IMEM_NR_CLK                            12
+
+/* MFC */
+#define MFC_MFC_IPCLKPORT_ACLK                 1
+#define MFC_NR_CLK                             2
+
+/* CAM_CSI */
+#define CAM_CSI0_0_IPCLKPORT_I_ACLK            1
+#define CAM_CSI0_1_IPCLKPORT_I_ACLK            2
+#define CAM_CSI0_2_IPCLKPORT_I_ACLK            3
+#define CAM_CSI0_3_IPCLKPORT_I_ACLK            4
+#define CAM_CSI1_0_IPCLKPORT_I_ACLK            5
+#define CAM_CSI1_1_IPCLKPORT_I_ACLK            6
+#define CAM_CSI1_2_IPCLKPORT_I_ACLK            7
+#define CAM_CSI1_3_IPCLKPORT_I_ACLK            8
+#define CAM_CSI2_0_IPCLKPORT_I_ACLK            9
+#define CAM_CSI2_1_IPCLKPORT_I_ACLK            10
+#define CAM_CSI2_2_IPCLKPORT_I_ACLK            11
+#define CAM_CSI2_3_IPCLKPORT_I_ACLK            12
+#define CAM_CSI_NR_CLK                         13
+
+#endif /*_DT_BINDINGS_CLOCK_FSD_H */
index 90c0f3d..d9d7b8b 100644 (file)
@@ -74,6 +74,7 @@
 #define R9A06G032_CLK_DDRPHY_PCLK      81      /* AKA CLK_REF_SYNC_D4 */
 #define R9A06G032_CLK_FW               81      /* AKA CLK_REF_SYNC_D4 */
 #define R9A06G032_CLK_CRYPTO           81      /* AKA CLK_REF_SYNC_D4 */
+#define R9A06G032_CLK_WATCHDOG         82      /* AKA CLK_REF_SYNC_D8 */
 #define R9A06G032_CLK_A7MP             84      /* AKA DIV_CA7 */
 #define R9A06G032_HCLK_CAN0            85
 #define R9A06G032_HCLK_CAN1            86
diff --git a/include/dt-bindings/clock/r9a07g054-cpg.h b/include/dt-bindings/clock/r9a07g054-cpg.h
new file mode 100644 (file)
index 0000000..43f4dbd
--- /dev/null
@@ -0,0 +1,229 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+ *
+ * Copyright (C) 2022 Renesas Electronics Corp.
+ */
+#ifndef __DT_BINDINGS_CLOCK_R9A07G054_CPG_H__
+#define __DT_BINDINGS_CLOCK_R9A07G054_CPG_H__
+
+#include <dt-bindings/clock/renesas-cpg-mssr.h>
+
+/* R9A07G054 CPG Core Clocks */
+#define R9A07G054_CLK_I                        0
+#define R9A07G054_CLK_I2               1
+#define R9A07G054_CLK_G                        2
+#define R9A07G054_CLK_S0               3
+#define R9A07G054_CLK_S1               4
+#define R9A07G054_CLK_SPI0             5
+#define R9A07G054_CLK_SPI1             6
+#define R9A07G054_CLK_SD0              7
+#define R9A07G054_CLK_SD1              8
+#define R9A07G054_CLK_M0               9
+#define R9A07G054_CLK_M1               10
+#define R9A07G054_CLK_M2               11
+#define R9A07G054_CLK_M3               12
+#define R9A07G054_CLK_M4               13
+#define R9A07G054_CLK_HP               14
+#define R9A07G054_CLK_TSU              15
+#define R9A07G054_CLK_ZT               16
+#define R9A07G054_CLK_P0               17
+#define R9A07G054_CLK_P1               18
+#define R9A07G054_CLK_P2               19
+#define R9A07G054_CLK_AT               20
+#define R9A07G054_OSCCLK               21
+#define R9A07G054_CLK_P0_DIV2          22
+#define R9A07G054_CLK_DRP_M            23
+#define R9A07G054_CLK_DRP_D            24
+#define R9A07G054_CLK_DRP_A            25
+
+/* R9A07G054 Module Clocks */
+#define R9A07G054_CA55_SCLK            0
+#define R9A07G054_CA55_PCLK            1
+#define R9A07G054_CA55_ATCLK           2
+#define R9A07G054_CA55_GICCLK          3
+#define R9A07G054_CA55_PERICLK         4
+#define R9A07G054_CA55_ACLK            5
+#define R9A07G054_CA55_TSCLK           6
+#define R9A07G054_GIC600_GICCLK                7
+#define R9A07G054_IA55_CLK             8
+#define R9A07G054_IA55_PCLK            9
+#define R9A07G054_MHU_PCLK             10
+#define R9A07G054_SYC_CNT_CLK          11
+#define R9A07G054_DMAC_ACLK            12
+#define R9A07G054_DMAC_PCLK            13
+#define R9A07G054_OSTM0_PCLK           14
+#define R9A07G054_OSTM1_PCLK           15
+#define R9A07G054_OSTM2_PCLK           16
+#define R9A07G054_MTU_X_MCK_MTU3       17
+#define R9A07G054_POE3_CLKM_POE                18
+#define R9A07G054_GPT_PCLK             19
+#define R9A07G054_POEG_A_CLKP          20
+#define R9A07G054_POEG_B_CLKP          21
+#define R9A07G054_POEG_C_CLKP          22
+#define R9A07G054_POEG_D_CLKP          23
+#define R9A07G054_WDT0_PCLK            24
+#define R9A07G054_WDT0_CLK             25
+#define R9A07G054_WDT1_PCLK            26
+#define R9A07G054_WDT1_CLK             27
+#define R9A07G054_WDT2_PCLK            28
+#define R9A07G054_WDT2_CLK             29
+#define R9A07G054_SPI_CLK2             30
+#define R9A07G054_SPI_CLK              31
+#define R9A07G054_SDHI0_IMCLK          32
+#define R9A07G054_SDHI0_IMCLK2         33
+#define R9A07G054_SDHI0_CLK_HS         34
+#define R9A07G054_SDHI0_ACLK           35
+#define R9A07G054_SDHI1_IMCLK          36
+#define R9A07G054_SDHI1_IMCLK2         37
+#define R9A07G054_SDHI1_CLK_HS         38
+#define R9A07G054_SDHI1_ACLK           39
+#define R9A07G054_GPU_CLK              40
+#define R9A07G054_GPU_AXI_CLK          41
+#define R9A07G054_GPU_ACE_CLK          42
+#define R9A07G054_ISU_ACLK             43
+#define R9A07G054_ISU_PCLK             44
+#define R9A07G054_H264_CLK_A           45
+#define R9A07G054_H264_CLK_P           46
+#define R9A07G054_CRU_SYSCLK           47
+#define R9A07G054_CRU_VCLK             48
+#define R9A07G054_CRU_PCLK             49
+#define R9A07G054_CRU_ACLK             50
+#define R9A07G054_MIPI_DSI_PLLCLK      51
+#define R9A07G054_MIPI_DSI_SYSCLK      52
+#define R9A07G054_MIPI_DSI_ACLK                53
+#define R9A07G054_MIPI_DSI_PCLK                54
+#define R9A07G054_MIPI_DSI_VCLK                55
+#define R9A07G054_MIPI_DSI_LPCLK       56
+#define R9A07G054_LCDC_CLK_A           57
+#define R9A07G054_LCDC_CLK_P           58
+#define R9A07G054_LCDC_CLK_D           59
+#define R9A07G054_SSI0_PCLK2           60
+#define R9A07G054_SSI0_PCLK_SFR                61
+#define R9A07G054_SSI1_PCLK2           62
+#define R9A07G054_SSI1_PCLK_SFR                63
+#define R9A07G054_SSI2_PCLK2           64
+#define R9A07G054_SSI2_PCLK_SFR                65
+#define R9A07G054_SSI3_PCLK2           66
+#define R9A07G054_SSI3_PCLK_SFR                67
+#define R9A07G054_SRC_CLKP             68
+#define R9A07G054_USB_U2H0_HCLK                69
+#define R9A07G054_USB_U2H1_HCLK                70
+#define R9A07G054_USB_U2P_EXR_CPUCLK   71
+#define R9A07G054_USB_PCLK             72
+#define R9A07G054_ETH0_CLK_AXI         73
+#define R9A07G054_ETH0_CLK_CHI         74
+#define R9A07G054_ETH1_CLK_AXI         75
+#define R9A07G054_ETH1_CLK_CHI         76
+#define R9A07G054_I2C0_PCLK            77
+#define R9A07G054_I2C1_PCLK            78
+#define R9A07G054_I2C2_PCLK            79
+#define R9A07G054_I2C3_PCLK            80
+#define R9A07G054_SCIF0_CLK_PCK                81
+#define R9A07G054_SCIF1_CLK_PCK                82
+#define R9A07G054_SCIF2_CLK_PCK                83
+#define R9A07G054_SCIF3_CLK_PCK                84
+#define R9A07G054_SCIF4_CLK_PCK                85
+#define R9A07G054_SCI0_CLKP            86
+#define R9A07G054_SCI1_CLKP            87
+#define R9A07G054_IRDA_CLKP            88
+#define R9A07G054_RSPI0_CLKB           89
+#define R9A07G054_RSPI1_CLKB           90
+#define R9A07G054_RSPI2_CLKB           91
+#define R9A07G054_CANFD_PCLK           92
+#define R9A07G054_GPIO_HCLK            93
+#define R9A07G054_ADC_ADCLK            94
+#define R9A07G054_ADC_PCLK             95
+#define R9A07G054_TSU_PCLK             96
+#define R9A07G054_STPAI_INITCLK                97
+#define R9A07G054_STPAI_ACLK           98
+#define R9A07G054_STPAI_MCLK           99
+#define R9A07G054_STPAI_DCLKIN         100
+#define R9A07G054_STPAI_ACLK_DRP       101
+
+/* R9A07G054 Resets */
+#define R9A07G054_CA55_RST_1_0         0
+#define R9A07G054_CA55_RST_1_1         1
+#define R9A07G054_CA55_RST_3_0         2
+#define R9A07G054_CA55_RST_3_1         3
+#define R9A07G054_CA55_RST_4           4
+#define R9A07G054_CA55_RST_5           5
+#define R9A07G054_CA55_RST_6           6
+#define R9A07G054_CA55_RST_7           7
+#define R9A07G054_CA55_RST_8           8
+#define R9A07G054_CA55_RST_9           9
+#define R9A07G054_CA55_RST_10          10
+#define R9A07G054_CA55_RST_11          11
+#define R9A07G054_CA55_RST_12          12
+#define R9A07G054_GIC600_GICRESET_N    13
+#define R9A07G054_GIC600_DBG_GICRESET_N        14
+#define R9A07G054_IA55_RESETN          15
+#define R9A07G054_MHU_RESETN           16
+#define R9A07G054_DMAC_ARESETN         17
+#define R9A07G054_DMAC_RST_ASYNC       18
+#define R9A07G054_SYC_RESETN           19
+#define R9A07G054_OSTM0_PRESETZ                20
+#define R9A07G054_OSTM1_PRESETZ                21
+#define R9A07G054_OSTM2_PRESETZ                22
+#define R9A07G054_MTU_X_PRESET_MTU3    23
+#define R9A07G054_POE3_RST_M_REG       24
+#define R9A07G054_GPT_RST_C            25
+#define R9A07G054_POEG_A_RST           26
+#define R9A07G054_POEG_B_RST           27
+#define R9A07G054_POEG_C_RST           28
+#define R9A07G054_POEG_D_RST           29
+#define R9A07G054_WDT0_PRESETN         30
+#define R9A07G054_WDT1_PRESETN         31
+#define R9A07G054_WDT2_PRESETN         32
+#define R9A07G054_SPI_RST              33
+#define R9A07G054_SDHI0_IXRST          34
+#define R9A07G054_SDHI1_IXRST          35
+#define R9A07G054_GPU_RESETN           36
+#define R9A07G054_GPU_AXI_RESETN       37
+#define R9A07G054_GPU_ACE_RESETN       38
+#define R9A07G054_ISU_ARESETN          39
+#define R9A07G054_ISU_PRESETN          40
+#define R9A07G054_H264_X_RESET_VCP     41
+#define R9A07G054_H264_CP_PRESET_P     42
+#define R9A07G054_CRU_CMN_RSTB         43
+#define R9A07G054_CRU_PRESETN          44
+#define R9A07G054_CRU_ARESETN          45
+#define R9A07G054_MIPI_DSI_CMN_RSTB    46
+#define R9A07G054_MIPI_DSI_ARESET_N    47
+#define R9A07G054_MIPI_DSI_PRESET_N    48
+#define R9A07G054_LCDC_RESET_N         49
+#define R9A07G054_SSI0_RST_M2_REG      50
+#define R9A07G054_SSI1_RST_M2_REG      51
+#define R9A07G054_SSI2_RST_M2_REG      52
+#define R9A07G054_SSI3_RST_M2_REG      53
+#define R9A07G054_SRC_RST              54
+#define R9A07G054_USB_U2H0_HRESETN     55
+#define R9A07G054_USB_U2H1_HRESETN     56
+#define R9A07G054_USB_U2P_EXL_SYSRST   57
+#define R9A07G054_USB_PRESETN          58
+#define R9A07G054_ETH0_RST_HW_N                59
+#define R9A07G054_ETH1_RST_HW_N                60
+#define R9A07G054_I2C0_MRST            61
+#define R9A07G054_I2C1_MRST            62
+#define R9A07G054_I2C2_MRST            63
+#define R9A07G054_I2C3_MRST            64
+#define R9A07G054_SCIF0_RST_SYSTEM_N   65
+#define R9A07G054_SCIF1_RST_SYSTEM_N   66
+#define R9A07G054_SCIF2_RST_SYSTEM_N   67
+#define R9A07G054_SCIF3_RST_SYSTEM_N   68
+#define R9A07G054_SCIF4_RST_SYSTEM_N   69
+#define R9A07G054_SCI0_RST             70
+#define R9A07G054_SCI1_RST             71
+#define R9A07G054_IRDA_RST             72
+#define R9A07G054_RSPI0_RST            73
+#define R9A07G054_RSPI1_RST            74
+#define R9A07G054_RSPI2_RST            75
+#define R9A07G054_CANFD_RSTP_N         76
+#define R9A07G054_CANFD_RSTC_N         77
+#define R9A07G054_GPIO_RSTN            78
+#define R9A07G054_GPIO_PORT_RESETN     79
+#define R9A07G054_GPIO_SPARE_RESETN    80
+#define R9A07G054_ADC_PRESETN          81
+#define R9A07G054_ADC_ADRST_N          82
+#define R9A07G054_TSU_PRESETN          83
+#define R9A07G054_STPAI_ARESETN                84
+
+#endif /* __DT_BINDINGS_CLOCK_R9A07G054_CPG_H__ */
index 8d7e66e..8cae969 100644 (file)
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. */
+/* Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved. */
 
 #ifndef DT_BINDINGS_CLOCK_TEGRA234_CLOCK_H
 #define DT_BINDINGS_CLOCK_TEGRA234_CLOCK_H
@@ -9,6 +9,26 @@
  * @defgroup bpmp_clock_ids Clock ID's
  * @{
  */
+/** output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_AHUB */
+#define TEGRA234_CLK_AHUB                      4U
+/** @brief output of gate CLK_ENB_APB2APE */
+#define TEGRA234_CLK_APB2APE                   5U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_APE */
+#define TEGRA234_CLK_APE                       6U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_AUD_MCLK */
+#define TEGRA234_CLK_AUD_MCLK                  7U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_DMIC1 */
+#define TEGRA234_CLK_DMIC1                     15U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_DMIC2 */
+#define TEGRA234_CLK_DMIC2                     16U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_DMIC3 */
+#define TEGRA234_CLK_DMIC3                     17U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_DMIC4 */
+#define TEGRA234_CLK_DMIC4                     18U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_DSPK1 */
+#define TEGRA234_CLK_DSPK1                     29U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_DSPK2 */
+#define TEGRA234_CLK_DSPK2                     30U
 /**
  * @brief controls the EMC clock frequency.
  * @details Doing a clk_set_rate on this clock will select the
 #define TEGRA234_CLK_EMC                       31U
 /** @brief output of gate CLK_ENB_FUSE */
 #define TEGRA234_CLK_FUSE                      40U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_I2C1 */
+#define TEGRA234_CLK_I2C1                      48U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_I2C2 */
+#define TEGRA234_CLK_I2C2                      49U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_I2C3 */
+#define TEGRA234_CLK_I2C3                      50U
+/** output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_I2C4 */
+#define TEGRA234_CLK_I2C4                      51U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_I2C6 */
+#define TEGRA234_CLK_I2C6                      52U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_I2C7 */
+#define TEGRA234_CLK_I2C7                      53U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_I2C8 */
+#define TEGRA234_CLK_I2C8                      54U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_I2C9 */
+#define TEGRA234_CLK_I2C9                      55U
+/** output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_I2S1 */
+#define TEGRA234_CLK_I2S1                      56U
+/** @brief clock recovered from I2S1 input */
+#define TEGRA234_CLK_I2S1_SYNC_INPUT           57U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_I2S2 */
+#define TEGRA234_CLK_I2S2                      58U
+/** @brief clock recovered from I2S2 input */
+#define TEGRA234_CLK_I2S2_SYNC_INPUT           59U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_I2S3 */
+#define TEGRA234_CLK_I2S3                      60U
+/** @brief clock recovered from I2S3 input */
+#define TEGRA234_CLK_I2S3_SYNC_INPUT           61U
+/** output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_I2S4 */
+#define TEGRA234_CLK_I2S4                      62U
+/** @brief clock recovered from I2S4 input */
+#define TEGRA234_CLK_I2S4_SYNC_INPUT           63U
+/** output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_I2S5 */
+#define TEGRA234_CLK_I2S5                      64U
+/** @brief clock recovered from I2S5 input */
+#define TEGRA234_CLK_I2S5_SYNC_INPUT           65U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_I2S6 */
+#define TEGRA234_CLK_I2S6                      66U
+/** @brief clock recovered from I2S6 input */
+#define TEGRA234_CLK_I2S6_SYNC_INPUT           67U
+/** PLL controlled by CLK_RST_CONTROLLER_PLLA_BASE for use by audio clocks */
+#define TEGRA234_CLK_PLLA                      93U
+/** @brief PLLP clk output */
+#define TEGRA234_CLK_PLLP_OUT0                 102U
+/** @brief output of the divider CLK_RST_CONTROLLER_PLLA_OUT */
+#define TEGRA234_CLK_PLLA_OUT0                 104U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_PWM1 */
+#define TEGRA234_CLK_PWM1                      105U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_PWM2 */
+#define TEGRA234_CLK_PWM2                      106U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_PWM3 */
+#define TEGRA234_CLK_PWM3                      107U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_PWM4 */
+#define TEGRA234_CLK_PWM4                      108U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_PWM5 */
+#define TEGRA234_CLK_PWM5                      109U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_PWM6 */
+#define TEGRA234_CLK_PWM6                      110U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_PWM7 */
+#define TEGRA234_CLK_PWM7                      111U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_PWM8 */
+#define TEGRA234_CLK_PWM8                      112U
 /** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_SDMMC4 */
 #define TEGRA234_CLK_SDMMC4                    123U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_AUDIO_SYNC_CLK_DMIC1 */
+#define TEGRA234_CLK_SYNC_DMIC1                        139U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_AUDIO_SYNC_CLK_DMIC2 */
+#define TEGRA234_CLK_SYNC_DMIC2                        140U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_AUDIO_SYNC_CLK_DMIC3 */
+#define TEGRA234_CLK_SYNC_DMIC3                        141U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_AUDIO_SYNC_CLK_DMIC4 */
+#define TEGRA234_CLK_SYNC_DMIC4                        142U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_AUDIO_SYNC_CLK_DSPK1 */
+#define TEGRA234_CLK_SYNC_DSPK1                        143U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_AUDIO_SYNC_CLK_DSPK2 */
+#define TEGRA234_CLK_SYNC_DSPK2                        144U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_AUDIO_SYNC_CLK_I2S1 */
+#define TEGRA234_CLK_SYNC_I2S1                 145U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_AUDIO_SYNC_CLK_I2S2 */
+#define TEGRA234_CLK_SYNC_I2S2                 146U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_AUDIO_SYNC_CLK_I2S3 */
+#define TEGRA234_CLK_SYNC_I2S3                 147U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_AUDIO_SYNC_CLK_I2S4 */
+#define TEGRA234_CLK_SYNC_I2S4                 148U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_AUDIO_SYNC_CLK_I2S5 */
+#define TEGRA234_CLK_SYNC_I2S5                 149U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_AUDIO_SYNC_CLK_I2S6 */
+#define TEGRA234_CLK_SYNC_I2S6                 150U
 /** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_UARTA */
 #define TEGRA234_CLK_UARTA                     155U
+/** @brief output of gate CLK_ENB_PEX1_CORE_6 */
+#define TEGRA234_CLK_PEX1_C6_CORE              161U
+/** @brief output of gate CLK_ENB_PEX2_CORE_7 */
+#define TEGRA234_CLK_PEX2_C7_CORE              171U
+/** @brief output of gate CLK_ENB_PEX2_CORE_8 */
+#define TEGRA234_CLK_PEX2_C8_CORE              172U
+/** @brief output of gate CLK_ENB_PEX2_CORE_9 */
+#define TEGRA234_CLK_PEX2_C9_CORE              173U
+/** @brief output of gate CLK_ENB_PEX2_CORE_10 */
+#define TEGRA234_CLK_PEX2_C10_CORE             187U
 /** @brief CLK_RST_CONTROLLER_CLK_SOURCE_SDMMC_LEGACY_TM switch divider output */
 #define TEGRA234_CLK_SDMMC_LEGACY_TM           219U
+/** @brief output of gate CLK_ENB_PEX0_CORE_0 */
+#define TEGRA234_CLK_PEX0_C0_CORE              220U
+/** @brief output of gate CLK_ENB_PEX0_CORE_1 */
+#define TEGRA234_CLK_PEX0_C1_CORE              221U
+/** @brief output of gate CLK_ENB_PEX0_CORE_2 */
+#define TEGRA234_CLK_PEX0_C2_CORE              222U
+/** @brief output of gate CLK_ENB_PEX0_CORE_3 */
+#define TEGRA234_CLK_PEX0_C3_CORE              223U
+/** @brief output of gate CLK_ENB_PEX0_CORE_4 */
+#define TEGRA234_CLK_PEX0_C4_CORE              224U
+/** @brief output of gate CLK_ENB_PEX1_CORE_5 */
+#define TEGRA234_CLK_PEX1_C5_CORE              225U
 /** @brief PLL controlled by CLK_RST_CONTROLLER_PLLC4_BASE */
 #define TEGRA234_CLK_PLLC4                     237U
 /** @brief 32K input clock provided by PMIC */
 #define TEGRA234_CLK_CLK_32K                   289U
-
+/** @brief CLK_RST_CONTROLLER_AZA2XBITCLK_OUT_SWITCH_DIVIDER switch divider output (aza_2xbitclk) */
+#define TEGRA234_CLK_AZA_2XBIT                 457U
+/** @brief aza_2xbitclk / 2 (aza_bitclk) */
+#define TEGRA234_CLK_AZA_BIT                   458U
 #endif
index 2662f70..e3b0e9d 100644 (file)
@@ -1,4 +1,5 @@
 /* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
+/* Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved. */
 
 #ifndef DT_BINDINGS_MEMORY_TEGRA234_MC_H
 #define DT_BINDINGS_MEMORY_TEGRA234_MC_H
@@ -7,15 +8,59 @@
 #define TEGRA234_SID_INVALID           0x00
 #define TEGRA234_SID_PASSTHROUGH       0x7f
 
+/* NISO0 stream IDs */
+#define TEGRA234_SID_APE       0x02
+#define TEGRA234_SID_HDA       0x03
+#define TEGRA234_SID_PCIE0     0x12
+#define TEGRA234_SID_PCIE4     0x13
+#define TEGRA234_SID_PCIE5     0x14
+#define TEGRA234_SID_PCIE6     0x15
+#define TEGRA234_SID_PCIE9     0x1f
 
 /* NISO1 stream IDs */
 #define TEGRA234_SID_SDMMC4    0x02
+#define TEGRA234_SID_PCIE1     0x05
+#define TEGRA234_SID_PCIE2     0x06
+#define TEGRA234_SID_PCIE3     0x07
+#define TEGRA234_SID_PCIE7     0x08
+#define TEGRA234_SID_PCIE8     0x09
+#define TEGRA234_SID_PCIE10    0x0b
 #define TEGRA234_SID_BPMP      0x10
 
 /*
  * memory client IDs
  */
 
+/* High-definition audio (HDA) read clients */
+#define TEGRA234_MEMORY_CLIENT_HDAR 0x15
+/* PCIE6 read clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE6AR 0x28
+/* PCIE6 write clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE6AW 0x29
+/* PCIE7 read clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE7AR 0x2a
+/* PCIE7 write clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE7AW 0x30
+/* PCIE8 read clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE8AR 0x32
+/* High-definition audio (HDA) write clients */
+#define TEGRA234_MEMORY_CLIENT_HDAW 0x35
+/* PCIE8 write clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE8AW 0x3b
+/* PCIE9 read clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE9AR 0x3c
+/* PCIE6r1 read clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE6AR1 0x3d
+/* PCIE9 write clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE9AW 0x3e
+/* PCIE10 read clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE10AR 0x3f
+/* PCIE10 write clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE10AW 0x40
+/* PCIE10r1 read clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE10AR1 0x48
+/* PCIE7r1 read clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE7AR1 0x49
 /* sdmmcd memory read client */
 #define TEGRA234_MEMORY_CLIENT_SDMMCRAB 0x63
 /* sdmmcd memory write client */
 #define TEGRA234_MEMORY_CLIENT_BPMPDMAR 0x95
 /* BPMPDMA write client */
 #define TEGRA234_MEMORY_CLIENT_BPMPDMAW 0x96
+/* APEDMA read client */
+#define TEGRA234_MEMORY_CLIENT_APEDMAR 0x9f
+/* APEDMA write client */
+#define TEGRA234_MEMORY_CLIENT_APEDMAW 0xa0
+/* PCIE0 read clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE0R 0xd8
+/* PCIE0 write clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE0W 0xd9
+/* PCIE1 read clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE1R 0xda
+/* PCIE1 write clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE1W 0xdb
+/* PCIE2 read clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE2AR 0xdc
+/* PCIE2 write clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE2AW 0xdd
+/* PCIE3 read clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE3R 0xde
+/* PCIE3 write clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE3W 0xdf
+/* PCIE4 read clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE4R 0xe0
+/* PCIE4 write clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE4W 0xe1
+/* PCIE5 read clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE5R 0xe2
+/* PCIE5 write clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE5W 0xe3
+/* PCIE5r1 read clients */
+#define TEGRA234_MEMORY_CLIENT_PCIE5R1 0xef
 
 #endif
index 63e038e..a5204ab 100644 (file)
@@ -41,4 +41,7 @@
 #define J721S2_IOPAD(pa, val, muxmode)         (((pa) & 0x1fff)) ((val) | (muxmode))
 #define J721S2_WKUP_IOPAD(pa, val, muxmode)    (((pa) & 0x1fff)) ((val) | (muxmode))
 
+#define AM62X_IOPAD(pa, val, muxmode)          (((pa) & 0x1fff)) ((val) | (muxmode))
+#define AM62X_MCU_IOPAD(pa, val, muxmode)      (((pa) & 0x1fff)) ((val) | (muxmode))
+
 #endif
diff --git a/include/dt-bindings/power/imx8mp-power.h b/include/dt-bindings/power/imx8mp-power.h
new file mode 100644 (file)
index 0000000..9f90c40
--- /dev/null
@@ -0,0 +1,35 @@
+/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
+/*
+ *  Copyright (C) 2020 Pengutronix, Sascha Hauer <kernel@pengutronix.de>
+ */
+
+#ifndef __DT_BINDINGS_IMX8MP_POWER_DOMAIN_POWER_H__
+#define __DT_BINDINGS_IMX8MP_POWER_DOMAIN_POWER_H__
+
+#define IMX8MP_POWER_DOMAIN_MIPI_PHY1                  0
+#define IMX8MP_POWER_DOMAIN_PCIE_PHY                   1
+#define IMX8MP_POWER_DOMAIN_USB1_PHY                   2
+#define IMX8MP_POWER_DOMAIN_USB2_PHY                   3
+#define IMX8MP_POWER_DOMAIN_MLMIX                      4
+#define IMX8MP_POWER_DOMAIN_AUDIOMIX                   5
+#define IMX8MP_POWER_DOMAIN_GPU2D                      6
+#define IMX8MP_POWER_DOMAIN_GPUMIX                     7
+#define IMX8MP_POWER_DOMAIN_VPUMIX                     8
+#define IMX8MP_POWER_DOMAIN_GPU3D                      9
+#define IMX8MP_POWER_DOMAIN_MEDIAMIX                   10
+#define IMX8MP_POWER_DOMAIN_VPU_G1                     11
+#define IMX8MP_POWER_DOMAIN_VPU_G2                     12
+#define IMX8MP_POWER_DOMAIN_VPU_VC8000E                        13
+#define IMX8MP_POWER_DOMAIN_HDMIMIX                    14
+#define IMX8MP_POWER_DOMAIN_HDMI_PHY                   15
+#define IMX8MP_POWER_DOMAIN_MIPI_PHY2                  16
+#define IMX8MP_POWER_DOMAIN_HSIOMIX                    17
+#define IMX8MP_POWER_DOMAIN_MEDIAMIX_ISPDWP            18
+
+#define IMX8MP_HSIOBLK_PD_USB                          0
+#define IMX8MP_HSIOBLK_PD_USB_PHY1                     1
+#define IMX8MP_HSIOBLK_PD_USB_PHY2                     2
+#define IMX8MP_HSIOBLK_PD_PCIE                         3
+#define IMX8MP_HSIOBLK_PD_PCIE_PHY                     4
+
+#endif
index 8a513bd..9f7d0f1 100644 (file)
@@ -18,4 +18,7 @@
 #define IMX8M_POWER_DOMAIN_MIPI_CSI2   9
 #define IMX8M_POWER_DOMAIN_PCIE2       10
 
+#define IMX8MQ_VPUBLK_PD_G1            0
+#define IMX8MQ_VPUBLK_PD_G2            1
+
 #endif
diff --git a/include/dt-bindings/power/tegra234-powergate.h b/include/dt-bindings/power/tegra234-powergate.h
new file mode 100644 (file)
index 0000000..f610eee
--- /dev/null
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Copyright (c) 2018-2022, NVIDIA CORPORATION.  All rights reserved. */
+
+#ifndef __ABI_MACH_T234_POWERGATE_T234_H_
+#define __ABI_MACH_T234_POWERGATE_T234_H_
+
+#define TEGRA234_POWER_DOMAIN_AUD      2U
+#define TEGRA234_POWER_DOMAIN_DISP     3U
+#define TEGRA234_POWER_DOMAIN_PCIEX8A  5U
+#define TEGRA234_POWER_DOMAIN_PCIEX4A  6U
+#define TEGRA234_POWER_DOMAIN_PCIEX4BA 7U
+#define TEGRA234_POWER_DOMAIN_PCIEX4BB 8U
+#define TEGRA234_POWER_DOMAIN_PCIEX1A  9U
+#define TEGRA234_POWER_DOMAIN_PCIEX4CA 13U
+#define TEGRA234_POWER_DOMAIN_PCIEX4CB 14U
+#define TEGRA234_POWER_DOMAIN_PCIEX4CC 15U
+#define TEGRA234_POWER_DOMAIN_PCIEX8B  16U
+#define TEGRA234_POWER_DOMAIN_MGBEA    17U
+#define TEGRA234_POWER_DOMAIN_MGBEB    18U
+#define TEGRA234_POWER_DOMAIN_MGBEC    19U
+
+#endif
index 50e13bc..1362cd5 100644 (file)
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. */
+/* Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved. */
 
 #ifndef DT_BINDINGS_RESET_TEGRA234_RESET_H
 #define DT_BINDINGS_RESET_TEGRA234_RESET_H
  * @brief Identifiers for Resets controllable by firmware
  * @{
  */
+#define TEGRA234_RESET_PEX1_CORE_6             11U
+#define TEGRA234_RESET_PEX1_CORE_6_APB         12U
+#define TEGRA234_RESET_PEX1_COMMON_APB         13U
+#define TEGRA234_RESET_PEX2_CORE_7             14U
+#define TEGRA234_RESET_PEX2_CORE_7_APB         15U
+#define TEGRA234_RESET_HDA                     20U
+#define TEGRA234_RESET_HDACODEC                        21U
+#define TEGRA234_RESET_I2C1                    24U
+#define TEGRA234_RESET_PEX2_CORE_8             25U
+#define TEGRA234_RESET_PEX2_CORE_8_APB         26U
+#define TEGRA234_RESET_PEX2_CORE_9             27U
+#define TEGRA234_RESET_PEX2_CORE_9_APB         28U
+#define TEGRA234_RESET_I2C2                    29U
+#define TEGRA234_RESET_I2C3                    30U
+#define TEGRA234_RESET_I2C4                    31U
+#define TEGRA234_RESET_I2C6                    32U
+#define TEGRA234_RESET_I2C7                    33U
+#define TEGRA234_RESET_I2C8                    34U
+#define TEGRA234_RESET_I2C9                    35U
+#define TEGRA234_RESET_PEX2_CORE_10            56U
+#define TEGRA234_RESET_PEX2_CORE_10_APB                57U
+#define TEGRA234_RESET_PEX2_COMMON_APB         58U
+#define TEGRA234_RESET_PWM1                    68U
+#define TEGRA234_RESET_PWM2                    69U
+#define TEGRA234_RESET_PWM3                    70U
+#define TEGRA234_RESET_PWM4                    71U
+#define TEGRA234_RESET_PWM5                    72U
+#define TEGRA234_RESET_PWM6                    73U
+#define TEGRA234_RESET_PWM7                    74U
+#define TEGRA234_RESET_PWM8                    75U
 #define TEGRA234_RESET_SDMMC4                  85U
 #define TEGRA234_RESET_UARTA                   100U
+#define TEGRA234_RESET_PEX0_CORE_0             116U
+#define TEGRA234_RESET_PEX0_CORE_1             117U
+#define TEGRA234_RESET_PEX0_CORE_2             118U
+#define TEGRA234_RESET_PEX0_CORE_3             119U
+#define TEGRA234_RESET_PEX0_CORE_4             120U
+#define TEGRA234_RESET_PEX0_CORE_0_APB         121U
+#define TEGRA234_RESET_PEX0_CORE_1_APB         122U
+#define TEGRA234_RESET_PEX0_CORE_2_APB         123U
+#define TEGRA234_RESET_PEX0_CORE_3_APB         124U
+#define TEGRA234_RESET_PEX0_CORE_4_APB         125U
+#define TEGRA234_RESET_PEX0_COMMON_APB         126U
+#define TEGRA234_RESET_PEX1_CORE_5             129U
+#define TEGRA234_RESET_PEX1_CORE_5_APB         130U
 
 /** @} */
 
index 9c95df2..f35aea9 100644 (file)
@@ -1258,6 +1258,7 @@ unsigned long disk_start_io_acct(struct gendisk *disk, unsigned int sectors,
 void disk_end_io_acct(struct gendisk *disk, unsigned int op,
                unsigned long start_time);
 
+void bio_start_io_acct_time(struct bio *bio, unsigned long start_time);
 unsigned long bio_start_io_acct(struct bio *bio);
 void bio_end_io_acct_remapped(struct bio *bio, unsigned long start_time,
                struct block_device *orig_bdev);
index 6a89ea4..edf62ea 100644 (file)
@@ -35,6 +35,7 @@
 #define CEPH_OPT_TCP_NODELAY      (1<<4) /* TCP_NODELAY on TCP sockets */
 #define CEPH_OPT_NOMSGSIGN        (1<<5) /* don't sign msgs (msgr1) */
 #define CEPH_OPT_ABORT_ON_FULL    (1<<6) /* abort w/ ENOSPC when full */
+#define CEPH_OPT_RXBOUNCE         (1<<7) /* double-buffer read data */
 
 #define CEPH_OPT_DEFAULT   (CEPH_OPT_TCP_NODELAY)
 
index ff99ce0..e7f2fb2 100644 (file)
@@ -383,6 +383,10 @@ struct ceph_connection_v2_info {
        struct ceph_gcm_nonce in_gcm_nonce;
        struct ceph_gcm_nonce out_gcm_nonce;
 
+       struct page **in_enc_pages;
+       int in_enc_page_cnt;
+       int in_enc_resid;
+       int in_enc_i;
        struct page **out_enc_pages;
        int out_enc_page_cnt;
        int out_enc_resid;
@@ -457,6 +461,7 @@ struct ceph_connection {
        struct ceph_msg *out_msg;        /* sending message (== tail of
                                            out_sent) */
 
+       struct page *bounce_page;
        u32 in_front_crc, in_middle_crc, in_data_crc;  /* calculated crc */
 
        struct timespec64 last_keepalive_ack; /* keepalive2 ack stamp */
index a26f37a..11efc45 100644 (file)
@@ -111,7 +111,7 @@ struct ethtool_link_ext_state_info {
                enum ethtool_link_ext_substate_bad_signal_integrity bad_signal_integrity;
                enum ethtool_link_ext_substate_cable_issue cable_issue;
                enum ethtool_link_ext_substate_module module;
-               u8 __link_ext_substate;
+               u32 __link_ext_substate;
        };
 };
 
index 3da9584..02f362c 100644 (file)
@@ -262,7 +262,7 @@ struct fb_ops {
 
        /* Draws a rectangle */
        void (*fb_fillrect) (struct fb_info *info, const struct fb_fillrect *rect);
-       /* Copy data from area to another. Obsolete. */
+       /* Copy data from area to another */
        void (*fb_copyarea) (struct fb_info *info, const struct fb_copyarea *region);
        /* Draws a image to the display */
        void (*fb_imageblit) (struct fb_info *info, const struct fb_image *image);
index f3daaea..e2d892b 100644 (file)
@@ -1483,7 +1483,7 @@ struct super_block {
 #ifdef CONFIG_FS_VERITY
        const struct fsverity_operations *s_vop;
 #endif
-#ifdef CONFIG_UNICODE
+#if IS_ENABLED(CONFIG_UNICODE)
        struct unicode_map *s_encoding;
        __u16 s_encoding_flags;
 #endif
index 3a2d7dc..bb8467c 100644 (file)
@@ -225,16 +225,53 @@ static inline void fsnotify_link(struct inode *dir, struct inode *inode,
 }
 
 /*
+ * fsnotify_delete - @dentry was unlinked and unhashed
+ *
+ * Caller must make sure that dentry->d_name is stable.
+ *
+ * Note: unlike fsnotify_unlink(), we have to pass also the unlinked inode
+ * as this may be called after d_delete() and old_dentry may be negative.
+ */
+static inline void fsnotify_delete(struct inode *dir, struct inode *inode,
+                                  struct dentry *dentry)
+{
+       __u32 mask = FS_DELETE;
+
+       if (S_ISDIR(inode->i_mode))
+               mask |= FS_ISDIR;
+
+       fsnotify_name(mask, inode, FSNOTIFY_EVENT_INODE, dir, &dentry->d_name,
+                     0);
+}
+
+/**
+ * d_delete_notify - delete a dentry and call fsnotify_delete()
+ * @dentry: The dentry to delete
+ *
+ * This helper is used to guaranty that the unlinked inode cannot be found
+ * by lookup of this name after fsnotify_delete() event has been delivered.
+ */
+static inline void d_delete_notify(struct inode *dir, struct dentry *dentry)
+{
+       struct inode *inode = d_inode(dentry);
+
+       ihold(inode);
+       d_delete(dentry);
+       fsnotify_delete(dir, inode, dentry);
+       iput(inode);
+}
+
+/*
  * fsnotify_unlink - 'name' was unlinked
  *
  * Caller must make sure that dentry->d_name is stable.
  */
 static inline void fsnotify_unlink(struct inode *dir, struct dentry *dentry)
 {
-       /* Expected to be called before d_delete() */
-       WARN_ON_ONCE(d_is_negative(dentry));
+       if (WARN_ON_ONCE(d_is_negative(dentry)))
+               return;
 
-       fsnotify_dirent(dir, dentry, FS_DELETE);
+       fsnotify_delete(dir, d_inode(dentry), dentry);
 }
 
 /*
@@ -258,10 +295,10 @@ static inline void fsnotify_mkdir(struct inode *dir, struct dentry *dentry)
  */
 static inline void fsnotify_rmdir(struct inode *dir, struct dentry *dentry)
 {
-       /* Expected to be called before d_delete() */
-       WARN_ON_ONCE(d_is_negative(dentry));
+       if (WARN_ON_ONCE(d_is_negative(dentry)))
+               return;
 
-       fsnotify_dirent(dir, dentry, FS_DELETE | FS_ISDIR);
+       fsnotify_delete(dir, d_inode(dentry), dentry);
 }
 
 /*
index 8420fe5..2be4dd7 100644 (file)
@@ -46,8 +46,10 @@ struct vlan_hdr {
  *     @h_vlan_encapsulated_proto: packet type ID or len
  */
 struct vlan_ethhdr {
-       unsigned char   h_dest[ETH_ALEN];
-       unsigned char   h_source[ETH_ALEN];
+       struct_group(addrs,
+               unsigned char   h_dest[ETH_ALEN];
+               unsigned char   h_source[ETH_ALEN];
+       );
        __be16          h_vlan_proto;
        __be16          h_vlan_TCI;
        __be16          h_vlan_encapsulated_proto;
index b55bd49..97a3a2e 100644 (file)
@@ -263,9 +263,11 @@ struct iomap_ioend {
        struct list_head        io_list;        /* next ioend in chain */
        u16                     io_type;
        u16                     io_flags;       /* IOMAP_F_* */
+       u32                     io_folios;      /* folios added to ioend */
        struct inode            *io_inode;      /* file being written to */
        size_t                  io_size;        /* size of the extent */
        loff_t                  io_offset;      /* offset in the file */
+       sector_t                io_sector;      /* start sector of ioend */
        struct bio              *io_bio;        /* bio being built */
        struct bio              io_inline_bio;  /* MUST BE LAST! */
 };
index fd933c4..9c3ada7 100644 (file)
@@ -594,7 +594,7 @@ struct transaction_s
         */
        unsigned long           t_log_start;
 
-       /* 
+       /*
         * Number of buffers on the t_buffers list [j_list_lock, no locks
         * needed for jbd2 thread]
         */
@@ -1295,7 +1295,7 @@ struct journal_s
         * Clean-up after fast commit or full commit. JBD2 calls this function
         * after every commit operation.
         */
-       void (*j_fc_cleanup_callback)(struct journal_s *journal, int);
+       void (*j_fc_cleanup_callback)(struct journal_s *journal, int full, tid_t tid);
 
        /**
         * @j_fc_replay_callback:
@@ -1419,9 +1419,7 @@ extern void jbd2_journal_unfile_buffer(journal_t *, struct journal_head *);
 extern bool __jbd2_journal_refile_buffer(struct journal_head *);
 extern void jbd2_journal_refile_buffer(journal_t *, struct journal_head *);
 extern void __jbd2_journal_file_buffer(struct journal_head *, transaction_t *, int);
-extern void __journal_free_buffer(struct journal_head *bh);
 extern void jbd2_journal_file_buffer(struct journal_head *, transaction_t *, int);
-extern void __journal_clean_data_list(transaction_t *transaction);
 static inline void jbd2_file_log_bh(struct list_head *head, struct buffer_head *bh)
 {
        list_add_tail(&bh->b_assoc_buffers, head);
@@ -1486,9 +1484,6 @@ extern int jbd2_journal_write_metadata_buffer(transaction_t *transaction,
                                              struct buffer_head **bh_out,
                                              sector_t blocknr);
 
-/* Transaction locking */
-extern void            __wait_on_journal (journal_t *);
-
 /* Transaction cache support */
 extern void jbd2_journal_destroy_transaction_cache(void);
 extern int __init jbd2_journal_init_transaction_cache(void);
@@ -1543,6 +1538,8 @@ extern int         jbd2_journal_flush(journal_t *journal, unsigned int flags);
 extern void     jbd2_journal_lock_updates (journal_t *);
 extern void     jbd2_journal_unlock_updates (journal_t *);
 
+void jbd2_journal_wait_updates(journal_t *);
+
 extern journal_t * jbd2_journal_init_dev(struct block_device *bdev,
                                struct block_device *fs_dev,
                                unsigned long long start, int len, int bsize);
@@ -1774,8 +1771,6 @@ static inline unsigned long jbd2_log_space_left(journal_t *journal)
 #define BJ_Reserved    4       /* Buffer is reserved for access by journal */
 #define BJ_Types       5
 
-extern int jbd_blocks_per_page(struct inode *inode);
-
 /* JBD uses a CRC32 checksum */
 #define JBD_MAX_CHECKSUM_SIZE 4
 
index 06912d6..f110399 100644 (file)
@@ -29,7 +29,9 @@
 #include <linux/refcount.h>
 #include <linux/nospec.h>
 #include <linux/notifier.h>
+#include <linux/ftrace.h>
 #include <linux/hashtable.h>
+#include <linux/instrumentation.h>
 #include <linux/interval_tree.h>
 #include <linux/rbtree.h>
 #include <linux/xarray.h>
@@ -368,8 +370,11 @@ struct kvm_vcpu {
        u64 last_used_slot_gen;
 };
 
-/* must be called with irqs disabled */
-static __always_inline void guest_enter_irqoff(void)
+/*
+ * Start accounting time towards a guest.
+ * Must be called before entering guest context.
+ */
+static __always_inline void guest_timing_enter_irqoff(void)
 {
        /*
         * This is running in ioctl context so its safe to assume that it's the
@@ -378,7 +383,18 @@ static __always_inline void guest_enter_irqoff(void)
        instrumentation_begin();
        vtime_account_guest_enter();
        instrumentation_end();
+}
 
+/*
+ * Enter guest context and enter an RCU extended quiescent state.
+ *
+ * Between guest_context_enter_irqoff() and guest_context_exit_irqoff() it is
+ * unsafe to use any code which may directly or indirectly use RCU, tracing
+ * (including IRQ flag tracing), or lockdep. All code in this period must be
+ * non-instrumentable.
+ */
+static __always_inline void guest_context_enter_irqoff(void)
+{
        /*
         * KVM does not hold any references to rcu protected data when it
         * switches CPU into a guest mode. In fact switching to a guest mode
@@ -394,16 +410,79 @@ static __always_inline void guest_enter_irqoff(void)
        }
 }
 
-static __always_inline void guest_exit_irqoff(void)
+/*
+ * Deprecated. Architectures should move to guest_timing_enter_irqoff() and
+ * guest_state_enter_irqoff().
+ */
+static __always_inline void guest_enter_irqoff(void)
+{
+       guest_timing_enter_irqoff();
+       guest_context_enter_irqoff();
+}
+
+/**
+ * guest_state_enter_irqoff - Fixup state when entering a guest
+ *
+ * Entry to a guest will enable interrupts, but the kernel state is interrupts
+ * disabled when this is invoked. Also tell RCU about it.
+ *
+ * 1) Trace interrupts on state
+ * 2) Invoke context tracking if enabled to adjust RCU state
+ * 3) Tell lockdep that interrupts are enabled
+ *
+ * Invoked from architecture specific code before entering a guest.
+ * Must be called with interrupts disabled and the caller must be
+ * non-instrumentable.
+ * The caller has to invoke guest_timing_enter_irqoff() before this.
+ *
+ * Note: this is analogous to exit_to_user_mode().
+ */
+static __always_inline void guest_state_enter_irqoff(void)
+{
+       instrumentation_begin();
+       trace_hardirqs_on_prepare();
+       lockdep_hardirqs_on_prepare(CALLER_ADDR0);
+       instrumentation_end();
+
+       guest_context_enter_irqoff();
+       lockdep_hardirqs_on(CALLER_ADDR0);
+}
+
+/*
+ * Exit guest context and exit an RCU extended quiescent state.
+ *
+ * Between guest_context_enter_irqoff() and guest_context_exit_irqoff() it is
+ * unsafe to use any code which may directly or indirectly use RCU, tracing
+ * (including IRQ flag tracing), or lockdep. All code in this period must be
+ * non-instrumentable.
+ */
+static __always_inline void guest_context_exit_irqoff(void)
 {
        context_tracking_guest_exit();
+}
 
+/*
+ * Stop accounting time towards a guest.
+ * Must be called after exiting guest context.
+ */
+static __always_inline void guest_timing_exit_irqoff(void)
+{
        instrumentation_begin();
        /* Flush the guest cputime we spent on the guest */
        vtime_account_guest_exit();
        instrumentation_end();
 }
 
+/*
+ * Deprecated. Architectures should move to guest_state_exit_irqoff() and
+ * guest_timing_exit_irqoff().
+ */
+static __always_inline void guest_exit_irqoff(void)
+{
+       guest_context_exit_irqoff();
+       guest_timing_exit_irqoff();
+}
+
 static inline void guest_exit(void)
 {
        unsigned long flags;
@@ -413,6 +492,33 @@ static inline void guest_exit(void)
        local_irq_restore(flags);
 }
 
+/**
+ * guest_state_exit_irqoff - Establish state when returning from guest mode
+ *
+ * Entry from a guest disables interrupts, but guest mode is traced as
+ * interrupts enabled. Also with NO_HZ_FULL RCU might be idle.
+ *
+ * 1) Tell lockdep that interrupts are disabled
+ * 2) Invoke context tracking if enabled to reactivate RCU
+ * 3) Trace interrupts off state
+ *
+ * Invoked from architecture specific code after exiting a guest.
+ * Must be invoked with interrupts disabled and the caller must be
+ * non-instrumentable.
+ * The caller has to invoke guest_timing_exit_irqoff() after this.
+ *
+ * Note: this is analogous to enter_from_user_mode().
+ */
+static __always_inline void guest_state_exit_irqoff(void)
+{
+       lockdep_hardirqs_off(CALLER_ADDR0);
+       guest_context_exit_irqoff();
+
+       instrumentation_begin();
+       trace_hardirqs_off_finish();
+       instrumentation_end();
+}
+
 static inline int kvm_vcpu_exiting_guest_mode(struct kvm_vcpu *vcpu)
 {
        /*
index 605756f..7f99b4d 100644 (file)
@@ -380,6 +380,7 @@ enum {
        ATA_HORKAGE_MAX_TRIM_128M = (1 << 26),  /* Limit max trim size to 128M */
        ATA_HORKAGE_NO_NCQ_ON_ATI = (1 << 27),  /* Disable NCQ on ATI chipset */
        ATA_HORKAGE_NO_ID_DEV_LOG = (1 << 28),  /* Identify device log missing */
+       ATA_HORKAGE_NO_LOG_DIR  = (1 << 29),    /* Do not read log directory */
 
         /* DMA mask for user DMA control: User visible values; DO NOT
            renumber */
index a5a724c..819ec92 100644 (file)
@@ -80,7 +80,7 @@ LSM_HOOK(int, 0, sb_clone_mnt_opts, const struct super_block *oldsb,
         unsigned long *set_kern_flags)
 LSM_HOOK(int, 0, move_mount, const struct path *from_path,
         const struct path *to_path)
-LSM_HOOK(int, 0, dentry_init_security, struct dentry *dentry,
+LSM_HOOK(int, -EOPNOTSUPP, dentry_init_security, struct dentry *dentry,
         int mode, const struct qstr *name, const char **xattr_name,
         void **ctx, u32 *ctxlen)
 LSM_HOOK(int, 0, dentry_create_files_as, struct dentry *dentry, int mode,
index e1a84b1..213cc56 100644 (file)
@@ -1506,11 +1506,18 @@ static inline u8 page_kasan_tag(const struct page *page)
 
 static inline void page_kasan_tag_set(struct page *page, u8 tag)
 {
-       if (kasan_enabled()) {
-               tag ^= 0xff;
-               page->flags &= ~(KASAN_TAG_MASK << KASAN_TAG_PGSHIFT);
-               page->flags |= (tag & KASAN_TAG_MASK) << KASAN_TAG_PGSHIFT;
-       }
+       unsigned long old_flags, flags;
+
+       if (!kasan_enabled())
+               return;
+
+       tag ^= 0xff;
+       old_flags = READ_ONCE(page->flags);
+       do {
+               flags = old_flags;
+               flags &= ~(KASAN_TAG_MASK << KASAN_TAG_PGSHIFT);
+               flags |= (tag & KASAN_TAG_MASK) << KASAN_TAG_PGSHIFT;
+       } while (unlikely(!try_cmpxchg(&page->flags, &old_flags, flags)));
 }
 
 static inline void page_kasan_tag_reset(struct page *page)
index 9db36dc..5140e5f 100644 (file)
@@ -261,6 +261,7 @@ static_assert(sizeof(struct page) == sizeof(struct folio));
        static_assert(offsetof(struct page, pg) == offsetof(struct folio, fl))
 FOLIO_MATCH(flags, flags);
 FOLIO_MATCH(lru, lru);
+FOLIO_MATCH(mapping, mapping);
 FOLIO_MATCH(compound_head, lru);
 FOLIO_MATCH(index, index);
 FOLIO_MATCH(private, private);
index 3213c72..e490b84 100644 (file)
@@ -2548,6 +2548,7 @@ struct packet_type {
                                              struct net_device *);
        bool                    (*id_match)(struct packet_type *ptype,
                                            struct sock *sk);
+       struct net              *af_packet_net;
        void                    *af_packet_priv;
        struct list_head        list;
 };
index b46c39d..614f222 100644 (file)
@@ -244,6 +244,13 @@ struct netfs_cache_ops {
        int (*prepare_write)(struct netfs_cache_resources *cres,
                             loff_t *_start, size_t *_len, loff_t i_size,
                             bool no_space_allocated_yet);
+
+       /* Query the occupancy of the cache in a region, returning where the
+        * next chunk of data starts and how long it is.
+        */
+       int (*query_occupancy)(struct netfs_cache_resources *cres,
+                              loff_t start, size_t len, size_t granularity,
+                              loff_t *_data_start, size_t *_data_len);
 };
 
 struct readahead_control;
index 00835ba..02aa493 100644 (file)
@@ -61,7 +61,9 @@
 struct nfs_access_entry {
        struct rb_node          rb_node;
        struct list_head        lru;
-       const struct cred *     cred;
+       kuid_t                  fsuid;
+       kgid_t                  fsgid;
+       struct group_info       *group_info;
        __u32                   mask;
        struct rcu_head         rcu_head;
 };
@@ -395,7 +397,7 @@ extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fa
 extern int nfs_post_op_update_inode_force_wcc_locked(struct inode *inode, struct nfs_fattr *fattr);
 extern int nfs_getattr(struct user_namespace *, const struct path *,
                       struct kstat *, u32, unsigned int);
-extern void nfs_access_add_cache(struct inode *, struct nfs_access_entry *);
+extern void nfs_access_add_cache(struct inode *, struct nfs_access_entry *, const struct cred *);
 extern void nfs_access_set_mask(struct nfs_access_entry *, u32);
 extern int nfs_permission(struct user_namespace *, struct inode *, int);
 extern int nfs_open(struct inode *, struct file *);
@@ -532,8 +534,8 @@ extern int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fh,
                        struct nfs_fattr *fattr);
 extern int nfs_may_open(struct inode *inode, const struct cred *cred, int openflags);
 extern void nfs_access_zap_cache(struct inode *inode);
-extern int nfs_access_get_cached(struct inode *inode, const struct cred *cred, struct nfs_access_entry *res,
-                                bool may_block);
+extern int nfs_access_get_cached(struct inode *inode, const struct cred *cred,
+                                u32 *mask, bool may_block);
 
 /*
  * linux/fs/nfs/symlink.c
index 77b2dba..ca0959e 100644 (file)
@@ -266,6 +266,8 @@ struct nfs_server {
 #define NFS_CAP_ACLS           (1U << 3)
 #define NFS_CAP_ATOMIC_OPEN    (1U << 4)
 #define NFS_CAP_LGOPEN         (1U << 5)
+#define NFS_CAP_CASE_INSENSITIVE       (1U << 6)
+#define NFS_CAP_CASE_PRESERVING        (1U << 7)
 #define NFS_CAP_POSIX_LOCK     (1U << 14)
 #define NFS_CAP_UIDGID_NOMAP   (1U << 15)
 #define NFS_CAP_STATEID_NFSV41 (1U << 16)
@@ -282,5 +284,5 @@ struct nfs_server {
 #define NFS_CAP_COPY_NOTIFY    (1U << 27)
 #define NFS_CAP_XATTR          (1U << 28)
 #define NFS_CAP_READ_PLUS      (1U << 29)
-
+#define NFS_CAP_FS_LOCATIONS   (1U << 30)
 #endif
index 967a009..728cb0c 100644 (file)
@@ -1194,6 +1194,8 @@ struct nfs4_server_caps_res {
        u32                             has_links;
        u32                             has_symlinks;
        u32                             fh_expire_type;
+       u32                             case_insensitive;
+       u32                             case_preserving;
 };
 
 #define NFS4_PATHNAME_MAXCOMPONENTS 512
@@ -1737,7 +1739,7 @@ struct nfs_rpc_ops {
                            struct nfs_fh *, struct nfs_fattr *);
        int     (*lookupp) (struct inode *, struct nfs_fh *,
                            struct nfs_fattr *);
-       int     (*access)  (struct inode *, struct nfs_access_entry *);
+       int     (*access)  (struct inode *, struct nfs_access_entry *, const struct cred *);
        int     (*readlink)(struct inode *, struct page *, unsigned int,
                            unsigned int);
        int     (*create)  (struct inode *, struct dentry *,
@@ -1795,6 +1797,7 @@ struct nfs_rpc_ops {
        struct nfs_server *(*create_server)(struct fs_context *);
        struct nfs_server *(*clone_server)(struct nfs_server *, struct nfs_fh *,
                                           struct nfs_fattr *, rpc_authflavor_t);
+       int     (*discover_trunking)(struct nfs_server *, struct nfs_fh *);
 };
 
 /*
index 38cace1..01e16c7 100644 (file)
@@ -26,6 +26,9 @@ void __page_table_check_pmd_set(struct mm_struct *mm, unsigned long addr,
                                pmd_t *pmdp, pmd_t pmd);
 void __page_table_check_pud_set(struct mm_struct *mm, unsigned long addr,
                                pud_t *pudp, pud_t pud);
+void __page_table_check_pte_clear_range(struct mm_struct *mm,
+                                       unsigned long addr,
+                                       pmd_t pmd);
 
 static inline void page_table_check_alloc(struct page *page, unsigned int order)
 {
@@ -100,6 +103,16 @@ static inline void page_table_check_pud_set(struct mm_struct *mm,
        __page_table_check_pud_set(mm, addr, pudp, pud);
 }
 
+static inline void page_table_check_pte_clear_range(struct mm_struct *mm,
+                                                   unsigned long addr,
+                                                   pmd_t pmd)
+{
+       if (static_branch_likely(&page_table_check_disabled))
+               return;
+
+       __page_table_check_pte_clear_range(mm, addr, pmd);
+}
+
 #else
 
 static inline void page_table_check_alloc(struct page *page, unsigned int order)
@@ -143,5 +156,11 @@ static inline void page_table_check_pud_set(struct mm_struct *mm,
 {
 }
 
+static inline void page_table_check_pte_clear_range(struct mm_struct *mm,
+                                                   unsigned long addr,
+                                                   pmd_t pmd)
+{
+}
+
 #endif /* CONFIG_PAGE_TABLE_CHECK */
 #endif /* __LINUX_PAGE_TABLE_CHECK_H */
index 117f230..7336491 100644 (file)
@@ -693,18 +693,6 @@ struct perf_event {
        u64                             total_time_running;
        u64                             tstamp;
 
-       /*
-        * timestamp shadows the actual context timing but it can
-        * be safely used in NMI interrupt context. It reflects the
-        * context time as it was when the event was last scheduled in,
-        * or when ctx_sched_in failed to schedule the event because we
-        * run out of PMC.
-        *
-        * ctx_time already accounts for ctx->timestamp. Therefore to
-        * compute ctx_time for a sample, simply add perf_clock().
-        */
-       u64                             shadow_ctx_time;
-
        struct perf_event_attr          attr;
        u16                             header_size;
        u16                             id_header_size;
@@ -852,6 +840,7 @@ struct perf_event_context {
         */
        u64                             time;
        u64                             timestamp;
+       u64                             timeoffset;
 
        /*
         * These fields let us detect when two contexts have both
@@ -934,6 +923,8 @@ struct bpf_perf_event_data_kern {
 struct perf_cgroup_info {
        u64                             time;
        u64                             timestamp;
+       u64                             timeoffset;
+       int                             active;
 };
 
 struct perf_cgroup {
index bc8713a..f4f4077 100644 (file)
@@ -62,6 +62,7 @@ static inline unsigned long pte_index(unsigned long address)
 {
        return (address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1);
 }
+#define pte_index pte_index
 
 #ifndef pmd_index
 static inline unsigned long pmd_index(unsigned long address)
index 7c7e627..07481bb 100644 (file)
@@ -86,4 +86,9 @@ extern struct pid_namespace *task_active_pid_ns(struct task_struct *tsk);
 void pidhash_init(void);
 void pid_idr_init(void);
 
+static inline bool task_is_in_init_pid_ns(struct task_struct *tsk)
+{
+       return task_active_pid_ns(tsk) == &init_pid_ns;
+}
+
 #endif /* _LINUX_PID_NS_H */
index a70ca83..7f7d1d8 100644 (file)
@@ -25,18 +25,17 @@ void psi_memstall_enter(unsigned long *flags);
 void psi_memstall_leave(unsigned long *flags);
 
 int psi_show(struct seq_file *s, struct psi_group *group, enum psi_res res);
-
-#ifdef CONFIG_CGROUPS
-int psi_cgroup_alloc(struct cgroup *cgrp);
-void psi_cgroup_free(struct cgroup *cgrp);
-void cgroup_move_task(struct task_struct *p, struct css_set *to);
-
 struct psi_trigger *psi_trigger_create(struct psi_group *group,
                        char *buf, size_t nbytes, enum psi_res res);
-void psi_trigger_replace(void **trigger_ptr, struct psi_trigger *t);
+void psi_trigger_destroy(struct psi_trigger *t);
 
 __poll_t psi_trigger_poll(void **trigger_ptr, struct file *file,
                        poll_table *wait);
+
+#ifdef CONFIG_CGROUPS
+int psi_cgroup_alloc(struct cgroup *cgrp);
+void psi_cgroup_free(struct cgroup *cgrp);
+void cgroup_move_task(struct task_struct *p, struct css_set *to);
 #endif
 
 #else /* CONFIG_PSI */
index 516c0fe..1a3cef2 100644 (file)
@@ -141,9 +141,6 @@ struct psi_trigger {
         * events to one per window
         */
        u64 last_event_time;
-
-       /* Refcounting to prevent premature destruction */
-       struct kref refcount;
 };
 
 struct psi_group {
index 18ebd39..fd692b4 100644 (file)
@@ -91,7 +91,7 @@ extern bool qid_valid(struct kqid qid);
  *
  *     When there is no mapping defined for the user-namespace, type,
  *     qid tuple an invalid kqid is returned.  Callers are expected to
- *     test for and handle handle invalid kqids being returned.
+ *     test for and handle invalid kqids being returned.
  *     Invalid kqids may be tested for using qid_valid().
  */
 static inline struct kqid make_kqid(struct user_namespace *from,
index 508b91d..75ba8aa 100644 (file)
@@ -619,10 +619,6 @@ struct sched_dl_entity {
         * task has to wait for a replenishment to be performed at the
         * next firing of dl_timer.
         *
-        * @dl_boosted tells if we are boosted due to DI. If so we are
-        * outside bandwidth enforcement mechanism (but only until we
-        * exit the critical section);
-        *
         * @dl_yielded tells if task gave up the CPU before consuming
         * all its available runtime during the last job.
         *
@@ -1684,7 +1680,6 @@ extern struct pid *cad_pid;
 #define PF_MEMALLOC            0x00000800      /* Allocating memory */
 #define PF_NPROC_EXCEEDED      0x00001000      /* set_user() noticed that RLIMIT_NPROC was exceeded */
 #define PF_USED_MATH           0x00002000      /* If unset the fpu must be initialized before use */
-#define PF_USED_ASYNC          0x00004000      /* Used async_schedule*(), used by module init */
 #define PF_NOFREEZE            0x00008000      /* This thread should not be frozen */
 #define PF_FROZEN              0x00010000      /* Frozen for system suspend */
 #define PF_KSWAPD              0x00020000      /* I am kswapd */
index bf11e1f..8a636e6 100644 (file)
@@ -318,7 +318,7 @@ enum skb_drop_reason {
        SKB_DROP_REASON_NO_SOCKET,
        SKB_DROP_REASON_PKT_TOO_SMALL,
        SKB_DROP_REASON_TCP_CSUM,
-       SKB_DROP_REASON_TCP_FILTER,
+       SKB_DROP_REASON_SOCKET_FILTER,
        SKB_DROP_REASON_UDP_CSUM,
        SKB_DROP_REASON_MAX,
 };
index 5785d90..3e8ecde 100644 (file)
@@ -430,15 +430,7 @@ struct platform_hibernation_ops {
 
 #ifdef CONFIG_HIBERNATION
 /* kernel/power/snapshot.c */
-extern void __register_nosave_region(unsigned long b, unsigned long e, int km);
-static inline void __init register_nosave_region(unsigned long b, unsigned long e)
-{
-       __register_nosave_region(b, e, 0);
-}
-static inline void __init register_nosave_region_late(unsigned long b, unsigned long e)
-{
-       __register_nosave_region(b, e, 1);
-}
+extern void register_nosave_region(unsigned long b, unsigned long e);
 extern int swsusp_page_is_forbidden(struct page *);
 extern void swsusp_set_page_free(struct page *);
 extern void swsusp_unset_page_free(struct page *);
@@ -458,7 +450,6 @@ int pfn_is_nosave(unsigned long pfn);
 int hibernate_quiet_exec(int (*func)(void *data), void *data);
 #else /* CONFIG_HIBERNATION */
 static inline void register_nosave_region(unsigned long b, unsigned long e) {}
-static inline void register_nosave_region_late(unsigned long b, unsigned long e) {}
 static inline int swsusp_page_is_forbidden(struct page *p) { return 0; }
 static inline void swsusp_set_page_free(struct page *p) {}
 static inline void swsusp_unset_page_free(struct page *p) {}
index 180adf7..6353d6d 100644 (file)
@@ -265,7 +265,7 @@ static inline struct ctl_table_header *register_sysctl_table(struct ctl_table *
        return NULL;
 }
 
-static inline struct sysctl_header *register_sysctl_mount_point(const char *path)
+static inline struct ctl_table_header *register_sysctl_mount_point(const char *path)
 {
        return NULL;
 }
index 031f148..b5deafd 100644 (file)
@@ -92,6 +92,12 @@ fwnode_usb_role_switch_get(struct fwnode_handle *node)
 static inline void usb_role_switch_put(struct usb_role_switch *sw) { }
 
 static inline struct usb_role_switch *
+usb_role_switch_find_by_fwnode(const struct fwnode_handle *fwnode)
+{
+       return NULL;
+}
+
+static inline struct usb_role_switch *
 usb_role_switch_register(struct device *parent,
                         const struct usb_role_switch_desc *desc)
 {
index 78ea3e3..e7ce719 100644 (file)
@@ -6,6 +6,8 @@
 #define RTR_SOLICITATION_INTERVAL      (4*HZ)
 #define RTR_SOLICITATION_MAX_INTERVAL  (3600*HZ)       /* 1 hour */
 
+#define MIN_VALID_LIFETIME             (2*3600)        /* 2 hours */
+
 #define TEMP_VALID_LIFETIME            (7*86400)
 #define TEMP_PREFERRED_LIFETIME                (86400)
 #define REGEN_MAX_RETRY                        (3)
index 526e495..8221af1 100644 (file)
@@ -239,6 +239,7 @@ typedef struct ax25_dev {
 #if defined(CONFIG_AX25_DAMA_SLAVE) || defined(CONFIG_AX25_DAMA_MASTER)
        ax25_dama_info          dama;
 #endif
+       refcount_t              refcount;
 } ax25_dev;
 
 typedef struct ax25_cb {
@@ -293,6 +294,17 @@ static __inline__ void ax25_cb_put(ax25_cb *ax25)
        }
 }
 
+static inline void ax25_dev_hold(ax25_dev *ax25_dev)
+{
+       refcount_inc(&ax25_dev->refcount);
+}
+
+static inline void ax25_dev_put(ax25_dev *ax25_dev)
+{
+       if (refcount_dec_and_test(&ax25_dev->refcount)) {
+               kfree(ax25_dev);
+       }
+}
 static inline __be16 ax25_type_trans(struct sk_buff *skb, struct net_device *dev)
 {
        skb->dev      = dev;
index f6ae3a4..83cfd2d 100644 (file)
@@ -346,7 +346,7 @@ static inline bool bond_uses_primary(struct bonding *bond)
 
 static inline struct net_device *bond_option_active_slave_get_rcu(struct bonding *bond)
 {
-       struct slave *slave = rcu_dereference(bond->curr_active_slave);
+       struct slave *slave = rcu_dereference_rtnl(bond->curr_active_slave);
 
        return bond_uses_primary(bond) && slave ? slave->dev : NULL;
 }
index 81e23a1..b51bae4 100644 (file)
@@ -525,19 +525,18 @@ static inline void ip_select_ident_segs(struct net *net, struct sk_buff *skb,
 {
        struct iphdr *iph = ip_hdr(skb);
 
+       /* We had many attacks based on IPID, use the private
+        * generator as much as we can.
+        */
+       if (sk && inet_sk(sk)->inet_daddr) {
+               iph->id = htons(inet_sk(sk)->inet_id);
+               inet_sk(sk)->inet_id += segs;
+               return;
+       }
        if ((iph->frag_off & htons(IP_DF)) && !skb->ignore_df) {
-               /* This is only to work around buggy Windows95/2000
-                * VJ compression implementations.  If the ID field
-                * does not change, they drop every other packet in
-                * a TCP stream using header compression.
-                */
-               if (sk && inet_sk(sk)->inet_daddr) {
-                       iph->id = htons(inet_sk(sk)->inet_id);
-                       inet_sk(sk)->inet_id += segs;
-               } else {
-                       iph->id = 0;
-               }
+               iph->id = 0;
        } else {
+               /* Unfortunately we need the big hammer to get a suitable IPID */
                __ip_select_ident(net, iph, segs);
        }
 }
index a9a4ccc..40ae8f1 100644 (file)
@@ -282,7 +282,7 @@ static inline bool fib6_get_cookie_safe(const struct fib6_info *f6i,
        fn = rcu_dereference(f6i->fib6_node);
 
        if (fn) {
-               *cookie = fn->fn_sernum;
+               *cookie = READ_ONCE(fn->fn_sernum);
                /* pairs with smp_wmb() in __fib6_update_sernum_upto_root() */
                smp_rmb();
                status = true;
index 937389e..87419f7 100644 (file)
@@ -350,7 +350,8 @@ static inline struct neighbour *neigh_create(struct neigh_table *tbl,
        return __neigh_create(tbl, pkey, dev, true);
 }
 void neigh_destroy(struct neighbour *neigh);
-int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb);
+int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb,
+                      const bool immediate_ok);
 int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, u32 flags,
                 u32 nlmsg_pid);
 void __neigh_set_probe_once(struct neighbour *neigh);
@@ -460,17 +461,24 @@ static inline struct neighbour * neigh_clone(struct neighbour *neigh)
 
 #define neigh_hold(n)  refcount_inc(&(n)->refcnt)
 
-static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
+static __always_inline int neigh_event_send_probe(struct neighbour *neigh,
+                                                 struct sk_buff *skb,
+                                                 const bool immediate_ok)
 {
        unsigned long now = jiffies;
-       
+
        if (READ_ONCE(neigh->used) != now)
                WRITE_ONCE(neigh->used, now);
-       if (!(neigh->nud_state&(NUD_CONNECTED|NUD_DELAY|NUD_PROBE)))
-               return __neigh_event_send(neigh, skb);
+       if (!(neigh->nud_state & (NUD_CONNECTED | NUD_DELAY | NUD_PROBE)))
+               return __neigh_event_send(neigh, skb, immediate_ok);
        return 0;
 }
 
+static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
+{
+       return neigh_event_send_probe(neigh, skb, true);
+}
+
 #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
 static inline int neigh_hh_bridge(struct hh_cache *hh, struct sk_buff *skb)
 {
index 4c858dc..25404fc 100644 (file)
@@ -370,7 +370,7 @@ static inline struct neighbour *ip_neigh_gw4(struct net_device *dev,
 {
        struct neighbour *neigh;
 
-       neigh = __ipv4_neigh_lookup_noref(dev, daddr);
+       neigh = __ipv4_neigh_lookup_noref(dev, (__force u32)daddr);
        if (unlikely(!neigh))
                neigh = __neigh_create(&arp_tbl, &daddr, dev, false);
 
index 44e442b..b9fc978 100644 (file)
@@ -1369,6 +1369,7 @@ static inline bool tcp_checksum_complete(struct sk_buff *skb)
 
 bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb);
 
+#ifdef CONFIG_INET
 void __sk_defer_free_flush(struct sock *sk);
 
 static inline void sk_defer_free_flush(struct sock *sk)
@@ -1377,6 +1378,9 @@ static inline void sk_defer_free_flush(struct sock *sk)
                return;
        __sk_defer_free_flush(sk);
 }
+#else
+static inline void sk_defer_free_flush(struct sock *sk) {}
+#endif
 
 int tcp_filter(struct sock *sk, struct sk_buff *skb);
 void tcp_set_state(struct sock *sk, int state);
index 9b187d8..36da42c 100644 (file)
@@ -617,6 +617,7 @@ void snd_pcm_stream_unlock(struct snd_pcm_substream *substream);
 void snd_pcm_stream_lock_irq(struct snd_pcm_substream *substream);
 void snd_pcm_stream_unlock_irq(struct snd_pcm_substream *substream);
 unsigned long _snd_pcm_stream_lock_irqsave(struct snd_pcm_substream *substream);
+unsigned long _snd_pcm_stream_lock_irqsave_nested(struct snd_pcm_substream *substream);
 
 /**
  * snd_pcm_stream_lock_irqsave - Lock the PCM stream
@@ -636,6 +637,20 @@ void snd_pcm_stream_unlock_irqrestore(struct snd_pcm_substream *substream,
                                      unsigned long flags);
 
 /**
+ * snd_pcm_stream_lock_irqsave_nested - Single-nested PCM stream locking
+ * @substream: PCM substream
+ * @flags: irq flags
+ *
+ * This locks the PCM stream like snd_pcm_stream_lock_irqsave() but with
+ * the single-depth lockdep subclass.
+ */
+#define snd_pcm_stream_lock_irqsave_nested(substream, flags)           \
+       do {                                                            \
+               typecheck(unsigned long, flags);                        \
+               flags = _snd_pcm_stream_lock_irqsave_nested(substream); \
+       } while (0)
+
+/**
  * snd_pcm_group_for_each_entry - iterate over the linked substreams
  * @s: the iterator
  * @substream: the substream
index 3e042ca..a8a64b9 100644 (file)
@@ -14,7 +14,7 @@
        EM(SKB_DROP_REASON_NO_SOCKET, NO_SOCKET)                \
        EM(SKB_DROP_REASON_PKT_TOO_SMALL, PKT_TOO_SMALL)        \
        EM(SKB_DROP_REASON_TCP_CSUM, TCP_CSUM)                  \
-       EM(SKB_DROP_REASON_TCP_FILTER, TCP_FILTER)              \
+       EM(SKB_DROP_REASON_SOCKET_FILTER, SOCKET_FILTER)        \
        EM(SKB_DROP_REASON_UDP_CSUM, UDP_CSUM)                  \
        EMe(SKB_DROP_REASON_MAX, MAX)
 
index 1e566ac..29982d6 100644 (file)
@@ -794,6 +794,9 @@ RPC_SHOW_SOCKET
 
 RPC_SHOW_SOCK
 
+
+#include <trace/events/net_probe_common.h>
+
 /*
  * Now redefine the EM() and EMe() macros to map the enums to the strings
  * that will be printed in the output.
@@ -816,27 +819,32 @@ DECLARE_EVENT_CLASS(xs_socket_event,
                        __field(unsigned int, socket_state)
                        __field(unsigned int, sock_state)
                        __field(unsigned long long, ino)
-                       __string(dstaddr,
-                               xprt->address_strings[RPC_DISPLAY_ADDR])
-                       __string(dstport,
-                               xprt->address_strings[RPC_DISPLAY_PORT])
+                       __array(__u8, saddr, sizeof(struct sockaddr_in6))
+                       __array(__u8, daddr, sizeof(struct sockaddr_in6))
                ),
 
                TP_fast_assign(
                        struct inode *inode = SOCK_INODE(socket);
+                       const struct sock *sk = socket->sk;
+                       const struct inet_sock *inet = inet_sk(sk);
+
+                       memset(__entry->saddr, 0, sizeof(struct sockaddr_in6));
+                       memset(__entry->daddr, 0, sizeof(struct sockaddr_in6));
+
+                       TP_STORE_ADDR_PORTS(__entry, inet, sk);
+
                        __entry->socket_state = socket->state;
                        __entry->sock_state = socket->sk->sk_state;
                        __entry->ino = (unsigned long long)inode->i_ino;
-                       __assign_str(dstaddr,
-                               xprt->address_strings[RPC_DISPLAY_ADDR]);
-                       __assign_str(dstport,
-                               xprt->address_strings[RPC_DISPLAY_PORT]);
+
                ),
 
                TP_printk(
-                       "socket:[%llu] dstaddr=%s/%s "
+                       "socket:[%llu] srcaddr=%pISpc dstaddr=%pISpc "
                        "state=%u (%s) sk_state=%u (%s)",
-                       __entry->ino, __get_str(dstaddr), __get_str(dstport),
+                       __entry->ino,
+                       __entry->saddr,
+                       __entry->daddr,
                        __entry->socket_state,
                        rpc_show_socket_state(__entry->socket_state),
                        __entry->sock_state,
@@ -866,29 +874,33 @@ DECLARE_EVENT_CLASS(xs_socket_event_done,
                        __field(unsigned int, socket_state)
                        __field(unsigned int, sock_state)
                        __field(unsigned long long, ino)
-                       __string(dstaddr,
-                               xprt->address_strings[RPC_DISPLAY_ADDR])
-                       __string(dstport,
-                               xprt->address_strings[RPC_DISPLAY_PORT])
+                       __array(__u8, saddr, sizeof(struct sockaddr_in6))
+                       __array(__u8, daddr, sizeof(struct sockaddr_in6))
                ),
 
                TP_fast_assign(
                        struct inode *inode = SOCK_INODE(socket);
+                       const struct sock *sk = socket->sk;
+                       const struct inet_sock *inet = inet_sk(sk);
+
+                       memset(__entry->saddr, 0, sizeof(struct sockaddr_in6));
+                       memset(__entry->daddr, 0, sizeof(struct sockaddr_in6));
+
+                       TP_STORE_ADDR_PORTS(__entry, inet, sk);
+
                        __entry->socket_state = socket->state;
                        __entry->sock_state = socket->sk->sk_state;
                        __entry->ino = (unsigned long long)inode->i_ino;
                        __entry->error = error;
-                       __assign_str(dstaddr,
-                               xprt->address_strings[RPC_DISPLAY_ADDR]);
-                       __assign_str(dstport,
-                               xprt->address_strings[RPC_DISPLAY_PORT]);
                ),
 
                TP_printk(
-                       "error=%d socket:[%llu] dstaddr=%s/%s "
+                       "error=%d socket:[%llu] srcaddr=%pISpc dstaddr=%pISpc "
                        "state=%u (%s) sk_state=%u (%s)",
                        __entry->error,
-                       __entry->ino, __get_str(dstaddr), __get_str(dstport),
+                       __entry->ino,
+                       __entry->saddr,
+                       __entry->daddr,
                        __entry->socket_state,
                        rpc_show_socket_state(__entry->socket_state),
                        __entry->sock_state,
@@ -953,7 +965,8 @@ TRACE_EVENT(rpc_socket_nospace,
                { BIT(XPRT_REMOVE),             "REMOVE" },             \
                { BIT(XPRT_CONGESTED),          "CONGESTED" },          \
                { BIT(XPRT_CWND_WAIT),          "CWND_WAIT" },          \
-               { BIT(XPRT_WRITE_SPACE),        "WRITE_SPACE" })
+               { BIT(XPRT_WRITE_SPACE),        "WRITE_SPACE" },        \
+               { BIT(XPRT_SND_IS_COOKIE),      "SND_IS_COOKIE" })
 
 DECLARE_EVENT_CLASS(rpc_xprt_lifetime_class,
        TP_PROTO(
@@ -1150,8 +1163,11 @@ DECLARE_EVENT_CLASS(xprt_writelock_event,
                        __entry->task_id = -1;
                        __entry->client_id = -1;
                }
-               __entry->snd_task_id = xprt->snd_task ?
-                                       xprt->snd_task->tk_pid : -1;
+               if (xprt->snd_task &&
+                   !test_bit(XPRT_SND_IS_COOKIE, &xprt->state))
+                       __entry->snd_task_id = xprt->snd_task->tk_pid;
+               else
+                       __entry->snd_task_id = -1;
        ),
 
        TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
@@ -1196,8 +1212,12 @@ DECLARE_EVENT_CLASS(xprt_cong_event,
                        __entry->task_id = -1;
                        __entry->client_id = -1;
                }
-               __entry->snd_task_id = xprt->snd_task ?
-                                       xprt->snd_task->tk_pid : -1;
+               if (xprt->snd_task &&
+                   !test_bit(XPRT_SND_IS_COOKIE, &xprt->state))
+                       __entry->snd_task_id = xprt->snd_task->tk_pid;
+               else
+                       __entry->snd_task_id = -1;
+
                __entry->cong = xprt->cong;
                __entry->cwnd = xprt->cwnd;
                __entry->wait = test_bit(XPRT_CWND_WAIT, &xprt->state);
index ea4405d..5d48c46 100644 (file)
@@ -23,8 +23,9 @@
 
 #undef __get_rel_dynamic_array
 #define __get_rel_dynamic_array(field) \
-               ((void *)(&__entry->__rel_loc_##field) +        \
-                sizeof(__entry->__rel_loc_##field) +           \
+               ((void *)__entry +                                      \
+                offsetof(typeof(*__entry), __rel_loc_##field) +        \
+                sizeof(__entry->__rel_loc_##field) +                   \
                 (__entry->__rel_loc_##field & 0xffff))
 
 #undef __get_rel_dynamic_array_len
index 8c6f7c4..3d29919 100644 (file)
@@ -128,7 +128,7 @@ TRACE_MAKE_SYSTEM_STR();
        struct trace_event_raw_##name {                                 \
                struct trace_entry      ent;                            \
                tstruct                                                 \
-               char                    __data[0];                      \
+               char                    __data[];                       \
        };                                                              \
                                                                        \
        static struct trace_event_class event_class_##name;
@@ -318,9 +318,10 @@ TRACE_MAKE_SYSTEM_STR();
 #define __get_str(field) ((char *)__get_dynamic_array(field))
 
 #undef __get_rel_dynamic_array
-#define __get_rel_dynamic_array(field) \
-               ((void *)(&__entry->__rel_loc_##field) +        \
-                sizeof(__entry->__rel_loc_##field) +           \
+#define __get_rel_dynamic_array(field)                                 \
+               ((void *)__entry +                                      \
+                offsetof(typeof(*__entry), __rel_loc_##field) +        \
+                sizeof(__entry->__rel_loc_##field) +                   \
                 (__entry->__rel_loc_##field & 0xffff))
 
 #undef __get_rel_dynamic_array_len
diff --git a/include/uapi/linux/cyclades.h b/include/uapi/linux/cyclades.h
new file mode 100644 (file)
index 0000000..6225c5a
--- /dev/null
@@ -0,0 +1,35 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+
+#ifndef _UAPI_LINUX_CYCLADES_H
+#define _UAPI_LINUX_CYCLADES_H
+
+#warning "Support for features provided by this header has been removed"
+#warning "Please consider updating your code"
+
+struct cyclades_monitor {
+       unsigned long int_count;
+       unsigned long char_count;
+       unsigned long char_max;
+       unsigned long char_last;
+};
+
+#define CYGETMON               0x435901
+#define CYGETTHRESH            0x435902
+#define CYSETTHRESH            0x435903
+#define CYGETDEFTHRESH         0x435904
+#define CYSETDEFTHRESH         0x435905
+#define CYGETTIMEOUT           0x435906
+#define CYSETTIMEOUT           0x435907
+#define CYGETDEFTIMEOUT                0x435908
+#define CYSETDEFTIMEOUT                0x435909
+#define CYSETRFLOW             0x43590a
+#define CYGETRFLOW             0x43590b
+#define CYSETRTSDTR_INV                0x43590c
+#define CYGETRTSDTR_INV                0x43590d
+#define CYZSETPOLLCYCLE                0x43590e
+#define CYZGETPOLLCYCLE                0x43590f
+#define CYGETCD1400VER         0x435910
+#define CYSETWAIT              0x435912
+#define CYGETWAIT              0x435913
+
+#endif /* _UAPI_LINUX_CYCLADES_H */
index 9563d29..5191b57 100644 (file)
@@ -1133,6 +1133,7 @@ struct kvm_ppc_resize_hpt {
 #define KVM_CAP_VM_MOVE_ENC_CONTEXT_FROM 206
 #define KVM_CAP_VM_GPA_BITS 207
 #define KVM_CAP_XSAVE2 208
+#define KVM_CAP_SYS_ATTRIBUTES 209
 
 #ifdef KVM_CAP_IRQ_ROUTING
 
@@ -1623,9 +1624,6 @@ struct kvm_enc_region {
 #define KVM_S390_NORMAL_RESET  _IO(KVMIO,   0xc3)
 #define KVM_S390_CLEAR_RESET   _IO(KVMIO,   0xc4)
 
-/* Available with KVM_CAP_XSAVE2 */
-#define KVM_GET_XSAVE2           _IOR(KVMIO,  0xcf, struct kvm_xsave)
-
 struct kvm_s390_pv_sec_parm {
        __u64 origin;
        __u64 length;
@@ -2047,4 +2045,7 @@ struct kvm_stats_desc {
 
 #define KVM_GET_STATS_FD  _IO(KVMIO,  0xce)
 
+/* Available with KVM_CAP_XSAVE2 */
+#define KVM_GET_XSAVE2           _IOR(KVMIO,  0xcf, struct kvm_xsave)
+
 #endif /* __LINUX_KVM_H */
index 1b65042..82858b6 100644 (file)
@@ -465,6 +465,8 @@ struct perf_event_attr {
        /*
         * User provided data if sigtrap=1, passed back to user via
         * siginfo_t::si_perf_data, e.g. to permit user to identify the event.
+        * Note, siginfo_t::si_perf_data is long-sized, and sig_data will be
+        * truncated accordingly on 32 bit architectures.
         */
        __u64   sig_data;
 };
index c7008d8..8cb3a6f 100644 (file)
@@ -84,12 +84,11 @@ struct smc_diag_conninfo {
 /* SMC_DIAG_LINKINFO */
 
 struct smc_diag_linkinfo {
-       __u8            link_id;                    /* link identifier */
-       __u8            ibname[IB_DEVICE_NAME_MAX]; /* name of the RDMA device */
-       __u8            ibport;                     /* RDMA device port number */
-       __u8            gid[40];                    /* local GID */
-       __u8            peer_gid[40];               /* peer GID */
-       __aligned_u64   net_cookie;                 /* RDMA device net namespace */
+       __u8 link_id;                   /* link identifier */
+       __u8 ibname[IB_DEVICE_NAME_MAX]; /* name of the RDMA device */
+       __u8 ibport;                    /* RDMA device port number */
+       __u8 gid[40];                   /* local GID */
+       __u8 peer_gid[40];              /* peer GID */
 };
 
 struct smc_diag_lgrinfo {
index ef0cafe..2d3e5df 100644 (file)
  *                                                                          *
  ****************************************************************************/
 
+#define AES_IEC958_STATUS_SIZE         24
+
 struct snd_aes_iec958 {
-       unsigned char status[24];       /* AES/IEC958 channel status bits */
+       unsigned char status[AES_IEC958_STATUS_SIZE]; /* AES/IEC958 channel status bits */
        unsigned char subcode[147];     /* AES/IEC958 subcode bits */
        unsigned char pad;              /* nothing */
        unsigned char dig_subframe[4];  /* AES/IEC958 subframe bits */
index 9ac5515..7a71453 100644 (file)
@@ -47,7 +47,13 @@ struct ioctl_gntdev_grant_ref {
 /*
  * Inserts the grant references into the mapping table of an instance
  * of gntdev. N.B. This does not perform the mapping, which is deferred
- * until mmap() is called with @index as the offset.
+ * until mmap() is called with @index as the offset. @index should be
+ * considered opaque to userspace, with one exception: if no grant
+ * references have ever been inserted into the mapping table of this
+ * instance, @index will be set to 0. This is necessary to use gntdev
+ * with userspace APIs that expect a file descriptor that can be
+ * mmap()'d at offset 0, such as Wayland. If @count is set to 0, this
+ * ioctl will fail.
  */
 #define IOCTL_GNTDEV_MAP_GRANT_REF \
 _IOC(_IOC_NONE, 'G', 0, sizeof(struct ioctl_gntdev_map_grant_ref))
index bbee8c6..4dc45a5 100644 (file)
@@ -1,6 +1,4 @@
 /******************************************************************************
- * evtchn.h
- *
  * Interface to /dev/xen/xenbus_backend.
  *
  * Copyright (c) 2011 Bastian Blank <waldi@debian.org>
index 6693daf..0dbdb98 100644 (file)
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -1964,6 +1964,7 @@ static struct sem_undo *find_alloc_undo(struct ipc_namespace *ns, int semid)
         */
        un = lookup_undo(ulp, semid);
        if (un) {
+               spin_unlock(&ulp->lock);
                kvfree(new);
                goto success;
        }
@@ -1976,9 +1977,8 @@ static struct sem_undo *find_alloc_undo(struct ipc_namespace *ns, int semid)
        ipc_assert_locked_object(&sma->sem_perm);
        list_add(&new->list_id, &sma->list_id);
        un = new;
-
-success:
        spin_unlock(&ulp->lock);
+success:
        sem_unlock(sma, -1);
 out:
        return un;
index b8d7a66..b2c4ba5 100644 (file)
@@ -205,9 +205,6 @@ async_cookie_t async_schedule_node_domain(async_func_t func, void *data,
        atomic_inc(&entry_count);
        spin_unlock_irqrestore(&async_lock, flags);
 
-       /* mark that this task has queued an async job, used by module init */
-       current->flags |= PF_USED_ASYNC;
-
        /* schedule for execution */
        queue_work_node(node, system_unbound_wq, &entry->work);
 
index e4bbe2c..7690c29 100644 (file)
@@ -541,20 +541,22 @@ static void kauditd_printk_skb(struct sk_buff *skb)
 /**
  * kauditd_rehold_skb - Handle a audit record send failure in the hold queue
  * @skb: audit record
+ * @error: error code (unused)
  *
  * Description:
  * This should only be used by the kauditd_thread when it fails to flush the
  * hold queue.
  */
-static void kauditd_rehold_skb(struct sk_buff *skb)
+static void kauditd_rehold_skb(struct sk_buff *skb, __always_unused int error)
 {
-       /* put the record back in the queue at the same place */
-       skb_queue_head(&audit_hold_queue, skb);
+       /* put the record back in the queue */
+       skb_queue_tail(&audit_hold_queue, skb);
 }
 
 /**
  * kauditd_hold_skb - Queue an audit record, waiting for auditd
  * @skb: audit record
+ * @error: error code
  *
  * Description:
  * Queue the audit record, waiting for an instance of auditd.  When this
@@ -564,19 +566,31 @@ static void kauditd_rehold_skb(struct sk_buff *skb)
  * and queue it, if we have room.  If we want to hold on to the record, but we
  * don't have room, record a record lost message.
  */
-static void kauditd_hold_skb(struct sk_buff *skb)
+static void kauditd_hold_skb(struct sk_buff *skb, int error)
 {
        /* at this point it is uncertain if we will ever send this to auditd so
         * try to send the message via printk before we go any further */
        kauditd_printk_skb(skb);
 
        /* can we just silently drop the message? */
-       if (!audit_default) {
-               kfree_skb(skb);
-               return;
+       if (!audit_default)
+               goto drop;
+
+       /* the hold queue is only for when the daemon goes away completely,
+        * not -EAGAIN failures; if we are in a -EAGAIN state requeue the
+        * record on the retry queue unless it's full, in which case drop it
+        */
+       if (error == -EAGAIN) {
+               if (!audit_backlog_limit ||
+                   skb_queue_len(&audit_retry_queue) < audit_backlog_limit) {
+                       skb_queue_tail(&audit_retry_queue, skb);
+                       return;
+               }
+               audit_log_lost("kauditd retry queue overflow");
+               goto drop;
        }
 
-       /* if we have room, queue the message */
+       /* if we have room in the hold queue, queue the message */
        if (!audit_backlog_limit ||
            skb_queue_len(&audit_hold_queue) < audit_backlog_limit) {
                skb_queue_tail(&audit_hold_queue, skb);
@@ -585,24 +599,32 @@ static void kauditd_hold_skb(struct sk_buff *skb)
 
        /* we have no other options - drop the message */
        audit_log_lost("kauditd hold queue overflow");
+drop:
        kfree_skb(skb);
 }
 
 /**
  * kauditd_retry_skb - Queue an audit record, attempt to send again to auditd
  * @skb: audit record
+ * @error: error code (unused)
  *
  * Description:
  * Not as serious as kauditd_hold_skb() as we still have a connected auditd,
  * but for some reason we are having problems sending it audit records so
  * queue the given record and attempt to resend.
  */
-static void kauditd_retry_skb(struct sk_buff *skb)
+static void kauditd_retry_skb(struct sk_buff *skb, __always_unused int error)
 {
-       /* NOTE: because records should only live in the retry queue for a
-        * short period of time, before either being sent or moved to the hold
-        * queue, we don't currently enforce a limit on this queue */
-       skb_queue_tail(&audit_retry_queue, skb);
+       if (!audit_backlog_limit ||
+           skb_queue_len(&audit_retry_queue) < audit_backlog_limit) {
+               skb_queue_tail(&audit_retry_queue, skb);
+               return;
+       }
+
+       /* we have to drop the record, send it via printk as a last effort */
+       kauditd_printk_skb(skb);
+       audit_log_lost("kauditd retry queue overflow");
+       kfree_skb(skb);
 }
 
 /**
@@ -640,7 +662,7 @@ static void auditd_reset(const struct auditd_connection *ac)
        /* flush the retry queue to the hold queue, but don't touch the main
         * queue since we need to process that normally for multicast */
        while ((skb = skb_dequeue(&audit_retry_queue)))
-               kauditd_hold_skb(skb);
+               kauditd_hold_skb(skb, -ECONNREFUSED);
 }
 
 /**
@@ -714,16 +736,18 @@ static int kauditd_send_queue(struct sock *sk, u32 portid,
                              struct sk_buff_head *queue,
                              unsigned int retry_limit,
                              void (*skb_hook)(struct sk_buff *skb),
-                             void (*err_hook)(struct sk_buff *skb))
+                             void (*err_hook)(struct sk_buff *skb, int error))
 {
        int rc = 0;
-       struct sk_buff *skb;
+       struct sk_buff *skb = NULL;
+       struct sk_buff *skb_tail;
        unsigned int failed = 0;
 
        /* NOTE: kauditd_thread takes care of all our locking, we just use
         *       the netlink info passed to us (e.g. sk and portid) */
 
-       while ((skb = skb_dequeue(queue))) {
+       skb_tail = skb_peek_tail(queue);
+       while ((skb != skb_tail) && (skb = skb_dequeue(queue))) {
                /* call the skb_hook for each skb we touch */
                if (skb_hook)
                        (*skb_hook)(skb);
@@ -731,7 +755,7 @@ static int kauditd_send_queue(struct sock *sk, u32 portid,
                /* can we send to anyone via unicast? */
                if (!sk) {
                        if (err_hook)
-                               (*err_hook)(skb);
+                               (*err_hook)(skb, -ECONNREFUSED);
                        continue;
                }
 
@@ -745,7 +769,7 @@ retry:
                            rc == -ECONNREFUSED || rc == -EPERM) {
                                sk = NULL;
                                if (err_hook)
-                                       (*err_hook)(skb);
+                                       (*err_hook)(skb, rc);
                                if (rc == -EAGAIN)
                                        rc = 0;
                                /* continue to drain the queue */
index 0606237..9e4ecc9 100644 (file)
@@ -207,7 +207,7 @@ BTF_ID(func, bpf_lsm_socket_socketpair)
 
 BTF_ID(func, bpf_lsm_syslog)
 BTF_ID(func, bpf_lsm_task_alloc)
-BTF_ID(func, bpf_lsm_task_getsecid_subj)
+BTF_ID(func, bpf_lsm_current_getsecid_subj)
 BTF_ID(func, bpf_lsm_task_getsecid_obj)
 BTF_ID(func, bpf_lsm_task_prctl)
 BTF_ID(func, bpf_lsm_task_setscheduler)
index 638d7fd..710ba9d 100644 (file)
@@ -104,7 +104,7 @@ static struct bpf_ringbuf *bpf_ringbuf_area_alloc(size_t data_sz, int numa_node)
        }
 
        rb = vmap(pages, nr_meta_pages + 2 * nr_data_pages,
-                 VM_ALLOC | VM_USERMAP, PAGE_KERNEL);
+                 VM_MAP | VM_USERMAP, PAGE_KERNEL);
        if (rb) {
                kmemleak_not_leak(pages);
                rb->pages = pages;
index 49e5672..22c8ae9 100644 (file)
@@ -472,13 +472,14 @@ BPF_CALL_4(bpf_get_task_stack, struct task_struct *, task, void *, buf,
           u32, size, u64, flags)
 {
        struct pt_regs *regs;
-       long res;
+       long res = -EINVAL;
 
        if (!try_get_task_stack(task))
                return -EFAULT;
 
        regs = task_pt_regs(task);
-       res = __bpf_get_stack(regs, task, NULL, buf, size, flags);
+       if (regs)
+               res = __bpf_get_stack(regs, task, NULL, buf, size, flags);
        put_task_stack(task);
 
        return res;
index 4b6974a..5e7edf9 100644 (file)
@@ -550,11 +550,12 @@ static __always_inline u64 notrace bpf_prog_start_time(void)
 static void notrace inc_misses_counter(struct bpf_prog *prog)
 {
        struct bpf_prog_stats *stats;
+       unsigned int flags;
 
        stats = this_cpu_ptr(prog->stats);
-       u64_stats_update_begin(&stats->syncp);
+       flags = u64_stats_update_begin_irqsave(&stats->syncp);
        u64_stats_inc(&stats->misses);
-       u64_stats_update_end(&stats->syncp);
+       u64_stats_update_end_irqrestore(&stats->syncp, flags);
 }
 
 /* The logic is similar to bpf_prog_run(), but with an explicit
index 41e0837..0e877db 100644 (file)
@@ -549,6 +549,14 @@ static ssize_t cgroup_release_agent_write(struct kernfs_open_file *of,
 
        BUILD_BUG_ON(sizeof(cgrp->root->release_agent_path) < PATH_MAX);
 
+       /*
+        * Release agent gets called with all capabilities,
+        * require capabilities to set release agent.
+        */
+       if ((of->file->f_cred->user_ns != &init_user_ns) ||
+           !capable(CAP_SYS_ADMIN))
+               return -EPERM;
+
        cgrp = cgroup_kn_lock_live(of->kn, false);
        if (!cgrp)
                return -ENODEV;
@@ -954,6 +962,12 @@ int cgroup1_parse_param(struct fs_context *fc, struct fs_parameter *param)
                /* Specifying two release agents is forbidden */
                if (ctx->release_agent)
                        return invalfc(fc, "release_agent respecified");
+               /*
+                * Release agent gets called with all capabilities,
+                * require capabilities to set release agent.
+                */
+               if ((fc->user_ns != &init_user_ns) || !capable(CAP_SYS_ADMIN))
+                       return invalfc(fc, "Setting release_agent not allowed");
                ctx->release_agent = param->string;
                param->string = NULL;
                break;
index b31e146..9d05c3c 100644 (file)
@@ -3643,6 +3643,12 @@ static ssize_t cgroup_pressure_write(struct kernfs_open_file *of, char *buf,
        cgroup_get(cgrp);
        cgroup_kn_unlock(of->kn);
 
+       /* Allow only one trigger per file descriptor */
+       if (ctx->psi.trigger) {
+               cgroup_put(cgrp);
+               return -EBUSY;
+       }
+
        psi = cgroup_ino(cgrp) == 1 ? &psi_system : &cgrp->psi;
        new = psi_trigger_create(psi, buf, nbytes, res);
        if (IS_ERR(new)) {
@@ -3650,8 +3656,7 @@ static ssize_t cgroup_pressure_write(struct kernfs_open_file *of, char *buf,
                return PTR_ERR(new);
        }
 
-       psi_trigger_replace(&ctx->psi.trigger, new);
-
+       smp_store_release(&ctx->psi.trigger, new);
        cgroup_put(cgrp);
 
        return nbytes;
@@ -3690,7 +3695,7 @@ static void cgroup_pressure_release(struct kernfs_open_file *of)
 {
        struct cgroup_file_ctx *ctx = of->priv;
 
-       psi_trigger_replace(&ctx->psi.trigger, NULL);
+       psi_trigger_destroy(ctx->psi.trigger);
 }
 
 bool cgroup_psi_enabled(void)
index dc653ab..4c7254e 100644 (file)
@@ -591,6 +591,35 @@ static inline void free_cpuset(struct cpuset *cs)
 }
 
 /*
+ * validate_change_legacy() - Validate conditions specific to legacy (v1)
+ *                            behavior.
+ */
+static int validate_change_legacy(struct cpuset *cur, struct cpuset *trial)
+{
+       struct cgroup_subsys_state *css;
+       struct cpuset *c, *par;
+       int ret;
+
+       WARN_ON_ONCE(!rcu_read_lock_held());
+
+       /* Each of our child cpusets must be a subset of us */
+       ret = -EBUSY;
+       cpuset_for_each_child(c, css, cur)
+               if (!is_cpuset_subset(c, trial))
+                       goto out;
+
+       /* On legacy hierarchy, we must be a subset of our parent cpuset. */
+       ret = -EACCES;
+       par = parent_cs(cur);
+       if (par && !is_cpuset_subset(trial, par))
+               goto out;
+
+       ret = 0;
+out:
+       return ret;
+}
+
+/*
  * validate_change() - Used to validate that any proposed cpuset change
  *                    follows the structural rules for cpusets.
  *
@@ -614,20 +643,21 @@ static int validate_change(struct cpuset *cur, struct cpuset *trial)
 {
        struct cgroup_subsys_state *css;
        struct cpuset *c, *par;
-       int ret;
-
-       /* The checks don't apply to root cpuset */
-       if (cur == &top_cpuset)
-               return 0;
+       int ret = 0;
 
        rcu_read_lock();
-       par = parent_cs(cur);
 
-       /* On legacy hierarchy, we must be a subset of our parent cpuset. */
-       ret = -EACCES;
-       if (!is_in_v2_mode() && !is_cpuset_subset(trial, par))
+       if (!is_in_v2_mode())
+               ret = validate_change_legacy(cur, trial);
+       if (ret)
+               goto out;
+
+       /* Remaining checks don't apply to root cpuset */
+       if (cur == &top_cpuset)
                goto out;
 
+       par = parent_cs(cur);
+
        /*
         * If either I or some sibling (!= me) is exclusive, we can't
         * overlap
@@ -1175,9 +1205,7 @@ enum subparts_cmd {
  *
  * Because of the implicit cpu exclusive nature of a partition root,
  * cpumask changes that violates the cpu exclusivity rule will not be
- * permitted when checked by validate_change(). The validate_change()
- * function will also prevent any changes to the cpu list if it is not
- * a superset of children's cpu lists.
+ * permitted when checked by validate_change().
  */
 static int update_parent_subparts_cpumask(struct cpuset *cpuset, int cmd,
                                          struct cpumask *newmask,
@@ -1522,10 +1550,15 @@ static void update_sibling_cpumasks(struct cpuset *parent, struct cpuset *cs,
        struct cpuset *sibling;
        struct cgroup_subsys_state *pos_css;
 
+       percpu_rwsem_assert_held(&cpuset_rwsem);
+
        /*
         * Check all its siblings and call update_cpumasks_hier()
         * if their use_parent_ecpus flag is set in order for them
         * to use the right effective_cpus value.
+        *
+        * The update_cpumasks_hier() function may sleep. So we have to
+        * release the RCU read lock before calling it.
         */
        rcu_read_lock();
        cpuset_for_each_child(sibling, pos_css, parent) {
@@ -1533,8 +1566,13 @@ static void update_sibling_cpumasks(struct cpuset *parent, struct cpuset *cs,
                        continue;
                if (!sibling->use_parent_ecpus)
                        continue;
+               if (!css_tryget_online(&sibling->css))
+                       continue;
 
+               rcu_read_unlock();
                update_cpumasks_hier(sibling, tmp);
+               rcu_read_lock();
+               css_put(&sibling->css);
        }
        rcu_read_unlock();
 }
@@ -1607,8 +1645,7 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs,
         * Make sure that subparts_cpus is a subset of cpus_allowed.
         */
        if (cs->nr_subparts_cpus) {
-               cpumask_andnot(cs->subparts_cpus, cs->subparts_cpus,
-                              cs->cpus_allowed);
+               cpumask_and(cs->subparts_cpus, cs->subparts_cpus, cs->cpus_allowed);
                cs->nr_subparts_cpus = cpumask_weight(cs->subparts_cpus);
        }
        spin_unlock_irq(&callback_lock);
index fc18664..57c7197 100644 (file)
@@ -674,6 +674,23 @@ perf_event_set_state(struct perf_event *event, enum perf_event_state state)
        WRITE_ONCE(event->state, state);
 }
 
+/*
+ * UP store-release, load-acquire
+ */
+
+#define __store_release(ptr, val)                                      \
+do {                                                                   \
+       barrier();                                                      \
+       WRITE_ONCE(*(ptr), (val));                                      \
+} while (0)
+
+#define __load_acquire(ptr)                                            \
+({                                                                     \
+       __unqual_scalar_typeof(*(ptr)) ___p = READ_ONCE(*(ptr));        \
+       barrier();                                                      \
+       ___p;                                                           \
+})
+
 #ifdef CONFIG_CGROUP_PERF
 
 static inline bool
@@ -719,34 +736,51 @@ static inline u64 perf_cgroup_event_time(struct perf_event *event)
        return t->time;
 }
 
-static inline void __update_cgrp_time(struct perf_cgroup *cgrp)
+static inline u64 perf_cgroup_event_time_now(struct perf_event *event, u64 now)
 {
-       struct perf_cgroup_info *info;
-       u64 now;
-
-       now = perf_clock();
+       struct perf_cgroup_info *t;
 
-       info = this_cpu_ptr(cgrp->info);
+       t = per_cpu_ptr(event->cgrp->info, event->cpu);
+       if (!__load_acquire(&t->active))
+               return t->time;
+       now += READ_ONCE(t->timeoffset);
+       return now;
+}
 
-       info->time += now - info->timestamp;
+static inline void __update_cgrp_time(struct perf_cgroup_info *info, u64 now, bool adv)
+{
+       if (adv)
+               info->time += now - info->timestamp;
        info->timestamp = now;
+       /*
+        * see update_context_time()
+        */
+       WRITE_ONCE(info->timeoffset, info->time - info->timestamp);
 }
 
-static inline void update_cgrp_time_from_cpuctx(struct perf_cpu_context *cpuctx)
+static inline void update_cgrp_time_from_cpuctx(struct perf_cpu_context *cpuctx, bool final)
 {
        struct perf_cgroup *cgrp = cpuctx->cgrp;
        struct cgroup_subsys_state *css;
+       struct perf_cgroup_info *info;
 
        if (cgrp) {
+               u64 now = perf_clock();
+
                for (css = &cgrp->css; css; css = css->parent) {
                        cgrp = container_of(css, struct perf_cgroup, css);
-                       __update_cgrp_time(cgrp);
+                       info = this_cpu_ptr(cgrp->info);
+
+                       __update_cgrp_time(info, now, true);
+                       if (final)
+                               __store_release(&info->active, 0);
                }
        }
 }
 
 static inline void update_cgrp_time_from_event(struct perf_event *event)
 {
+       struct perf_cgroup_info *info;
        struct perf_cgroup *cgrp;
 
        /*
@@ -760,8 +794,10 @@ static inline void update_cgrp_time_from_event(struct perf_event *event)
        /*
         * Do not update time when cgroup is not active
         */
-       if (cgroup_is_descendant(cgrp->css.cgroup, event->cgrp->css.cgroup))
-               __update_cgrp_time(event->cgrp);
+       if (cgroup_is_descendant(cgrp->css.cgroup, event->cgrp->css.cgroup)) {
+               info = this_cpu_ptr(event->cgrp->info);
+               __update_cgrp_time(info, perf_clock(), true);
+       }
 }
 
 static inline void
@@ -785,7 +821,8 @@ perf_cgroup_set_timestamp(struct task_struct *task,
        for (css = &cgrp->css; css; css = css->parent) {
                cgrp = container_of(css, struct perf_cgroup, css);
                info = this_cpu_ptr(cgrp->info);
-               info->timestamp = ctx->timestamp;
+               __update_cgrp_time(info, ctx->timestamp, false);
+               __store_release(&info->active, 1);
        }
 }
 
@@ -982,14 +1019,6 @@ out:
 }
 
 static inline void
-perf_cgroup_set_shadow_time(struct perf_event *event, u64 now)
-{
-       struct perf_cgroup_info *t;
-       t = per_cpu_ptr(event->cgrp->info, event->cpu);
-       event->shadow_ctx_time = now - t->timestamp;
-}
-
-static inline void
 perf_cgroup_event_enable(struct perf_event *event, struct perf_event_context *ctx)
 {
        struct perf_cpu_context *cpuctx;
@@ -1066,7 +1095,8 @@ static inline void update_cgrp_time_from_event(struct perf_event *event)
 {
 }
 
-static inline void update_cgrp_time_from_cpuctx(struct perf_cpu_context *cpuctx)
+static inline void update_cgrp_time_from_cpuctx(struct perf_cpu_context *cpuctx,
+                                               bool final)
 {
 }
 
@@ -1098,12 +1128,12 @@ perf_cgroup_switch(struct task_struct *task, struct task_struct *next)
 {
 }
 
-static inline void
-perf_cgroup_set_shadow_time(struct perf_event *event, u64 now)
+static inline u64 perf_cgroup_event_time(struct perf_event *event)
 {
+       return 0;
 }
 
-static inline u64 perf_cgroup_event_time(struct perf_event *event)
+static inline u64 perf_cgroup_event_time_now(struct perf_event *event, u64 now)
 {
        return 0;
 }
@@ -1525,22 +1555,59 @@ static void perf_unpin_context(struct perf_event_context *ctx)
 /*
  * Update the record of the current time in a context.
  */
-static void update_context_time(struct perf_event_context *ctx)
+static void __update_context_time(struct perf_event_context *ctx, bool adv)
 {
        u64 now = perf_clock();
 
-       ctx->time += now - ctx->timestamp;
+       if (adv)
+               ctx->time += now - ctx->timestamp;
        ctx->timestamp = now;
+
+       /*
+        * The above: time' = time + (now - timestamp), can be re-arranged
+        * into: time` = now + (time - timestamp), which gives a single value
+        * offset to compute future time without locks on.
+        *
+        * See perf_event_time_now(), which can be used from NMI context where
+        * it's (obviously) not possible to acquire ctx->lock in order to read
+        * both the above values in a consistent manner.
+        */
+       WRITE_ONCE(ctx->timeoffset, ctx->time - ctx->timestamp);
+}
+
+static void update_context_time(struct perf_event_context *ctx)
+{
+       __update_context_time(ctx, true);
 }
 
 static u64 perf_event_time(struct perf_event *event)
 {
        struct perf_event_context *ctx = event->ctx;
 
+       if (unlikely(!ctx))
+               return 0;
+
        if (is_cgroup_event(event))
                return perf_cgroup_event_time(event);
 
-       return ctx ? ctx->time : 0;
+       return ctx->time;
+}
+
+static u64 perf_event_time_now(struct perf_event *event, u64 now)
+{
+       struct perf_event_context *ctx = event->ctx;
+
+       if (unlikely(!ctx))
+               return 0;
+
+       if (is_cgroup_event(event))
+               return perf_cgroup_event_time_now(event, now);
+
+       if (!(__load_acquire(&ctx->is_active) & EVENT_TIME))
+               return ctx->time;
+
+       now += READ_ONCE(ctx->timeoffset);
+       return now;
 }
 
 static enum event_type_t get_event_type(struct perf_event *event)
@@ -2350,7 +2417,7 @@ __perf_remove_from_context(struct perf_event *event,
 
        if (ctx->is_active & EVENT_TIME) {
                update_context_time(ctx);
-               update_cgrp_time_from_cpuctx(cpuctx);
+               update_cgrp_time_from_cpuctx(cpuctx, false);
        }
 
        event_sched_out(event, cpuctx, ctx);
@@ -2361,6 +2428,9 @@ __perf_remove_from_context(struct perf_event *event,
        list_del_event(event, ctx);
 
        if (!ctx->nr_events && ctx->is_active) {
+               if (ctx == &cpuctx->ctx)
+                       update_cgrp_time_from_cpuctx(cpuctx, true);
+
                ctx->is_active = 0;
                ctx->rotate_necessary = 0;
                if (ctx->task) {
@@ -2392,7 +2462,11 @@ static void perf_remove_from_context(struct perf_event *event, unsigned long fla
         * event_function_call() user.
         */
        raw_spin_lock_irq(&ctx->lock);
-       if (!ctx->is_active) {
+       /*
+        * Cgroup events are per-cpu events, and must IPI because of
+        * cgrp_cpuctx_list.
+        */
+       if (!ctx->is_active && !is_cgroup_event(event)) {
                __perf_remove_from_context(event, __get_cpu_context(ctx),
                                           ctx, (void *)flags);
                raw_spin_unlock_irq(&ctx->lock);
@@ -2482,40 +2556,6 @@ void perf_event_disable_inatomic(struct perf_event *event)
        irq_work_queue(&event->pending);
 }
 
-static void perf_set_shadow_time(struct perf_event *event,
-                                struct perf_event_context *ctx)
-{
-       /*
-        * use the correct time source for the time snapshot
-        *
-        * We could get by without this by leveraging the
-        * fact that to get to this function, the caller
-        * has most likely already called update_context_time()
-        * and update_cgrp_time_xx() and thus both timestamp
-        * are identical (or very close). Given that tstamp is,
-        * already adjusted for cgroup, we could say that:
-        *    tstamp - ctx->timestamp
-        * is equivalent to
-        *    tstamp - cgrp->timestamp.
-        *
-        * Then, in perf_output_read(), the calculation would
-        * work with no changes because:
-        * - event is guaranteed scheduled in
-        * - no scheduled out in between
-        * - thus the timestamp would be the same
-        *
-        * But this is a bit hairy.
-        *
-        * So instead, we have an explicit cgroup call to remain
-        * within the time source all along. We believe it
-        * is cleaner and simpler to understand.
-        */
-       if (is_cgroup_event(event))
-               perf_cgroup_set_shadow_time(event, event->tstamp);
-       else
-               event->shadow_ctx_time = event->tstamp - ctx->timestamp;
-}
-
 #define MAX_INTERRUPTS (~0ULL)
 
 static void perf_log_throttle(struct perf_event *event, int enable);
@@ -2556,8 +2596,6 @@ event_sched_in(struct perf_event *event,
 
        perf_pmu_disable(event->pmu);
 
-       perf_set_shadow_time(event, ctx);
-
        perf_log_itrace_start(event);
 
        if (event->pmu->add(event, PERF_EF_START)) {
@@ -2861,11 +2899,14 @@ perf_install_in_context(struct perf_event_context *ctx,
         * perf_event_attr::disabled events will not run and can be initialized
         * without IPI. Except when this is the first event for the context, in
         * that case we need the magic of the IPI to set ctx->is_active.
+        * Similarly, cgroup events for the context also needs the IPI to
+        * manipulate the cgrp_cpuctx_list.
         *
         * The IOC_ENABLE that is sure to follow the creation of a disabled
         * event will issue the IPI and reprogram the hardware.
         */
-       if (__perf_effective_state(event) == PERF_EVENT_STATE_OFF && ctx->nr_events) {
+       if (__perf_effective_state(event) == PERF_EVENT_STATE_OFF &&
+           ctx->nr_events && !is_cgroup_event(event)) {
                raw_spin_lock_irq(&ctx->lock);
                if (ctx->task == TASK_TOMBSTONE) {
                        raw_spin_unlock_irq(&ctx->lock);
@@ -3197,6 +3238,15 @@ static int perf_event_modify_breakpoint(struct perf_event *bp,
        return err;
 }
 
+/*
+ * Copy event-type-independent attributes that may be modified.
+ */
+static void perf_event_modify_copy_attr(struct perf_event_attr *to,
+                                       const struct perf_event_attr *from)
+{
+       to->sig_data = from->sig_data;
+}
+
 static int perf_event_modify_attr(struct perf_event *event,
                                  struct perf_event_attr *attr)
 {
@@ -3219,10 +3269,17 @@ static int perf_event_modify_attr(struct perf_event *event,
        WARN_ON_ONCE(event->ctx->parent_ctx);
 
        mutex_lock(&event->child_mutex);
+       /*
+        * Event-type-independent attributes must be copied before event-type
+        * modification, which will validate that final attributes match the
+        * source attributes after all relevant attributes have been copied.
+        */
+       perf_event_modify_copy_attr(&event->attr, attr);
        err = func(event, attr);
        if (err)
                goto out;
        list_for_each_entry(child, &event->child_list, child_list) {
+               perf_event_modify_copy_attr(&child->attr, attr);
                err = func(child, attr);
                if (err)
                        goto out;
@@ -3251,16 +3308,6 @@ static void ctx_sched_out(struct perf_event_context *ctx,
                return;
        }
 
-       ctx->is_active &= ~event_type;
-       if (!(ctx->is_active & EVENT_ALL))
-               ctx->is_active = 0;
-
-       if (ctx->task) {
-               WARN_ON_ONCE(cpuctx->task_ctx != ctx);
-               if (!ctx->is_active)
-                       cpuctx->task_ctx = NULL;
-       }
-
        /*
         * Always update time if it was set; not only when it changes.
         * Otherwise we can 'forget' to update time for any but the last
@@ -3274,7 +3321,22 @@ static void ctx_sched_out(struct perf_event_context *ctx,
        if (is_active & EVENT_TIME) {
                /* update (and stop) ctx time */
                update_context_time(ctx);
-               update_cgrp_time_from_cpuctx(cpuctx);
+               update_cgrp_time_from_cpuctx(cpuctx, ctx == &cpuctx->ctx);
+               /*
+                * CPU-release for the below ->is_active store,
+                * see __load_acquire() in perf_event_time_now()
+                */
+               barrier();
+       }
+
+       ctx->is_active &= ~event_type;
+       if (!(ctx->is_active & EVENT_ALL))
+               ctx->is_active = 0;
+
+       if (ctx->task) {
+               WARN_ON_ONCE(cpuctx->task_ctx != ctx);
+               if (!ctx->is_active)
+                       cpuctx->task_ctx = NULL;
        }
 
        is_active ^= ctx->is_active; /* changed bits */
@@ -3711,13 +3773,19 @@ static noinline int visit_groups_merge(struct perf_cpu_context *cpuctx,
        return 0;
 }
 
+/*
+ * Because the userpage is strictly per-event (there is no concept of context,
+ * so there cannot be a context indirection), every userpage must be updated
+ * when context time starts :-(
+ *
+ * IOW, we must not miss EVENT_TIME edges.
+ */
 static inline bool event_update_userpage(struct perf_event *event)
 {
        if (likely(!atomic_read(&event->mmap_count)))
                return false;
 
        perf_event_update_time(event);
-       perf_set_shadow_time(event, event->ctx);
        perf_event_update_userpage(event);
 
        return true;
@@ -3801,13 +3869,23 @@ ctx_sched_in(struct perf_event_context *ctx,
             struct task_struct *task)
 {
        int is_active = ctx->is_active;
-       u64 now;
 
        lockdep_assert_held(&ctx->lock);
 
        if (likely(!ctx->nr_events))
                return;
 
+       if (is_active ^ EVENT_TIME) {
+               /* start ctx time */
+               __update_context_time(ctx, false);
+               perf_cgroup_set_timestamp(task, ctx);
+               /*
+                * CPU-release for the below ->is_active store,
+                * see __load_acquire() in perf_event_time_now()
+                */
+               barrier();
+       }
+
        ctx->is_active |= (event_type | EVENT_TIME);
        if (ctx->task) {
                if (!is_active)
@@ -3818,13 +3896,6 @@ ctx_sched_in(struct perf_event_context *ctx,
 
        is_active ^= ctx->is_active; /* changed bits */
 
-       if (is_active & EVENT_TIME) {
-               /* start ctx time */
-               now = perf_clock();
-               ctx->timestamp = now;
-               perf_cgroup_set_timestamp(task, ctx);
-       }
-
        /*
         * First go through the list and put on any pinned groups
         * in order to give them the best chance of going on.
@@ -4418,6 +4489,18 @@ static inline u64 perf_event_count(struct perf_event *event)
        return local64_read(&event->count) + atomic64_read(&event->child_count);
 }
 
+static void calc_timer_values(struct perf_event *event,
+                               u64 *now,
+                               u64 *enabled,
+                               u64 *running)
+{
+       u64 ctx_time;
+
+       *now = perf_clock();
+       ctx_time = perf_event_time_now(event, *now);
+       __perf_update_times(event, ctx_time, enabled, running);
+}
+
 /*
  * NMI-safe method to read a local event, that is an event that
  * is:
@@ -4477,10 +4560,9 @@ int perf_event_read_local(struct perf_event *event, u64 *value,
 
        *value = local64_read(&event->count);
        if (enabled || running) {
-               u64 now = event->shadow_ctx_time + perf_clock();
-               u64 __enabled, __running;
+               u64 __enabled, __running, __now;;
 
-               __perf_update_times(event, now, &__enabled, &__running);
+               calc_timer_values(event, &__now, &__enabled, &__running);
                if (enabled)
                        *enabled = __enabled;
                if (running)
@@ -5802,18 +5884,6 @@ static int perf_event_index(struct perf_event *event)
        return event->pmu->event_idx(event);
 }
 
-static void calc_timer_values(struct perf_event *event,
-                               u64 *now,
-                               u64 *enabled,
-                               u64 *running)
-{
-       u64 ctx_time;
-
-       *now = perf_clock();
-       ctx_time = event->shadow_ctx_time + *now;
-       __perf_update_times(event, ctx_time, enabled, running);
-}
-
 static void perf_event_init_userpage(struct perf_event *event)
 {
        struct perf_event_mmap_page *userpg;
@@ -5938,6 +6008,8 @@ static void ring_buffer_attach(struct perf_event *event,
        struct perf_buffer *old_rb = NULL;
        unsigned long flags;
 
+       WARN_ON_ONCE(event->parent);
+
        if (event->rb) {
                /*
                 * Should be impossible, we set this when removing
@@ -5995,6 +6067,9 @@ static void ring_buffer_wakeup(struct perf_event *event)
 {
        struct perf_buffer *rb;
 
+       if (event->parent)
+               event = event->parent;
+
        rcu_read_lock();
        rb = rcu_dereference(event->rb);
        if (rb) {
@@ -6008,6 +6083,9 @@ struct perf_buffer *ring_buffer_get(struct perf_event *event)
 {
        struct perf_buffer *rb;
 
+       if (event->parent)
+               event = event->parent;
+
        rcu_read_lock();
        rb = rcu_dereference(event->rb);
        if (rb) {
@@ -6353,7 +6431,6 @@ accounting:
                ring_buffer_attach(event, rb);
 
                perf_event_update_time(event);
-               perf_set_shadow_time(event, event->ctx);
                perf_event_init_userpage(event);
                perf_event_update_userpage(event);
        } else {
@@ -6717,7 +6794,7 @@ static unsigned long perf_prepare_sample_aux(struct perf_event *event,
        if (WARN_ON_ONCE(READ_ONCE(sampler->oncpu) != smp_processor_id()))
                goto out;
 
-       rb = ring_buffer_get(sampler->parent ? sampler->parent : sampler);
+       rb = ring_buffer_get(sampler);
        if (!rb)
                goto out;
 
@@ -6783,7 +6860,7 @@ static void perf_aux_sample_output(struct perf_event *event,
        if (WARN_ON_ONCE(!sampler || !data->aux_size))
                return;
 
-       rb = ring_buffer_get(sampler->parent ? sampler->parent : sampler);
+       rb = ring_buffer_get(sampler);
        if (!rb)
                return;
 
index 24dab04..46a5c2e 100644 (file)
@@ -3725,12 +3725,6 @@ static noinline int do_init_module(struct module *mod)
        }
        freeinit->module_init = mod->init_layout.base;
 
-       /*
-        * We want to find out whether @mod uses async during init.  Clear
-        * PF_USED_ASYNC.  async_schedule*() will set it.
-        */
-       current->flags &= ~PF_USED_ASYNC;
-
        do_mod_ctors(mod);
        /* Start the module */
        if (mod->init != NULL)
@@ -3756,22 +3750,13 @@ static noinline int do_init_module(struct module *mod)
 
        /*
         * We need to finish all async code before the module init sequence
-        * is done.  This has potential to deadlock.  For example, a newly
-        * detected block device can trigger request_module() of the
-        * default iosched from async probing task.  Once userland helper
-        * reaches here, async_synchronize_full() will wait on the async
-        * task waiting on request_module() and deadlock.
-        *
-        * This deadlock is avoided by perfomring async_synchronize_full()
-        * iff module init queued any async jobs.  This isn't a full
-        * solution as it will deadlock the same if module loading from
-        * async jobs nests more than once; however, due to the various
-        * constraints, this hack seems to be the best option for now.
-        * Please refer to the following thread for details.
+        * is done. This has potential to deadlock if synchronous module
+        * loading is requested from async (which is not allowed!).
         *
-        * http://thread.gmane.org/gmane.linux.kernel/1420814
+        * See commit 0fdff3ec6d87 ("async, kmod: warn on synchronous
+        * request_module() from async workers") for more details.
         */
-       if (!mod->async_probe_requested && (current->flags & PF_USED_ASYNC))
+       if (!mod->async_probe_requested)
                async_synchronize_full();
 
        ftrace_free_mem(mod, mod->init_layout.base, mod->init_layout.base +
index f7a9860..330d499 100644 (file)
@@ -978,8 +978,7 @@ static void memory_bm_recycle(struct memory_bitmap *bm)
  * Register a range of page frames the contents of which should not be saved
  * during hibernation (to be used in the early initialization code).
  */
-void __init __register_nosave_region(unsigned long start_pfn,
-                                    unsigned long end_pfn, int use_kmalloc)
+void __init register_nosave_region(unsigned long start_pfn, unsigned long end_pfn)
 {
        struct nosave_region *region;
 
@@ -995,18 +994,12 @@ void __init __register_nosave_region(unsigned long start_pfn,
                        goto Report;
                }
        }
-       if (use_kmalloc) {
-               /* During init, this shouldn't fail */
-               region = kmalloc(sizeof(struct nosave_region), GFP_KERNEL);
-               BUG_ON(!region);
-       } else {
-               /* This allocation cannot fail */
-               region = memblock_alloc(sizeof(struct nosave_region),
-                                       SMP_CACHE_BYTES);
-               if (!region)
-                       panic("%s: Failed to allocate %zu bytes\n", __func__,
-                             sizeof(struct nosave_region));
-       }
+       /* This allocation cannot fail */
+       region = memblock_alloc(sizeof(struct nosave_region),
+                               SMP_CACHE_BYTES);
+       if (!region)
+               panic("%s: Failed to allocate %zu bytes\n", __func__,
+                     sizeof(struct nosave_region));
        region->start_pfn = start_pfn;
        region->end_pfn = end_pfn;
        list_add_tail(&region->list, &nosave_regions);
index 105df4d..52571dc 100644 (file)
@@ -39,23 +39,20 @@ ssize_t pm_show_wakelocks(char *buf, bool show_active)
 {
        struct rb_node *node;
        struct wakelock *wl;
-       char *str = buf;
-       char *end = buf + PAGE_SIZE;
+       int len = 0;
 
        mutex_lock(&wakelocks_lock);
 
        for (node = rb_first(&wakelocks_tree); node; node = rb_next(node)) {
                wl = rb_entry(node, struct wakelock, node);
                if (wl->ws->active == show_active)
-                       str += scnprintf(str, end - str, "%s ", wl->name);
+                       len += sysfs_emit_at(buf, len, "%s ", wl->name);
        }
-       if (str > buf)
-               str--;
 
-       str += scnprintf(str, end - str, "\n");
+       len += sysfs_emit_at(buf, len, "\n");
 
        mutex_unlock(&wakelocks_lock);
-       return (str - buf);
+       return len;
 }
 
 #if CONFIG_PM_WAKELOCKS_LIMIT > 0
index 653ae04..c228343 100644 (file)
@@ -12,7 +12,7 @@
 static const int ten_thousand = 10000;
 
 static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write,
-                               void __user *buffer, size_t *lenp, loff_t *ppos)
+                               void *buffer, size_t *lenp, loff_t *ppos)
 {
        if (write && !capable(CAP_SYS_ADMIN))
                return -EPERM;
index 84f1d91..d64f0b1 100644 (file)
@@ -123,7 +123,7 @@ static struct rcu_tasks rt_name =                                                   \
        .call_func = call,                                                              \
        .rtpcpu = &rt_name ## __percpu,                                                 \
        .name = n,                                                                      \
-       .percpu_enqueue_shift = ilog2(CONFIG_NR_CPUS),                                  \
+       .percpu_enqueue_shift = ilog2(CONFIG_NR_CPUS) + 1,                              \
        .percpu_enqueue_lim = 1,                                                        \
        .percpu_dequeue_lim = 1,                                                        \
        .barrier_q_mutex = __MUTEX_INITIALIZER(rt_name.barrier_q_mutex),                \
@@ -216,6 +216,7 @@ static void cblist_init_generic(struct rcu_tasks *rtp)
        int cpu;
        unsigned long flags;
        int lim;
+       int shift;
 
        raw_spin_lock_irqsave(&rtp->cbs_gbl_lock, flags);
        if (rcu_task_enqueue_lim < 0) {
@@ -229,7 +230,10 @@ static void cblist_init_generic(struct rcu_tasks *rtp)
 
        if (lim > nr_cpu_ids)
                lim = nr_cpu_ids;
-       WRITE_ONCE(rtp->percpu_enqueue_shift, ilog2(nr_cpu_ids / lim));
+       shift = ilog2(nr_cpu_ids / lim);
+       if (((nr_cpu_ids - 1) >> shift) >= lim)
+               shift++;
+       WRITE_ONCE(rtp->percpu_enqueue_shift, shift);
        WRITE_ONCE(rtp->percpu_dequeue_lim, lim);
        smp_store_release(&rtp->percpu_enqueue_lim, lim);
        for_each_possible_cpu(cpu) {
@@ -298,7 +302,7 @@ static void call_rcu_tasks_generic(struct rcu_head *rhp, rcu_callback_t func,
        if (unlikely(needadjust)) {
                raw_spin_lock_irqsave(&rtp->cbs_gbl_lock, flags);
                if (rtp->percpu_enqueue_lim != nr_cpu_ids) {
-                       WRITE_ONCE(rtp->percpu_enqueue_shift, ilog2(nr_cpu_ids));
+                       WRITE_ONCE(rtp->percpu_enqueue_shift, ilog2(nr_cpu_ids) + 1);
                        WRITE_ONCE(rtp->percpu_dequeue_lim, nr_cpu_ids);
                        smp_store_release(&rtp->percpu_enqueue_lim, nr_cpu_ids);
                        pr_info("Switching %s to per-CPU callback queuing.\n", rtp->name);
@@ -413,7 +417,7 @@ static int rcu_tasks_need_gpcb(struct rcu_tasks *rtp)
        if (rcu_task_cb_adjust && ncbs <= rcu_task_collapse_lim) {
                raw_spin_lock_irqsave(&rtp->cbs_gbl_lock, flags);
                if (rtp->percpu_enqueue_lim > 1) {
-                       WRITE_ONCE(rtp->percpu_enqueue_shift, ilog2(nr_cpu_ids));
+                       WRITE_ONCE(rtp->percpu_enqueue_shift, ilog2(nr_cpu_ids) + 1);
                        smp_store_release(&rtp->percpu_enqueue_lim, 1);
                        rtp->percpu_dequeue_gpseq = get_state_synchronize_rcu();
                        pr_info("Starting switch %s to CPU-0 callback queuing.\n", rtp->name);
index 2e4ae00..848eaa0 100644 (file)
@@ -5822,8 +5822,7 @@ pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)
        }
 
        if (schedstat_enabled() && rq->core->core_forceidle_count) {
-               if (cookie)
-                       rq->core->core_forceidle_start = rq_clock(rq->core);
+               rq->core->core_forceidle_start = rq_clock(rq->core);
                rq->core->core_forceidle_occupation = occ;
        }
 
@@ -8219,9 +8218,7 @@ int __cond_resched_lock(spinlock_t *lock)
 
        if (spin_needbreak(lock) || resched) {
                spin_unlock(lock);
-               if (resched)
-                       preempt_schedule_common();
-               else
+               if (!_cond_resched())
                        cpu_relax();
                ret = 1;
                spin_lock(lock);
@@ -8239,9 +8236,7 @@ int __cond_resched_rwlock_read(rwlock_t *lock)
 
        if (rwlock_needbreak(lock) || resched) {
                read_unlock(lock);
-               if (resched)
-                       preempt_schedule_common();
-               else
+               if (!_cond_resched())
                        cpu_relax();
                ret = 1;
                read_lock(lock);
@@ -8259,9 +8254,7 @@ int __cond_resched_rwlock_write(rwlock_t *lock)
 
        if (rwlock_needbreak(lock) || resched) {
                write_unlock(lock);
-               if (resched)
-                       preempt_schedule_common();
-               else
+               if (!_cond_resched())
                        cpu_relax();
                ret = 1;
                write_lock(lock);
index 1fb4567..c8746a9 100644 (file)
@@ -277,7 +277,7 @@ void __sched_core_account_forceidle(struct rq *rq)
                rq_i = cpu_rq(i);
                p = rq_i->core_pick ?: rq_i->curr;
 
-               if (!p->core_cookie)
+               if (p == rq_i->idle)
                        continue;
 
                __schedstat_add(p->stats.core_forceidle_sum, delta);
index 095b0aa..5146163 100644 (file)
@@ -3028,9 +3028,11 @@ enqueue_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se)
 static inline void
 dequeue_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se)
 {
-       u32 divider = get_pelt_divider(&se->avg);
        sub_positive(&cfs_rq->avg.load_avg, se->avg.load_avg);
-       cfs_rq->avg.load_sum = cfs_rq->avg.load_avg * divider;
+       sub_positive(&cfs_rq->avg.load_sum, se_weight(se) * se->avg.load_sum);
+       /* See update_cfs_rq_load_avg() */
+       cfs_rq->avg.load_sum = max_t(u32, cfs_rq->avg.load_sum,
+                                         cfs_rq->avg.load_avg * PELT_MIN_DIVIDER);
 }
 #else
 static inline void
@@ -3381,7 +3383,6 @@ void set_task_rq_fair(struct sched_entity *se,
        se->avg.last_update_time = n_last_update_time;
 }
 
-
 /*
  * When on migration a sched_entity joins/leaves the PELT hierarchy, we need to
  * propagate its contribution. The key to this propagation is the invariant
@@ -3449,15 +3450,14 @@ void set_task_rq_fair(struct sched_entity *se,
  * XXX: only do this for the part of runnable > running ?
  *
  */
-
 static inline void
 update_tg_cfs_util(struct cfs_rq *cfs_rq, struct sched_entity *se, struct cfs_rq *gcfs_rq)
 {
-       long delta = gcfs_rq->avg.util_avg - se->avg.util_avg;
-       u32 divider;
+       long delta_sum, delta_avg = gcfs_rq->avg.util_avg - se->avg.util_avg;
+       u32 new_sum, divider;
 
        /* Nothing to update */
-       if (!delta)
+       if (!delta_avg)
                return;
 
        /*
@@ -3466,23 +3466,30 @@ update_tg_cfs_util(struct cfs_rq *cfs_rq, struct sched_entity *se, struct cfs_rq
         */
        divider = get_pelt_divider(&cfs_rq->avg);
 
+
        /* Set new sched_entity's utilization */
        se->avg.util_avg = gcfs_rq->avg.util_avg;
-       se->avg.util_sum = se->avg.util_avg * divider;
+       new_sum = se->avg.util_avg * divider;
+       delta_sum = (long)new_sum - (long)se->avg.util_sum;
+       se->avg.util_sum = new_sum;
 
        /* Update parent cfs_rq utilization */
-       add_positive(&cfs_rq->avg.util_avg, delta);
-       cfs_rq->avg.util_sum = cfs_rq->avg.util_avg * divider;
+       add_positive(&cfs_rq->avg.util_avg, delta_avg);
+       add_positive(&cfs_rq->avg.util_sum, delta_sum);
+
+       /* See update_cfs_rq_load_avg() */
+       cfs_rq->avg.util_sum = max_t(u32, cfs_rq->avg.util_sum,
+                                         cfs_rq->avg.util_avg * PELT_MIN_DIVIDER);
 }
 
 static inline void
 update_tg_cfs_runnable(struct cfs_rq *cfs_rq, struct sched_entity *se, struct cfs_rq *gcfs_rq)
 {
-       long delta = gcfs_rq->avg.runnable_avg - se->avg.runnable_avg;
-       u32 divider;
+       long delta_sum, delta_avg = gcfs_rq->avg.runnable_avg - se->avg.runnable_avg;
+       u32 new_sum, divider;
 
        /* Nothing to update */
-       if (!delta)
+       if (!delta_avg)
                return;
 
        /*
@@ -3493,19 +3500,25 @@ update_tg_cfs_runnable(struct cfs_rq *cfs_rq, struct sched_entity *se, struct cf
 
        /* Set new sched_entity's runnable */
        se->avg.runnable_avg = gcfs_rq->avg.runnable_avg;
-       se->avg.runnable_sum = se->avg.runnable_avg * divider;
+       new_sum = se->avg.runnable_avg * divider;
+       delta_sum = (long)new_sum - (long)se->avg.runnable_sum;
+       se->avg.runnable_sum = new_sum;
 
        /* Update parent cfs_rq runnable */
-       add_positive(&cfs_rq->avg.runnable_avg, delta);
-       cfs_rq->avg.runnable_sum = cfs_rq->avg.runnable_avg * divider;
+       add_positive(&cfs_rq->avg.runnable_avg, delta_avg);
+       add_positive(&cfs_rq->avg.runnable_sum, delta_sum);
+       /* See update_cfs_rq_load_avg() */
+       cfs_rq->avg.runnable_sum = max_t(u32, cfs_rq->avg.runnable_sum,
+                                             cfs_rq->avg.runnable_avg * PELT_MIN_DIVIDER);
 }
 
 static inline void
 update_tg_cfs_load(struct cfs_rq *cfs_rq, struct sched_entity *se, struct cfs_rq *gcfs_rq)
 {
-       long delta, running_sum, runnable_sum = gcfs_rq->prop_runnable_sum;
+       long delta_avg, running_sum, runnable_sum = gcfs_rq->prop_runnable_sum;
        unsigned long load_avg;
        u64 load_sum = 0;
+       s64 delta_sum;
        u32 divider;
 
        if (!runnable_sum)
@@ -3532,7 +3545,7 @@ update_tg_cfs_load(struct cfs_rq *cfs_rq, struct sched_entity *se, struct cfs_rq
                 * assuming all tasks are equally runnable.
                 */
                if (scale_load_down(gcfs_rq->load.weight)) {
-                       load_sum = div_s64(gcfs_rq->avg.load_sum,
+                       load_sum = div_u64(gcfs_rq->avg.load_sum,
                                scale_load_down(gcfs_rq->load.weight));
                }
 
@@ -3549,19 +3562,22 @@ update_tg_cfs_load(struct cfs_rq *cfs_rq, struct sched_entity *se, struct cfs_rq
        running_sum = se->avg.util_sum >> SCHED_CAPACITY_SHIFT;
        runnable_sum = max(runnable_sum, running_sum);
 
-       load_sum = (s64)se_weight(se) * runnable_sum;
-       load_avg = div_s64(load_sum, divider);
-
-       se->avg.load_sum = runnable_sum;
+       load_sum = se_weight(se) * runnable_sum;
+       load_avg = div_u64(load_sum, divider);
 
-       delta = load_avg - se->avg.load_avg;
-       if (!delta)
+       delta_avg = load_avg - se->avg.load_avg;
+       if (!delta_avg)
                return;
 
-       se->avg.load_avg = load_avg;
+       delta_sum = load_sum - (s64)se_weight(se) * se->avg.load_sum;
 
-       add_positive(&cfs_rq->avg.load_avg, delta);
-       cfs_rq->avg.load_sum = cfs_rq->avg.load_avg * divider;
+       se->avg.load_sum = runnable_sum;
+       se->avg.load_avg = load_avg;
+       add_positive(&cfs_rq->avg.load_avg, delta_avg);
+       add_positive(&cfs_rq->avg.load_sum, delta_sum);
+       /* See update_cfs_rq_load_avg() */
+       cfs_rq->avg.load_sum = max_t(u32, cfs_rq->avg.load_sum,
+                                         cfs_rq->avg.load_avg * PELT_MIN_DIVIDER);
 }
 
 static inline void add_tg_cfs_propagate(struct cfs_rq *cfs_rq, long runnable_sum)
@@ -3652,7 +3668,7 @@ static inline void add_tg_cfs_propagate(struct cfs_rq *cfs_rq, long runnable_sum
  *
  * cfs_rq->avg is used for task_h_load() and update_cfs_share() for example.
  *
- * Returns true if the load decayed or we removed load.
+ * Return: true if the load decayed or we removed load.
  *
  * Since both these conditions indicate a changed cfs_rq->avg.load we should
  * call update_tg_load_avg() when this function returns true.
@@ -3677,15 +3693,32 @@ update_cfs_rq_load_avg(u64 now, struct cfs_rq *cfs_rq)
 
                r = removed_load;
                sub_positive(&sa->load_avg, r);
-               sa->load_sum = sa->load_avg * divider;
+               sub_positive(&sa->load_sum, r * divider);
+               /* See sa->util_sum below */
+               sa->load_sum = max_t(u32, sa->load_sum, sa->load_avg * PELT_MIN_DIVIDER);
 
                r = removed_util;
                sub_positive(&sa->util_avg, r);
-               sa->util_sum = sa->util_avg * divider;
+               sub_positive(&sa->util_sum, r * divider);
+               /*
+                * Because of rounding, se->util_sum might ends up being +1 more than
+                * cfs->util_sum. Although this is not a problem by itself, detaching
+                * a lot of tasks with the rounding problem between 2 updates of
+                * util_avg (~1ms) can make cfs->util_sum becoming null whereas
+                * cfs_util_avg is not.
+                * Check that util_sum is still above its lower bound for the new
+                * util_avg. Given that period_contrib might have moved since the last
+                * sync, we are only sure that util_sum must be above or equal to
+                *    util_avg * minimum possible divider
+                */
+               sa->util_sum = max_t(u32, sa->util_sum, sa->util_avg * PELT_MIN_DIVIDER);
 
                r = removed_runnable;
                sub_positive(&sa->runnable_avg, r);
-               sa->runnable_sum = sa->runnable_avg * divider;
+               sub_positive(&sa->runnable_sum, r * divider);
+               /* See sa->util_sum above */
+               sa->runnable_sum = max_t(u32, sa->runnable_sum,
+                                             sa->runnable_avg * PELT_MIN_DIVIDER);
 
                /*
                 * removed_runnable is the unweighted version of removed_load so we
@@ -3772,17 +3805,18 @@ static void attach_entity_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *s
  */
 static void detach_entity_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se)
 {
-       /*
-        * cfs_rq->avg.period_contrib can be used for both cfs_rq and se.
-        * See ___update_load_avg() for details.
-        */
-       u32 divider = get_pelt_divider(&cfs_rq->avg);
-
        dequeue_load_avg(cfs_rq, se);
        sub_positive(&cfs_rq->avg.util_avg, se->avg.util_avg);
-       cfs_rq->avg.util_sum = cfs_rq->avg.util_avg * divider;
+       sub_positive(&cfs_rq->avg.util_sum, se->avg.util_sum);
+       /* See update_cfs_rq_load_avg() */
+       cfs_rq->avg.util_sum = max_t(u32, cfs_rq->avg.util_sum,
+                                         cfs_rq->avg.util_avg * PELT_MIN_DIVIDER);
+
        sub_positive(&cfs_rq->avg.runnable_avg, se->avg.runnable_avg);
-       cfs_rq->avg.runnable_sum = cfs_rq->avg.runnable_avg * divider;
+       sub_positive(&cfs_rq->avg.runnable_sum, se->avg.runnable_sum);
+       /* See update_cfs_rq_load_avg() */
+       cfs_rq->avg.runnable_sum = max_t(u32, cfs_rq->avg.runnable_sum,
+                                             cfs_rq->avg.runnable_avg * PELT_MIN_DIVIDER);
 
        add_tg_cfs_propagate(cfs_rq, -se->avg.load_sum);
 
@@ -8539,6 +8573,8 @@ group_type group_classify(unsigned int imbalance_pct,
  *
  * If @sg does not have SMT siblings, only pull tasks if all of the SMT siblings
  * of @dst_cpu are idle and @sg has lower priority.
+ *
+ * Return: true if @dst_cpu can pull tasks, false otherwise.
  */
 static bool asym_smt_can_pull_tasks(int dst_cpu, struct sd_lb_stats *sds,
                                    struct sg_lb_stats *sgs,
@@ -8614,6 +8650,7 @@ sched_asym(struct lb_env *env, struct sd_lb_stats *sds,  struct sg_lb_stats *sgs
 /**
  * update_sg_lb_stats - Update sched_group's statistics for load balancing.
  * @env: The load balancing environment.
+ * @sds: Load-balancing data with statistics of the local group.
  * @group: sched_group whose statistics are to be updated.
  * @sgs: variable to hold the statistics for this group.
  * @sg_status: Holds flag indicating the status of the sched_group
@@ -9421,12 +9458,11 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s
 /**
  * find_busiest_group - Returns the busiest group within the sched_domain
  * if there is an imbalance.
+ * @env: The load balancing environment.
  *
  * Also calculates the amount of runnable load which should be moved
  * to restore balance.
  *
- * @env: The load balancing environment.
- *
  * Return:     - The busiest group if imbalance exists.
  */
 static struct sched_group *find_busiest_group(struct lb_env *env)
index b5add64..3d28254 100644 (file)
 #endif
 
 #ifdef CONFIG_RSEQ
-#define MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ_BITMASK          \
+#define MEMBARRIER_PRIVATE_EXPEDITED_RSEQ_BITMASK              \
        (MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ                  \
-       | MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ_BITMASK)
+       | MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ)
 #else
-#define MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ_BITMASK  0
+#define MEMBARRIER_PRIVATE_EXPEDITED_RSEQ_BITMASK      0
 #endif
 
 #define MEMBARRIER_CMD_BITMASK                                         \
        | MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED                      \
        | MEMBARRIER_CMD_PRIVATE_EXPEDITED                              \
        | MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED                     \
-       | MEMBARRIER_PRIVATE_EXPEDITED_SYNC_CORE_BITMASK)
+       | MEMBARRIER_PRIVATE_EXPEDITED_SYNC_CORE_BITMASK                \
+       | MEMBARRIER_PRIVATE_EXPEDITED_RSEQ_BITMASK)
 
 static void ipi_mb(void *info)
 {
index e06071b..c336f5f 100644 (file)
@@ -37,9 +37,11 @@ update_irq_load_avg(struct rq *rq, u64 running)
 }
 #endif
 
+#define PELT_MIN_DIVIDER       (LOAD_AVG_MAX - 1024)
+
 static inline u32 get_pelt_divider(struct sched_avg *avg)
 {
-       return LOAD_AVG_MAX - 1024 + avg->period_contrib;
+       return PELT_MIN_DIVIDER + avg->period_contrib;
 }
 
 static inline void cfs_se_util_change(struct sched_avg *avg)
index a679613..e143581 100644 (file)
@@ -1082,44 +1082,6 @@ int psi_show(struct seq_file *m, struct psi_group *group, enum psi_res res)
        return 0;
 }
 
-static int psi_io_show(struct seq_file *m, void *v)
-{
-       return psi_show(m, &psi_system, PSI_IO);
-}
-
-static int psi_memory_show(struct seq_file *m, void *v)
-{
-       return psi_show(m, &psi_system, PSI_MEM);
-}
-
-static int psi_cpu_show(struct seq_file *m, void *v)
-{
-       return psi_show(m, &psi_system, PSI_CPU);
-}
-
-static int psi_open(struct file *file, int (*psi_show)(struct seq_file *, void *))
-{
-       if (file->f_mode & FMODE_WRITE && !capable(CAP_SYS_RESOURCE))
-               return -EPERM;
-
-       return single_open(file, psi_show, NULL);
-}
-
-static int psi_io_open(struct inode *inode, struct file *file)
-{
-       return psi_open(file, psi_io_show);
-}
-
-static int psi_memory_open(struct inode *inode, struct file *file)
-{
-       return psi_open(file, psi_memory_show);
-}
-
-static int psi_cpu_open(struct inode *inode, struct file *file)
-{
-       return psi_open(file, psi_cpu_show);
-}
-
 struct psi_trigger *psi_trigger_create(struct psi_group *group,
                        char *buf, size_t nbytes, enum psi_res res)
 {
@@ -1162,7 +1124,6 @@ struct psi_trigger *psi_trigger_create(struct psi_group *group,
        t->event = 0;
        t->last_event_time = 0;
        init_waitqueue_head(&t->event_wait);
-       kref_init(&t->refcount);
 
        mutex_lock(&group->trigger_lock);
 
@@ -1191,15 +1152,19 @@ struct psi_trigger *psi_trigger_create(struct psi_group *group,
        return t;
 }
 
-static void psi_trigger_destroy(struct kref *ref)
+void psi_trigger_destroy(struct psi_trigger *t)
 {
-       struct psi_trigger *t = container_of(ref, struct psi_trigger, refcount);
-       struct psi_group *group = t->group;
+       struct psi_group *group;
        struct task_struct *task_to_destroy = NULL;
 
-       if (static_branch_likely(&psi_disabled))
+       /*
+        * We do not check psi_disabled since it might have been disabled after
+        * the trigger got created.
+        */
+       if (!t)
                return;
 
+       group = t->group;
        /*
         * Wakeup waiters to stop polling. Can happen if cgroup is deleted
         * from under a polling process.
@@ -1235,9 +1200,9 @@ static void psi_trigger_destroy(struct kref *ref)
        mutex_unlock(&group->trigger_lock);
 
        /*
-        * Wait for both *trigger_ptr from psi_trigger_replace and
-        * poll_task RCUs to complete their read-side critical sections
-        * before destroying the trigger and optionally the poll_task
+        * Wait for psi_schedule_poll_work RCU to complete its read-side
+        * critical section before destroying the trigger and optionally the
+        * poll_task.
         */
        synchronize_rcu();
        /*
@@ -1254,18 +1219,6 @@ static void psi_trigger_destroy(struct kref *ref)
        kfree(t);
 }
 
-void psi_trigger_replace(void **trigger_ptr, struct psi_trigger *new)
-{
-       struct psi_trigger *old = *trigger_ptr;
-
-       if (static_branch_likely(&psi_disabled))
-               return;
-
-       rcu_assign_pointer(*trigger_ptr, new);
-       if (old)
-               kref_put(&old->refcount, psi_trigger_destroy);
-}
-
 __poll_t psi_trigger_poll(void **trigger_ptr,
                                struct file *file, poll_table *wait)
 {
@@ -1275,27 +1228,57 @@ __poll_t psi_trigger_poll(void **trigger_ptr,
        if (static_branch_likely(&psi_disabled))
                return DEFAULT_POLLMASK | EPOLLERR | EPOLLPRI;
 
-       rcu_read_lock();
-
-       t = rcu_dereference(*(void __rcu __force **)trigger_ptr);
-       if (!t) {
-               rcu_read_unlock();
+       t = smp_load_acquire(trigger_ptr);
+       if (!t)
                return DEFAULT_POLLMASK | EPOLLERR | EPOLLPRI;
-       }
-       kref_get(&t->refcount);
-
-       rcu_read_unlock();
 
        poll_wait(file, &t->event_wait, wait);
 
        if (cmpxchg(&t->event, 1, 0) == 1)
                ret |= EPOLLPRI;
 
-       kref_put(&t->refcount, psi_trigger_destroy);
-
        return ret;
 }
 
+#ifdef CONFIG_PROC_FS
+static int psi_io_show(struct seq_file *m, void *v)
+{
+       return psi_show(m, &psi_system, PSI_IO);
+}
+
+static int psi_memory_show(struct seq_file *m, void *v)
+{
+       return psi_show(m, &psi_system, PSI_MEM);
+}
+
+static int psi_cpu_show(struct seq_file *m, void *v)
+{
+       return psi_show(m, &psi_system, PSI_CPU);
+}
+
+static int psi_open(struct file *file, int (*psi_show)(struct seq_file *, void *))
+{
+       if (file->f_mode & FMODE_WRITE && !capable(CAP_SYS_RESOURCE))
+               return -EPERM;
+
+       return single_open(file, psi_show, NULL);
+}
+
+static int psi_io_open(struct inode *inode, struct file *file)
+{
+       return psi_open(file, psi_io_show);
+}
+
+static int psi_memory_open(struct inode *inode, struct file *file)
+{
+       return psi_open(file, psi_memory_show);
+}
+
+static int psi_cpu_open(struct inode *inode, struct file *file)
+{
+       return psi_open(file, psi_cpu_show);
+}
+
 static ssize_t psi_write(struct file *file, const char __user *user_buf,
                         size_t nbytes, enum psi_res res)
 {
@@ -1316,14 +1299,24 @@ static ssize_t psi_write(struct file *file, const char __user *user_buf,
 
        buf[buf_size - 1] = '\0';
 
-       new = psi_trigger_create(&psi_system, buf, nbytes, res);
-       if (IS_ERR(new))
-               return PTR_ERR(new);
-
        seq = file->private_data;
+
        /* Take seq->lock to protect seq->private from concurrent writes */
        mutex_lock(&seq->lock);
-       psi_trigger_replace(&seq->private, new);
+
+       /* Allow only one trigger per file descriptor */
+       if (seq->private) {
+               mutex_unlock(&seq->lock);
+               return -EBUSY;
+       }
+
+       new = psi_trigger_create(&psi_system, buf, nbytes, res);
+       if (IS_ERR(new)) {
+               mutex_unlock(&seq->lock);
+               return PTR_ERR(new);
+       }
+
+       smp_store_release(&seq->private, new);
        mutex_unlock(&seq->lock);
 
        return nbytes;
@@ -1358,7 +1351,7 @@ static int psi_fop_release(struct inode *inode, struct file *file)
 {
        struct seq_file *seq = file->private_data;
 
-       psi_trigger_replace(&seq->private, NULL);
+       psi_trigger_destroy(seq->private);
        return single_release(inode, file);
 }
 
@@ -1400,3 +1393,5 @@ static int __init psi_proc_init(void)
        return 0;
 }
 module_init(psi_proc_init);
+
+#endif /* CONFIG_PROC_FS */
index 66b8af3..ddb5a7f 100644 (file)
@@ -70,7 +70,7 @@ late_initcall(stackleak_sysctls_init);
 #define skip_erasing() false
 #endif /* CONFIG_STACKLEAK_RUNTIME_DISABLE */
 
-asmlinkage void notrace stackleak_erase(void)
+asmlinkage void noinstr stackleak_erase(void)
 {
        /* It would be nice not to have 'kstack_ptr' and 'boundary' on stack */
        unsigned long kstack_ptr = current->lowest_stack;
@@ -124,9 +124,8 @@ asmlinkage void notrace stackleak_erase(void)
        /* Reset the 'lowest_stack' value for the next syscall */
        current->lowest_stack = current_top_of_stack() - THREAD_SIZE/64;
 }
-NOKPROBE_SYMBOL(stackleak_erase);
 
-void __used __no_caller_saved_registers notrace stackleak_track_stack(void)
+void __used __no_caller_saved_registers noinstr stackleak_track_stack(void)
 {
        unsigned long sp = current_stack_pointer;
 
index 752ed89..a5eb5e7 100644 (file)
@@ -70,10 +70,16 @@ config HAVE_C_RECORDMCOUNT
        help
          C version of recordmcount available?
 
+config HAVE_BUILDTIME_MCOUNT_SORT
+       bool
+       help
+         An architecture selects this if it sorts the mcount_loc section
+        at build time.
+
 config BUILDTIME_MCOUNT_SORT
        bool
        default y
-       depends on BUILDTIME_TABLE_SORT && !S390
+       depends on HAVE_BUILDTIME_MCOUNT_SORT && DYNAMIC_FTRACE
        help
          Sort the mcount_loc section at build time.
 
index a569a0c..c860f58 100644 (file)
@@ -7740,7 +7740,8 @@ static struct tracing_log_err *get_tracing_log_err(struct trace_array *tr)
                err = kzalloc(sizeof(*err), GFP_KERNEL);
                if (!err)
                        err = ERR_PTR(-ENOMEM);
-               tr->n_err_log_entries++;
+               else
+                       tr->n_err_log_entries++;
 
                return err;
        }
index 5e6a988..ada87bf 100644 (file)
@@ -2503,6 +2503,8 @@ static struct hist_field *parse_unary(struct hist_trigger_data *hist_data,
                (HIST_FIELD_FL_TIMESTAMP | HIST_FIELD_FL_TIMESTAMP_USECS);
        expr->fn = hist_field_unary_minus;
        expr->operands[0] = operand1;
+       expr->size = operand1->size;
+       expr->is_signed = operand1->is_signed;
        expr->operator = FIELD_OP_UNARY_MINUS;
        expr->name = expr_str(expr, 0);
        expr->type = kstrdup_const(operand1->type, GFP_KERNEL);
@@ -2719,6 +2721,7 @@ static struct hist_field *parse_expr(struct hist_trigger_data *hist_data,
 
                /* The operand sizes should be the same, so just pick one */
                expr->size = operand1->size;
+               expr->is_signed = operand1->is_signed;
 
                expr->operator = field_op;
                expr->type = kstrdup_const(operand1->type, GFP_KERNEL);
@@ -3935,6 +3938,7 @@ static int trace_action_create(struct hist_trigger_data *hist_data,
 
                        var_ref_idx = find_var_ref_idx(hist_data, var_ref);
                        if (WARN_ON(var_ref_idx < 0)) {
+                               kfree(p);
                                ret = var_ref_idx;
                                goto err;
                        }
@@ -6163,7 +6167,9 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops,
 
        lockdep_assert_held(&event_mutex);
 
-       if (glob && strlen(glob)) {
+       WARN_ON(!glob);
+
+       if (strlen(glob)) {
                hist_err_clear();
                last_cmd_set(file, param);
        }
@@ -6196,7 +6202,7 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops,
                        continue;
                }
                break;
-       } while (p);
+       } while (1);
 
        if (!p)
                param = NULL;
index 7b32c35..65b5974 100644 (file)
@@ -190,6 +190,7 @@ struct ucounts *alloc_ucounts(struct user_namespace *ns, kuid_t uid)
                        kfree(new);
                } else {
                        hlist_add_head(&new->node, hashent);
+                       get_user_ns(new->ns);
                        spin_unlock_irq(&ucounts_lock);
                        return new;
                }
@@ -210,6 +211,7 @@ void put_ucounts(struct ucounts *ucounts)
        if (atomic_dec_and_lock_irqsave(&ucounts->count, &ucounts_lock, flags)) {
                hlist_del_init(&ucounts->node);
                spin_unlock_irqrestore(&ucounts_lock, flags);
+               put_user_ns(ucounts->ns);
                kfree(ucounts);
        }
 }
index 9364f79..c71c096 100644 (file)
 
 void blake2s_update(struct blake2s_state *state, const u8 *in, size_t inlen)
 {
-       __blake2s_update(state, in, inlen, blake2s_compress);
+       __blake2s_update(state, in, inlen, false);
 }
 EXPORT_SYMBOL(blake2s_update);
 
 void blake2s_final(struct blake2s_state *state, u8 *out)
 {
        WARN_ON(IS_ENABLED(DEBUG) && !out);
-       __blake2s_final(state, out, blake2s_compress);
+       __blake2s_final(state, out, false);
        memzero_explicit(state, sizeof(*state));
 }
 EXPORT_SYMBOL(blake2s_final);
index 6220fa6..09d293c 100644 (file)
@@ -488,9 +488,13 @@ void sbitmap_queue_recalculate_wake_batch(struct sbitmap_queue *sbq,
                                            unsigned int users)
 {
        unsigned int wake_batch;
+       unsigned int min_batch;
+       unsigned int depth = (sbq->sb.depth + users - 1) / users;
 
-       wake_batch = clamp_val((sbq->sb.depth + users - 1) /
-                       users, 4, SBQ_WAKE_BATCH);
+       min_batch = sbq->sb.depth >= (4 * SBQ_WAIT_QUEUES) ? 4 : 1;
+
+       wake_batch = clamp_val(depth / SBQ_WAIT_QUEUES,
+                       min_batch, SBQ_WAKE_BATCH);
        __sbitmap_queue_update_wake_batch(sbq, wake_batch);
 }
 EXPORT_SYMBOL_GPL(sbitmap_queue_recalculate_wake_batch);
index 847cdbe..26a5c90 100644 (file)
@@ -492,6 +492,7 @@ static void kmalloc_oob_in_memset(struct kunit *test)
        ptr = kmalloc(size, GFP_KERNEL);
        KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ptr);
 
+       OPTIMIZER_HIDE_VAR(ptr);
        OPTIMIZER_HIDE_VAR(size);
        KUNIT_EXPECT_KASAN_FAIL(test,
                                memset(ptr, 0, size + KASAN_GRANULE_SIZE));
@@ -515,6 +516,7 @@ static void kmalloc_memmove_negative_size(struct kunit *test)
        KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ptr);
 
        memset((char *)ptr, 0, 64);
+       OPTIMIZER_HIDE_VAR(ptr);
        OPTIMIZER_HIDE_VAR(invalid_size);
        KUNIT_EXPECT_KASAN_FAIL(test,
                memmove((char *)ptr, (char *)ptr + 4, invalid_size));
@@ -531,6 +533,7 @@ static void kmalloc_memmove_invalid_size(struct kunit *test)
        KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ptr);
 
        memset((char *)ptr, 0, 64);
+       OPTIMIZER_HIDE_VAR(ptr);
        KUNIT_EXPECT_KASAN_FAIL(test,
                memmove((char *)ptr, (char *)ptr + 4, invalid_size));
        kfree(ptr);
@@ -893,6 +896,7 @@ static void kasan_memchr(struct kunit *test)
        ptr = kmalloc(size, GFP_KERNEL | __GFP_ZERO);
        KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ptr);
 
+       OPTIMIZER_HIDE_VAR(ptr);
        OPTIMIZER_HIDE_VAR(size);
        KUNIT_EXPECT_KASAN_FAIL(test,
                kasan_ptr_result = memchr(ptr, '1', size + 1));
@@ -919,6 +923,7 @@ static void kasan_memcmp(struct kunit *test)
        KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ptr);
        memset(arr, 0, sizeof(arr));
 
+       OPTIMIZER_HIDE_VAR(ptr);
        OPTIMIZER_HIDE_VAR(size);
        KUNIT_EXPECT_KASAN_FAIL(test,
                kasan_int_result = memcmp(ptr, arr, size+1));
index a7ac97c..db2abd9 100644 (file)
@@ -171,6 +171,8 @@ static void __init pte_advanced_tests(struct pgtable_debug_args *args)
        ptep_test_and_clear_young(args->vma, args->vaddr, args->ptep);
        pte = ptep_get(args->ptep);
        WARN_ON(pte_young(pte));
+
+       ptep_get_and_clear_full(args->mm, args->vaddr, args->ptep, 1);
 }
 
 static void __init pte_savedwrite_tests(struct pgtable_debug_args *args)
index f0af462..a9d4d72 100644 (file)
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -124,8 +124,8 @@ static inline struct page *try_get_compound_head(struct page *page, int refs)
  * considered failure, and furthermore, a likely bug in the caller, so a warning
  * is also emitted.
  */
-struct page *try_grab_compound_head(struct page *page,
-                                   int refs, unsigned int flags)
+__maybe_unused struct page *try_grab_compound_head(struct page *page,
+                                                  int refs, unsigned int flags)
 {
        if (flags & FOLL_GET)
                return try_get_compound_head(page, refs);
@@ -208,10 +208,35 @@ static void put_compound_head(struct page *page, int refs, unsigned int flags)
  */
 bool __must_check try_grab_page(struct page *page, unsigned int flags)
 {
-       if (!(flags & (FOLL_GET | FOLL_PIN)))
-               return true;
+       WARN_ON_ONCE((flags & (FOLL_GET | FOLL_PIN)) == (FOLL_GET | FOLL_PIN));
 
-       return try_grab_compound_head(page, 1, flags);
+       if (flags & FOLL_GET)
+               return try_get_page(page);
+       else if (flags & FOLL_PIN) {
+               int refs = 1;
+
+               page = compound_head(page);
+
+               if (WARN_ON_ONCE(page_ref_count(page) <= 0))
+                       return false;
+
+               if (hpage_pincount_available(page))
+                       hpage_pincount_add(page, 1);
+               else
+                       refs = GUP_PIN_COUNTING_BIAS;
+
+               /*
+                * Similar to try_grab_compound_head(): even if using the
+                * hpage_pincount_add/_sub() routines, be sure to
+                * *also* increment the normal page refcount field at least
+                * once, so that the page really is pinned.
+                */
+               page_ref_add(page, refs);
+
+               mod_node_page_state(page_pgdat(page), NR_FOLL_PIN_ACQUIRED, 1);
+       }
+
+       return true;
 }
 
 /**
index 35f14d0..131492f 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/hashtable.h>
 #include <linux/userfaultfd_k.h>
 #include <linux/page_idle.h>
+#include <linux/page_table_check.h>
 #include <linux/swapops.h>
 #include <linux/shmem_fs.h>
 
@@ -1416,6 +1417,21 @@ static int khugepaged_add_pte_mapped_thp(struct mm_struct *mm,
        return 0;
 }
 
+static void collapse_and_free_pmd(struct mm_struct *mm, struct vm_area_struct *vma,
+                                 unsigned long addr, pmd_t *pmdp)
+{
+       spinlock_t *ptl;
+       pmd_t pmd;
+
+       mmap_assert_write_locked(mm);
+       ptl = pmd_lock(vma->vm_mm, pmdp);
+       pmd = pmdp_collapse_flush(vma, addr, pmdp);
+       spin_unlock(ptl);
+       mm_dec_nr_ptes(mm);
+       page_table_check_pte_clear_range(mm, addr, pmd);
+       pte_free(mm, pmd_pgtable(pmd));
+}
+
 /**
  * collapse_pte_mapped_thp - Try to collapse a pte-mapped THP for mm at
  * address haddr.
@@ -1433,7 +1449,7 @@ void collapse_pte_mapped_thp(struct mm_struct *mm, unsigned long addr)
        struct vm_area_struct *vma = find_vma(mm, haddr);
        struct page *hpage;
        pte_t *start_pte, *pte;
-       pmd_t *pmd, _pmd;
+       pmd_t *pmd;
        spinlock_t *ptl;
        int count = 0;
        int i;
@@ -1509,12 +1525,7 @@ void collapse_pte_mapped_thp(struct mm_struct *mm, unsigned long addr)
        }
 
        /* step 4: collapse pmd */
-       ptl = pmd_lock(vma->vm_mm, pmd);
-       _pmd = pmdp_collapse_flush(vma, haddr, pmd);
-       spin_unlock(ptl);
-       mm_dec_nr_ptes(mm);
-       pte_free(mm, pmd_pgtable(_pmd));
-
+       collapse_and_free_pmd(mm, vma, haddr, pmd);
 drop_hpage:
        unlock_page(hpage);
        put_page(hpage);
@@ -1552,7 +1563,7 @@ static void retract_page_tables(struct address_space *mapping, pgoff_t pgoff)
        struct vm_area_struct *vma;
        struct mm_struct *mm;
        unsigned long addr;
-       pmd_t *pmd, _pmd;
+       pmd_t *pmd;
 
        i_mmap_lock_write(mapping);
        vma_interval_tree_foreach(vma, &mapping->i_mmap, pgoff, pgoff) {
@@ -1591,14 +1602,8 @@ static void retract_page_tables(struct address_space *mapping, pgoff_t pgoff)
                 * reverse order. Trylock is a way to avoid deadlock.
                 */
                if (mmap_write_trylock(mm)) {
-                       if (!khugepaged_test_exit(mm)) {
-                               spinlock_t *ptl = pmd_lock(mm, pmd);
-                               /* assume page table is clear */
-                               _pmd = pmdp_collapse_flush(vma, addr, pmd);
-                               spin_unlock(ptl);
-                               mm_dec_nr_ptes(mm);
-                               pte_free(mm, pmd_pgtable(_pmd));
-                       }
+                       if (!khugepaged_test_exit(mm))
+                               collapse_and_free_pmd(mm, vma, addr, pmd);
                        mmap_write_unlock(mm);
                } else {
                        /* Try again later */
index dc3758f..7580baa 100644 (file)
@@ -1410,7 +1410,8 @@ static void kmemleak_scan(void)
 {
        unsigned long flags;
        struct kmemleak_object *object;
-       int i;
+       struct zone *zone;
+       int __maybe_unused i;
        int new_leaks = 0;
 
        jiffies_last_scan = jiffies;
@@ -1450,9 +1451,9 @@ static void kmemleak_scan(void)
         * Struct page scanning for each node.
         */
        get_online_mems();
-       for_each_online_node(i) {
-               unsigned long start_pfn = node_start_pfn(i);
-               unsigned long end_pfn = node_end_pfn(i);
+       for_each_populated_zone(zone) {
+               unsigned long start_pfn = zone->zone_start_pfn;
+               unsigned long end_pfn = zone_end_pfn(zone);
                unsigned long pfn;
 
                for (pfn = start_pfn; pfn < end_pfn; pfn++) {
@@ -1461,8 +1462,8 @@ static void kmemleak_scan(void)
                        if (!page)
                                continue;
 
-                       /* only scan pages belonging to this node */
-                       if (page_to_nid(page) != i)
+                       /* only scan pages belonging to this zone */
+                       if (page_zone(page) != zone)
                                continue;
                        /* only scan if page is in use */
                        if (page_count(page) == 0)
index 14ae5c1..97a9ed8 100644 (file)
@@ -1596,6 +1596,12 @@ static int memory_failure_dev_pagemap(unsigned long pfn, int flags,
        }
 
        /*
+        * Pages instantiated by device-dax (not filesystem-dax)
+        * may be compound pages.
+        */
+       page = compound_head(page);
+
+       /*
         * Prevent the inode from being freed while we are interrogating
         * the address_space, typically this would be handled by
         * lock_page(), but dax pages do not use the page lock. This
index 6a0ddda..f67c4c7 100644 (file)
@@ -115,7 +115,7 @@ static void unset_migratetype_isolate(struct page *page, unsigned migratetype)
         * onlining - just onlined memory won't immediately be considered for
         * allocation.
         */
-       if (!isolated_page && PageBuddy(page)) {
+       if (!isolated_page) {
                nr_pages = move_freepages_block(zone, page, migratetype, NULL);
                __mod_zone_freepage_state(zone, nr_pages, migratetype);
        }
index 7504e7c..3763bd0 100644 (file)
@@ -86,8 +86,8 @@ static void page_table_check_clear(struct mm_struct *mm, unsigned long addr,
 {
        struct page_ext *page_ext;
        struct page *page;
+       unsigned long i;
        bool anon;
-       int i;
 
        if (!pfn_valid(pfn))
                return;
@@ -121,8 +121,8 @@ static void page_table_check_set(struct mm_struct *mm, unsigned long addr,
 {
        struct page_ext *page_ext;
        struct page *page;
+       unsigned long i;
        bool anon;
-       int i;
 
        if (!pfn_valid(pfn))
                return;
@@ -152,10 +152,10 @@ static void page_table_check_set(struct mm_struct *mm, unsigned long addr,
 void __page_table_check_zero(struct page *page, unsigned int order)
 {
        struct page_ext *page_ext = lookup_page_ext(page);
-       int i;
+       unsigned long i;
 
        BUG_ON(!page_ext);
-       for (i = 0; i < (1 << order); i++) {
+       for (i = 0; i < (1ul << order); i++) {
                struct page_table_check *ptc = get_page_table_check(page_ext);
 
                BUG_ON(atomic_read(&ptc->anon_map_count));
@@ -206,17 +206,10 @@ EXPORT_SYMBOL(__page_table_check_pud_clear);
 void __page_table_check_pte_set(struct mm_struct *mm, unsigned long addr,
                                pte_t *ptep, pte_t pte)
 {
-       pte_t old_pte;
-
        if (&init_mm == mm)
                return;
 
-       old_pte = *ptep;
-       if (pte_user_accessible_page(old_pte)) {
-               page_table_check_clear(mm, addr, pte_pfn(old_pte),
-                                      PAGE_SIZE >> PAGE_SHIFT);
-       }
-
+       __page_table_check_pte_clear(mm, addr, *ptep);
        if (pte_user_accessible_page(pte)) {
                page_table_check_set(mm, addr, pte_pfn(pte),
                                     PAGE_SIZE >> PAGE_SHIFT,
@@ -228,17 +221,10 @@ EXPORT_SYMBOL(__page_table_check_pte_set);
 void __page_table_check_pmd_set(struct mm_struct *mm, unsigned long addr,
                                pmd_t *pmdp, pmd_t pmd)
 {
-       pmd_t old_pmd;
-
        if (&init_mm == mm)
                return;
 
-       old_pmd = *pmdp;
-       if (pmd_user_accessible_page(old_pmd)) {
-               page_table_check_clear(mm, addr, pmd_pfn(old_pmd),
-                                      PMD_PAGE_SIZE >> PAGE_SHIFT);
-       }
-
+       __page_table_check_pmd_clear(mm, addr, *pmdp);
        if (pmd_user_accessible_page(pmd)) {
                page_table_check_set(mm, addr, pmd_pfn(pmd),
                                     PMD_PAGE_SIZE >> PAGE_SHIFT,
@@ -250,17 +236,10 @@ EXPORT_SYMBOL(__page_table_check_pmd_set);
 void __page_table_check_pud_set(struct mm_struct *mm, unsigned long addr,
                                pud_t *pudp, pud_t pud)
 {
-       pud_t old_pud;
-
        if (&init_mm == mm)
                return;
 
-       old_pud = *pudp;
-       if (pud_user_accessible_page(old_pud)) {
-               page_table_check_clear(mm, addr, pud_pfn(old_pud),
-                                      PUD_PAGE_SIZE >> PAGE_SHIFT);
-       }
-
+       __page_table_check_pud_clear(mm, addr, *pudp);
        if (pud_user_accessible_page(pud)) {
                page_table_check_set(mm, addr, pud_pfn(pud),
                                     PUD_PAGE_SIZE >> PAGE_SHIFT,
@@ -268,3 +247,23 @@ void __page_table_check_pud_set(struct mm_struct *mm, unsigned long addr,
        }
 }
 EXPORT_SYMBOL(__page_table_check_pud_set);
+
+void __page_table_check_pte_clear_range(struct mm_struct *mm,
+                                       unsigned long addr,
+                                       pmd_t pmd)
+{
+       if (&init_mm == mm)
+               return;
+
+       if (!pmd_bad(pmd) && !pmd_leaf(pmd)) {
+               pte_t *ptep = pte_offset_map(&pmd, addr);
+               unsigned long i;
+
+               pte_unmap(ptep);
+               for (i = 0; i < PTRS_PER_PTE; i++) {
+                       __page_table_check_pte_clear(mm, addr, *ptep);
+                       addr += PAGE_SIZE;
+                       ptep++;
+               }
+       }
+}
index 02f43f3..3e49d28 100644 (file)
@@ -77,6 +77,7 @@ static void ax25_kill_by_device(struct net_device *dev)
 {
        ax25_dev *ax25_dev;
        ax25_cb *s;
+       struct sock *sk;
 
        if ((ax25_dev = ax25_dev_ax25dev(dev)) == NULL)
                return;
@@ -85,13 +86,16 @@ static void ax25_kill_by_device(struct net_device *dev)
 again:
        ax25_for_each(s, &ax25_list) {
                if (s->ax25_dev == ax25_dev) {
+                       sk = s->sk;
+                       sock_hold(sk);
                        spin_unlock_bh(&ax25_list_lock);
-                       lock_sock(s->sk);
+                       lock_sock(sk);
                        s->ax25_dev = NULL;
-                       release_sock(s->sk);
+                       ax25_dev_put(ax25_dev);
+                       release_sock(sk);
                        ax25_disconnect(s, ENETUNREACH);
                        spin_lock_bh(&ax25_list_lock);
-
+                       sock_put(sk);
                        /* The entry could have been deleted from the
                         * list meanwhile and thus the next pointer is
                         * no longer valid.  Play it safe and restart
@@ -355,21 +359,25 @@ static int ax25_ctl_ioctl(const unsigned int cmd, void __user *arg)
        if (copy_from_user(&ax25_ctl, arg, sizeof(ax25_ctl)))
                return -EFAULT;
 
-       if ((ax25_dev = ax25_addr_ax25dev(&ax25_ctl.port_addr)) == NULL)
-               return -ENODEV;
-
        if (ax25_ctl.digi_count > AX25_MAX_DIGIS)
                return -EINVAL;
 
        if (ax25_ctl.arg > ULONG_MAX / HZ && ax25_ctl.cmd != AX25_KILL)
                return -EINVAL;
 
+       ax25_dev = ax25_addr_ax25dev(&ax25_ctl.port_addr);
+       if (!ax25_dev)
+               return -ENODEV;
+
        digi.ndigi = ax25_ctl.digi_count;
        for (k = 0; k < digi.ndigi; k++)
                digi.calls[k] = ax25_ctl.digi_addr[k];
 
-       if ((ax25 = ax25_find_cb(&ax25_ctl.source_addr, &ax25_ctl.dest_addr, &digi, ax25_dev->dev)) == NULL)
+       ax25 = ax25_find_cb(&ax25_ctl.source_addr, &ax25_ctl.dest_addr, &digi, ax25_dev->dev);
+       if (!ax25) {
+               ax25_dev_put(ax25_dev);
                return -ENOTCONN;
+       }
 
        switch (ax25_ctl.cmd) {
        case AX25_KILL:
@@ -436,6 +444,7 @@ static int ax25_ctl_ioctl(const unsigned int cmd, void __user *arg)
          }
 
 out_put:
+       ax25_dev_put(ax25_dev);
        ax25_cb_put(ax25);
        return ret;
 
index 256fadb..d2a244e 100644 (file)
@@ -37,6 +37,7 @@ ax25_dev *ax25_addr_ax25dev(ax25_address *addr)
        for (ax25_dev = ax25_dev_list; ax25_dev != NULL; ax25_dev = ax25_dev->next)
                if (ax25cmp(addr, (const ax25_address *)ax25_dev->dev->dev_addr) == 0) {
                        res = ax25_dev;
+                       ax25_dev_hold(ax25_dev);
                }
        spin_unlock_bh(&ax25_dev_lock);
 
@@ -56,6 +57,7 @@ void ax25_dev_device_up(struct net_device *dev)
                return;
        }
 
+       refcount_set(&ax25_dev->refcount, 1);
        dev->ax25_ptr     = ax25_dev;
        ax25_dev->dev     = dev;
        dev_hold_track(dev, &ax25_dev->dev_tracker, GFP_ATOMIC);
@@ -84,6 +86,7 @@ void ax25_dev_device_up(struct net_device *dev)
        ax25_dev->next = ax25_dev_list;
        ax25_dev_list  = ax25_dev;
        spin_unlock_bh(&ax25_dev_lock);
+       ax25_dev_hold(ax25_dev);
 
        ax25_register_dev_sysctl(ax25_dev);
 }
@@ -113,9 +116,10 @@ void ax25_dev_device_down(struct net_device *dev)
        if ((s = ax25_dev_list) == ax25_dev) {
                ax25_dev_list = s->next;
                spin_unlock_bh(&ax25_dev_lock);
+               ax25_dev_put(ax25_dev);
                dev->ax25_ptr = NULL;
                dev_put_track(dev, &ax25_dev->dev_tracker);
-               kfree(ax25_dev);
+               ax25_dev_put(ax25_dev);
                return;
        }
 
@@ -123,9 +127,10 @@ void ax25_dev_device_down(struct net_device *dev)
                if (s->next == ax25_dev) {
                        s->next = ax25_dev->next;
                        spin_unlock_bh(&ax25_dev_lock);
+                       ax25_dev_put(ax25_dev);
                        dev->ax25_ptr = NULL;
                        dev_put_track(dev, &ax25_dev->dev_tracker);
-                       kfree(ax25_dev);
+                       ax25_dev_put(ax25_dev);
                        return;
                }
 
@@ -133,6 +138,7 @@ void ax25_dev_device_down(struct net_device *dev)
        }
        spin_unlock_bh(&ax25_dev_lock);
        dev->ax25_ptr = NULL;
+       ax25_dev_put(ax25_dev);
 }
 
 int ax25_fwd_ioctl(unsigned int cmd, struct ax25_fwd_struct *fwd)
@@ -144,20 +150,32 @@ int ax25_fwd_ioctl(unsigned int cmd, struct ax25_fwd_struct *fwd)
 
        switch (cmd) {
        case SIOCAX25ADDFWD:
-               if ((fwd_dev = ax25_addr_ax25dev(&fwd->port_to)) == NULL)
+               fwd_dev = ax25_addr_ax25dev(&fwd->port_to);
+               if (!fwd_dev) {
+                       ax25_dev_put(ax25_dev);
                        return -EINVAL;
-               if (ax25_dev->forward != NULL)
+               }
+               if (ax25_dev->forward) {
+                       ax25_dev_put(fwd_dev);
+                       ax25_dev_put(ax25_dev);
                        return -EINVAL;
+               }
                ax25_dev->forward = fwd_dev->dev;
+               ax25_dev_put(fwd_dev);
+               ax25_dev_put(ax25_dev);
                break;
 
        case SIOCAX25DELFWD:
-               if (ax25_dev->forward == NULL)
+               if (!ax25_dev->forward) {
+                       ax25_dev_put(ax25_dev);
                        return -EINVAL;
+               }
                ax25_dev->forward = NULL;
+               ax25_dev_put(ax25_dev);
                break;
 
        default:
+               ax25_dev_put(ax25_dev);
                return -EINVAL;
        }
 
index d0b2e09..9751207 100644 (file)
@@ -75,11 +75,13 @@ static int __must_check ax25_rt_add(struct ax25_routes_struct *route)
        ax25_dev *ax25_dev;
        int i;
 
-       if ((ax25_dev = ax25_addr_ax25dev(&route->port_addr)) == NULL)
-               return -EINVAL;
        if (route->digi_count > AX25_MAX_DIGIS)
                return -EINVAL;
 
+       ax25_dev = ax25_addr_ax25dev(&route->port_addr);
+       if (!ax25_dev)
+               return -EINVAL;
+
        write_lock_bh(&ax25_route_lock);
 
        ax25_rt = ax25_route_list;
@@ -91,6 +93,7 @@ static int __must_check ax25_rt_add(struct ax25_routes_struct *route)
                        if (route->digi_count != 0) {
                                if ((ax25_rt->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) {
                                        write_unlock_bh(&ax25_route_lock);
+                                       ax25_dev_put(ax25_dev);
                                        return -ENOMEM;
                                }
                                ax25_rt->digipeat->lastrepeat = -1;
@@ -101,6 +104,7 @@ static int __must_check ax25_rt_add(struct ax25_routes_struct *route)
                                }
                        }
                        write_unlock_bh(&ax25_route_lock);
+                       ax25_dev_put(ax25_dev);
                        return 0;
                }
                ax25_rt = ax25_rt->next;
@@ -108,6 +112,7 @@ static int __must_check ax25_rt_add(struct ax25_routes_struct *route)
 
        if ((ax25_rt = kmalloc(sizeof(ax25_route), GFP_ATOMIC)) == NULL) {
                write_unlock_bh(&ax25_route_lock);
+               ax25_dev_put(ax25_dev);
                return -ENOMEM;
        }
 
@@ -120,6 +125,7 @@ static int __must_check ax25_rt_add(struct ax25_routes_struct *route)
                if ((ax25_rt->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) {
                        write_unlock_bh(&ax25_route_lock);
                        kfree(ax25_rt);
+                       ax25_dev_put(ax25_dev);
                        return -ENOMEM;
                }
                ax25_rt->digipeat->lastrepeat = -1;
@@ -132,6 +138,7 @@ static int __must_check ax25_rt_add(struct ax25_routes_struct *route)
        ax25_rt->next   = ax25_route_list;
        ax25_route_list = ax25_rt;
        write_unlock_bh(&ax25_route_lock);
+       ax25_dev_put(ax25_dev);
 
        return 0;
 }
@@ -173,6 +180,7 @@ static int ax25_rt_del(struct ax25_routes_struct *route)
                }
        }
        write_unlock_bh(&ax25_route_lock);
+       ax25_dev_put(ax25_dev);
 
        return 0;
 }
@@ -215,6 +223,7 @@ static int ax25_rt_opt(struct ax25_route_opt_struct *rt_option)
 
 out:
        write_unlock_bh(&ax25_route_lock);
+       ax25_dev_put(ax25_dev);
        return err;
 }
 
index 84ba456..1402d5c 100644 (file)
@@ -560,10 +560,10 @@ static bool __allowed_ingress(const struct net_bridge *br,
                    !br_opt_get(br, BROPT_VLAN_STATS_ENABLED)) {
                        if (*state == BR_STATE_FORWARDING) {
                                *state = br_vlan_get_pvid_state(vg);
-                               return br_vlan_state_allowed(*state, true);
-                       } else {
-                               return true;
+                               if (!br_vlan_state_allowed(*state, true))
+                                       goto drop;
                        }
+                       return true;
                }
        }
        v = br_vlan_find(vg, *vid);
@@ -2020,7 +2020,8 @@ static int br_vlan_rtm_dump(struct sk_buff *skb, struct netlink_callback *cb)
                        goto out_err;
                }
                err = br_vlan_dump_dev(dev, skb, cb, dump_flags);
-               if (err && err != -EMSGSIZE)
+               /* if the dump completed without an error we return 0 here */
+               if (err != -EMSGSIZE)
                        goto out_err;
        } else {
                for_each_netdev_rcu(net, dev) {
index eba0efe..fbf858d 100644 (file)
@@ -49,7 +49,7 @@ static void nft_reject_br_send_v4_tcp_reset(struct net *net,
 {
        struct sk_buff *nskb;
 
-       nskb = nf_reject_skb_v4_tcp_reset(net, oldskb, dev, hook);
+       nskb = nf_reject_skb_v4_tcp_reset(net, oldskb, NULL, hook);
        if (!nskb)
                return;
 
@@ -65,7 +65,7 @@ static void nft_reject_br_send_v4_unreach(struct net *net,
 {
        struct sk_buff *nskb;
 
-       nskb = nf_reject_skb_v4_unreach(net, oldskb, dev, hook, code);
+       nskb = nf_reject_skb_v4_unreach(net, oldskb, NULL, hook, code);
        if (!nskb)
                return;
 
@@ -81,7 +81,7 @@ static void nft_reject_br_send_v6_tcp_reset(struct net *net,
 {
        struct sk_buff *nskb;
 
-       nskb = nf_reject_skb_v6_tcp_reset(net, oldskb, dev, hook);
+       nskb = nf_reject_skb_v6_tcp_reset(net, oldskb, NULL, hook);
        if (!nskb)
                return;
 
@@ -98,7 +98,7 @@ static void nft_reject_br_send_v6_unreach(struct net *net,
 {
        struct sk_buff *nskb;
 
-       nskb = nf_reject_skb_v6_unreach(net, oldskb, dev, hook, code);
+       nskb = nf_reject_skb_v6_unreach(net, oldskb, NULL, hook, code);
        if (!nskb)
                return;
 
index ecc400a..4c64415 100644 (file)
@@ -246,6 +246,7 @@ enum {
        Opt_cephx_sign_messages,
        Opt_tcp_nodelay,
        Opt_abort_on_full,
+       Opt_rxbounce,
 };
 
 enum {
@@ -295,6 +296,7 @@ static const struct fs_parameter_spec ceph_parameters[] = {
        fsparam_u32     ("osdkeepalive",                Opt_osdkeepalivetimeout),
        fsparam_enum    ("read_from_replica",           Opt_read_from_replica,
                         ceph_param_read_from_replica),
+       fsparam_flag    ("rxbounce",                    Opt_rxbounce),
        fsparam_enum    ("ms_mode",                     Opt_ms_mode,
                         ceph_param_ms_mode),
        fsparam_string  ("secret",                      Opt_secret),
@@ -584,6 +586,9 @@ int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt,
        case Opt_abort_on_full:
                opt->flags |= CEPH_OPT_ABORT_ON_FULL;
                break;
+       case Opt_rxbounce:
+               opt->flags |= CEPH_OPT_RXBOUNCE;
+               break;
 
        default:
                BUG();
@@ -660,6 +665,8 @@ int ceph_print_client_options(struct seq_file *m, struct ceph_client *client,
                seq_puts(m, "notcp_nodelay,");
        if (show_all && (opt->flags & CEPH_OPT_ABORT_ON_FULL))
                seq_puts(m, "abort_on_full,");
+       if (opt->flags & CEPH_OPT_RXBOUNCE)
+               seq_puts(m, "rxbounce,");
 
        if (opt->mount_timeout != CEPH_MOUNT_TIMEOUT_DEFAULT)
                seq_printf(m, "mount_timeout=%d,",
index 45eba2d..d3bb656 100644 (file)
@@ -515,6 +515,10 @@ static void ceph_con_reset_protocol(struct ceph_connection *con)
                ceph_msg_put(con->out_msg);
                con->out_msg = NULL;
        }
+       if (con->bounce_page) {
+               __free_page(con->bounce_page);
+               con->bounce_page = NULL;
+       }
 
        if (ceph_msgr2(from_msgr(con->msgr)))
                ceph_con_v2_reset_protocol(con);
index 2cb5ffd..6b014ec 100644 (file)
@@ -992,8 +992,7 @@ static int read_partial_message_section(struct ceph_connection *con,
 
 static int read_partial_msg_data(struct ceph_connection *con)
 {
-       struct ceph_msg *msg = con->in_msg;
-       struct ceph_msg_data_cursor *cursor = &msg->cursor;
+       struct ceph_msg_data_cursor *cursor = &con->in_msg->cursor;
        bool do_datacrc = !ceph_test_opt(from_msgr(con->msgr), NOCRC);
        struct page *page;
        size_t page_offset;
@@ -1001,9 +1000,6 @@ static int read_partial_msg_data(struct ceph_connection *con)
        u32 crc = 0;
        int ret;
 
-       if (!msg->num_data_items)
-               return -EIO;
-
        if (do_datacrc)
                crc = con->in_data_crc;
        while (cursor->total_resid) {
@@ -1031,6 +1027,46 @@ static int read_partial_msg_data(struct ceph_connection *con)
        return 1;       /* must return > 0 to indicate success */
 }
 
+static int read_partial_msg_data_bounce(struct ceph_connection *con)
+{
+       struct ceph_msg_data_cursor *cursor = &con->in_msg->cursor;
+       struct page *page;
+       size_t off, len;
+       u32 crc;
+       int ret;
+
+       if (unlikely(!con->bounce_page)) {
+               con->bounce_page = alloc_page(GFP_NOIO);
+               if (!con->bounce_page) {
+                       pr_err("failed to allocate bounce page\n");
+                       return -ENOMEM;
+               }
+       }
+
+       crc = con->in_data_crc;
+       while (cursor->total_resid) {
+               if (!cursor->resid) {
+                       ceph_msg_data_advance(cursor, 0);
+                       continue;
+               }
+
+               page = ceph_msg_data_next(cursor, &off, &len, NULL);
+               ret = ceph_tcp_recvpage(con->sock, con->bounce_page, 0, len);
+               if (ret <= 0) {
+                       con->in_data_crc = crc;
+                       return ret;
+               }
+
+               crc = crc32c(crc, page_address(con->bounce_page), ret);
+               memcpy_to_page(page, off, page_address(con->bounce_page), ret);
+
+               ceph_msg_data_advance(cursor, ret);
+       }
+       con->in_data_crc = crc;
+
+       return 1;       /* must return > 0 to indicate success */
+}
+
 /*
  * read (part of) a message.
  */
@@ -1141,7 +1177,13 @@ static int read_partial_message(struct ceph_connection *con)
 
        /* (page) data */
        if (data_len) {
-               ret = read_partial_msg_data(con);
+               if (!m->num_data_items)
+                       return -EIO;
+
+               if (ceph_test_opt(from_msgr(con->msgr), RXBOUNCE))
+                       ret = read_partial_msg_data_bounce(con);
+               else
+                       ret = read_partial_msg_data(con);
                if (ret <= 0)
                        return ret;
        }
index c4099b6..c81379f 100644 (file)
@@ -57,8 +57,9 @@
 #define IN_S_HANDLE_CONTROL_REMAINDER  3
 #define IN_S_PREPARE_READ_DATA         4
 #define IN_S_PREPARE_READ_DATA_CONT    5
-#define IN_S_HANDLE_EPILOGUE           6
-#define IN_S_FINISH_SKIP               7
+#define IN_S_PREPARE_READ_ENC_PAGE     6
+#define IN_S_HANDLE_EPILOGUE           7
+#define IN_S_FINISH_SKIP               8
 
 #define OUT_S_QUEUE_DATA               1
 #define OUT_S_QUEUE_DATA_CONT          2
@@ -1032,22 +1033,41 @@ static int decrypt_control_remainder(struct ceph_connection *con)
                         padded_len(rem_len) + CEPH_GCM_TAG_LEN);
 }
 
-static int decrypt_message(struct ceph_connection *con)
+static int decrypt_tail(struct ceph_connection *con)
 {
+       struct sg_table enc_sgt = {};
        struct sg_table sgt = {};
+       int tail_len;
        int ret;
 
+       tail_len = tail_onwire_len(con->in_msg, true);
+       ret = sg_alloc_table_from_pages(&enc_sgt, con->v2.in_enc_pages,
+                                       con->v2.in_enc_page_cnt, 0, tail_len,
+                                       GFP_NOIO);
+       if (ret)
+               goto out;
+
        ret = setup_message_sgs(&sgt, con->in_msg, FRONT_PAD(con->v2.in_buf),
                        MIDDLE_PAD(con->v2.in_buf), DATA_PAD(con->v2.in_buf),
                        con->v2.in_buf, true);
        if (ret)
                goto out;
 
-       ret = gcm_crypt(con, false, sgt.sgl, sgt.sgl,
-                       tail_onwire_len(con->in_msg, true));
+       dout("%s con %p msg %p enc_page_cnt %d sg_cnt %d\n", __func__, con,
+            con->in_msg, con->v2.in_enc_page_cnt, sgt.orig_nents);
+       ret = gcm_crypt(con, false, enc_sgt.sgl, sgt.sgl, tail_len);
+       if (ret)
+               goto out;
+
+       WARN_ON(!con->v2.in_enc_page_cnt);
+       ceph_release_page_vector(con->v2.in_enc_pages,
+                                con->v2.in_enc_page_cnt);
+       con->v2.in_enc_pages = NULL;
+       con->v2.in_enc_page_cnt = 0;
 
 out:
        sg_free_table(&sgt);
+       sg_free_table(&enc_sgt);
        return ret;
 }
 
@@ -1733,54 +1753,157 @@ static int prepare_read_control_remainder(struct ceph_connection *con)
        return 0;
 }
 
-static void prepare_read_data(struct ceph_connection *con)
+static int prepare_read_data(struct ceph_connection *con)
 {
        struct bio_vec bv;
 
-       if (!con_secure(con))
-               con->in_data_crc = -1;
+       con->in_data_crc = -1;
        ceph_msg_data_cursor_init(&con->v2.in_cursor, con->in_msg,
                                  data_len(con->in_msg));
 
        get_bvec_at(&con->v2.in_cursor, &bv);
-       set_in_bvec(con, &bv);
+       if (ceph_test_opt(from_msgr(con->msgr), RXBOUNCE)) {
+               if (unlikely(!con->bounce_page)) {
+                       con->bounce_page = alloc_page(GFP_NOIO);
+                       if (!con->bounce_page) {
+                               pr_err("failed to allocate bounce page\n");
+                               return -ENOMEM;
+                       }
+               }
+
+               bv.bv_page = con->bounce_page;
+               bv.bv_offset = 0;
+               set_in_bvec(con, &bv);
+       } else {
+               set_in_bvec(con, &bv);
+       }
        con->v2.in_state = IN_S_PREPARE_READ_DATA_CONT;
+       return 0;
 }
 
 static void prepare_read_data_cont(struct ceph_connection *con)
 {
        struct bio_vec bv;
 
-       if (!con_secure(con))
+       if (ceph_test_opt(from_msgr(con->msgr), RXBOUNCE)) {
+               con->in_data_crc = crc32c(con->in_data_crc,
+                                         page_address(con->bounce_page),
+                                         con->v2.in_bvec.bv_len);
+
+               get_bvec_at(&con->v2.in_cursor, &bv);
+               memcpy_to_page(bv.bv_page, bv.bv_offset,
+                              page_address(con->bounce_page),
+                              con->v2.in_bvec.bv_len);
+       } else {
                con->in_data_crc = ceph_crc32c_page(con->in_data_crc,
                                                    con->v2.in_bvec.bv_page,
                                                    con->v2.in_bvec.bv_offset,
                                                    con->v2.in_bvec.bv_len);
+       }
 
        ceph_msg_data_advance(&con->v2.in_cursor, con->v2.in_bvec.bv_len);
        if (con->v2.in_cursor.total_resid) {
                get_bvec_at(&con->v2.in_cursor, &bv);
-               set_in_bvec(con, &bv);
+               if (ceph_test_opt(from_msgr(con->msgr), RXBOUNCE)) {
+                       bv.bv_page = con->bounce_page;
+                       bv.bv_offset = 0;
+                       set_in_bvec(con, &bv);
+               } else {
+                       set_in_bvec(con, &bv);
+               }
                WARN_ON(con->v2.in_state != IN_S_PREPARE_READ_DATA_CONT);
                return;
        }
 
        /*
-        * We've read all data.  Prepare to read data padding (if any)
-        * and epilogue.
+        * We've read all data.  Prepare to read epilogue.
         */
        reset_in_kvecs(con);
-       if (con_secure(con)) {
-               if (need_padding(data_len(con->in_msg)))
-                       add_in_kvec(con, DATA_PAD(con->v2.in_buf),
-                                   padding_len(data_len(con->in_msg)));
-               add_in_kvec(con, con->v2.in_buf, CEPH_EPILOGUE_SECURE_LEN);
+       add_in_kvec(con, con->v2.in_buf, CEPH_EPILOGUE_PLAIN_LEN);
+       con->v2.in_state = IN_S_HANDLE_EPILOGUE;
+}
+
+static int prepare_read_tail_plain(struct ceph_connection *con)
+{
+       struct ceph_msg *msg = con->in_msg;
+
+       if (!front_len(msg) && !middle_len(msg)) {
+               WARN_ON(!data_len(msg));
+               return prepare_read_data(con);
+       }
+
+       reset_in_kvecs(con);
+       if (front_len(msg)) {
+               add_in_kvec(con, msg->front.iov_base, front_len(msg));
+               WARN_ON(msg->front.iov_len != front_len(msg));
+       }
+       if (middle_len(msg)) {
+               add_in_kvec(con, msg->middle->vec.iov_base, middle_len(msg));
+               WARN_ON(msg->middle->vec.iov_len != middle_len(msg));
+       }
+
+       if (data_len(msg)) {
+               con->v2.in_state = IN_S_PREPARE_READ_DATA;
        } else {
                add_in_kvec(con, con->v2.in_buf, CEPH_EPILOGUE_PLAIN_LEN);
+               con->v2.in_state = IN_S_HANDLE_EPILOGUE;
        }
+       return 0;
+}
+
+static void prepare_read_enc_page(struct ceph_connection *con)
+{
+       struct bio_vec bv;
+
+       dout("%s con %p i %d resid %d\n", __func__, con, con->v2.in_enc_i,
+            con->v2.in_enc_resid);
+       WARN_ON(!con->v2.in_enc_resid);
+
+       bv.bv_page = con->v2.in_enc_pages[con->v2.in_enc_i];
+       bv.bv_offset = 0;
+       bv.bv_len = min(con->v2.in_enc_resid, (int)PAGE_SIZE);
+
+       set_in_bvec(con, &bv);
+       con->v2.in_enc_i++;
+       con->v2.in_enc_resid -= bv.bv_len;
+
+       if (con->v2.in_enc_resid) {
+               con->v2.in_state = IN_S_PREPARE_READ_ENC_PAGE;
+               return;
+       }
+
+       /*
+        * We are set to read the last piece of ciphertext (ending
+        * with epilogue) + auth tag.
+        */
+       WARN_ON(con->v2.in_enc_i != con->v2.in_enc_page_cnt);
        con->v2.in_state = IN_S_HANDLE_EPILOGUE;
 }
 
+static int prepare_read_tail_secure(struct ceph_connection *con)
+{
+       struct page **enc_pages;
+       int enc_page_cnt;
+       int tail_len;
+
+       tail_len = tail_onwire_len(con->in_msg, true);
+       WARN_ON(!tail_len);
+
+       enc_page_cnt = calc_pages_for(0, tail_len);
+       enc_pages = ceph_alloc_page_vector(enc_page_cnt, GFP_NOIO);
+       if (IS_ERR(enc_pages))
+               return PTR_ERR(enc_pages);
+
+       WARN_ON(con->v2.in_enc_pages || con->v2.in_enc_page_cnt);
+       con->v2.in_enc_pages = enc_pages;
+       con->v2.in_enc_page_cnt = enc_page_cnt;
+       con->v2.in_enc_resid = tail_len;
+       con->v2.in_enc_i = 0;
+
+       prepare_read_enc_page(con);
+       return 0;
+}
+
 static void __finish_skip(struct ceph_connection *con)
 {
        con->in_seq++;
@@ -2589,47 +2712,26 @@ static int __handle_control(struct ceph_connection *con, void *p)
        }
 
        msg = con->in_msg;  /* set in process_message_header() */
-       if (!front_len(msg) && !middle_len(msg)) {
-               if (!data_len(msg))
-                       return process_message(con);
-
-               prepare_read_data(con);
-               return 0;
-       }
-
-       reset_in_kvecs(con);
        if (front_len(msg)) {
                WARN_ON(front_len(msg) > msg->front_alloc_len);
-               add_in_kvec(con, msg->front.iov_base, front_len(msg));
                msg->front.iov_len = front_len(msg);
-
-               if (con_secure(con) && need_padding(front_len(msg)))
-                       add_in_kvec(con, FRONT_PAD(con->v2.in_buf),
-                                   padding_len(front_len(msg)));
        } else {
                msg->front.iov_len = 0;
        }
        if (middle_len(msg)) {
                WARN_ON(middle_len(msg) > msg->middle->alloc_len);
-               add_in_kvec(con, msg->middle->vec.iov_base, middle_len(msg));
                msg->middle->vec.iov_len = middle_len(msg);
-
-               if (con_secure(con) && need_padding(middle_len(msg)))
-                       add_in_kvec(con, MIDDLE_PAD(con->v2.in_buf),
-                                   padding_len(middle_len(msg)));
        } else if (msg->middle) {
                msg->middle->vec.iov_len = 0;
        }
 
-       if (data_len(msg)) {
-               con->v2.in_state = IN_S_PREPARE_READ_DATA;
-       } else {
-               add_in_kvec(con, con->v2.in_buf,
-                           con_secure(con) ? CEPH_EPILOGUE_SECURE_LEN :
-                                             CEPH_EPILOGUE_PLAIN_LEN);
-               con->v2.in_state = IN_S_HANDLE_EPILOGUE;
-       }
-       return 0;
+       if (!front_len(msg) && !middle_len(msg) && !data_len(msg))
+               return process_message(con);
+
+       if (con_secure(con))
+               return prepare_read_tail_secure(con);
+
+       return prepare_read_tail_plain(con);
 }
 
 static int handle_preamble(struct ceph_connection *con)
@@ -2717,7 +2819,7 @@ static int handle_epilogue(struct ceph_connection *con)
        int ret;
 
        if (con_secure(con)) {
-               ret = decrypt_message(con);
+               ret = decrypt_tail(con);
                if (ret) {
                        if (ret == -EBADMSG)
                                con->error_msg = "integrity error, bad epilogue auth tag";
@@ -2785,13 +2887,16 @@ static int populate_in_iter(struct ceph_connection *con)
                        ret = handle_control_remainder(con);
                        break;
                case IN_S_PREPARE_READ_DATA:
-                       prepare_read_data(con);
-                       ret = 0;
+                       ret = prepare_read_data(con);
                        break;
                case IN_S_PREPARE_READ_DATA_CONT:
                        prepare_read_data_cont(con);
                        ret = 0;
                        break;
+               case IN_S_PREPARE_READ_ENC_PAGE:
+                       prepare_read_enc_page(con);
+                       ret = 0;
+                       break;
                case IN_S_HANDLE_EPILOGUE:
                        ret = handle_epilogue(con);
                        break;
@@ -3326,20 +3431,16 @@ void ceph_con_v2_revoke(struct ceph_connection *con)
 
 static void revoke_at_prepare_read_data(struct ceph_connection *con)
 {
-       int remaining;  /* data + [data padding] + epilogue */
+       int remaining;
        int resid;
 
+       WARN_ON(con_secure(con));
        WARN_ON(!data_len(con->in_msg));
        WARN_ON(!iov_iter_is_kvec(&con->v2.in_iter));
        resid = iov_iter_count(&con->v2.in_iter);
        WARN_ON(!resid);
 
-       if (con_secure(con))
-               remaining = padded_len(data_len(con->in_msg)) +
-                           CEPH_EPILOGUE_SECURE_LEN;
-       else
-               remaining = data_len(con->in_msg) + CEPH_EPILOGUE_PLAIN_LEN;
-
+       remaining = data_len(con->in_msg) + CEPH_EPILOGUE_PLAIN_LEN;
        dout("%s con %p resid %d remaining %d\n", __func__, con, resid,
             remaining);
        con->v2.in_iter.count -= resid;
@@ -3350,8 +3451,9 @@ static void revoke_at_prepare_read_data(struct ceph_connection *con)
 static void revoke_at_prepare_read_data_cont(struct ceph_connection *con)
 {
        int recved, resid;  /* current piece of data */
-       int remaining;  /* [data padding] + epilogue */
+       int remaining;
 
+       WARN_ON(con_secure(con));
        WARN_ON(!data_len(con->in_msg));
        WARN_ON(!iov_iter_is_bvec(&con->v2.in_iter));
        resid = iov_iter_count(&con->v2.in_iter);
@@ -3363,12 +3465,7 @@ static void revoke_at_prepare_read_data_cont(struct ceph_connection *con)
                ceph_msg_data_advance(&con->v2.in_cursor, recved);
        WARN_ON(resid > con->v2.in_cursor.total_resid);
 
-       if (con_secure(con))
-               remaining = padding_len(data_len(con->in_msg)) +
-                           CEPH_EPILOGUE_SECURE_LEN;
-       else
-               remaining = CEPH_EPILOGUE_PLAIN_LEN;
-
+       remaining = CEPH_EPILOGUE_PLAIN_LEN;
        dout("%s con %p total_resid %zu remaining %d\n", __func__, con,
             con->v2.in_cursor.total_resid, remaining);
        con->v2.in_iter.count -= resid;
@@ -3376,11 +3473,26 @@ static void revoke_at_prepare_read_data_cont(struct ceph_connection *con)
        con->v2.in_state = IN_S_FINISH_SKIP;
 }
 
+static void revoke_at_prepare_read_enc_page(struct ceph_connection *con)
+{
+       int resid;  /* current enc page (not necessarily data) */
+
+       WARN_ON(!con_secure(con));
+       WARN_ON(!iov_iter_is_bvec(&con->v2.in_iter));
+       resid = iov_iter_count(&con->v2.in_iter);
+       WARN_ON(!resid || resid > con->v2.in_bvec.bv_len);
+
+       dout("%s con %p resid %d enc_resid %d\n", __func__, con, resid,
+            con->v2.in_enc_resid);
+       con->v2.in_iter.count -= resid;
+       set_in_skip(con, resid + con->v2.in_enc_resid);
+       con->v2.in_state = IN_S_FINISH_SKIP;
+}
+
 static void revoke_at_handle_epilogue(struct ceph_connection *con)
 {
        int resid;
 
-       WARN_ON(!iov_iter_is_kvec(&con->v2.in_iter));
        resid = iov_iter_count(&con->v2.in_iter);
        WARN_ON(!resid);
 
@@ -3399,6 +3511,9 @@ void ceph_con_v2_revoke_incoming(struct ceph_connection *con)
        case IN_S_PREPARE_READ_DATA_CONT:
                revoke_at_prepare_read_data_cont(con);
                break;
+       case IN_S_PREPARE_READ_ENC_PAGE:
+               revoke_at_prepare_read_enc_page(con);
+               break;
        case IN_S_HANDLE_EPILOGUE:
                revoke_at_handle_epilogue(con);
                break;
@@ -3432,6 +3547,13 @@ void ceph_con_v2_reset_protocol(struct ceph_connection *con)
        clear_out_sign_kvecs(con);
        free_conn_bufs(con);
 
+       if (con->v2.in_enc_pages) {
+               WARN_ON(!con->v2.in_enc_page_cnt);
+               ceph_release_page_vector(con->v2.in_enc_pages,
+                                        con->v2.in_enc_page_cnt);
+               con->v2.in_enc_pages = NULL;
+               con->v2.in_enc_page_cnt = 0;
+       }
        if (con->v2.out_enc_pages) {
                WARN_ON(!con->v2.out_enc_page_cnt);
                ceph_release_page_vector(con->v2.out_enc_pages,
index 6c2016f..ec0bf73 100644 (file)
@@ -1133,7 +1133,8 @@ out:
        neigh_release(neigh);
 }
 
-int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
+int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb,
+                      const bool immediate_ok)
 {
        int rc;
        bool immediate_probe = false;
@@ -1154,12 +1155,17 @@ int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
                        atomic_set(&neigh->probes,
                                   NEIGH_VAR(neigh->parms, UCAST_PROBES));
                        neigh_del_timer(neigh);
-                       neigh->nud_state     = NUD_INCOMPLETE;
+                       neigh->nud_state = NUD_INCOMPLETE;
                        neigh->updated = now;
-                       next = now + max(NEIGH_VAR(neigh->parms, RETRANS_TIME),
-                                        HZ/100);
+                       if (!immediate_ok) {
+                               next = now + 1;
+                       } else {
+                               immediate_probe = true;
+                               next = now + max(NEIGH_VAR(neigh->parms,
+                                                          RETRANS_TIME),
+                                                HZ / 100);
+                       }
                        neigh_add_timer(neigh, next);
-                       immediate_probe = true;
                } else {
                        neigh->nud_state = NUD_FAILED;
                        neigh->updated = jiffies;
@@ -1571,7 +1577,7 @@ static void neigh_managed_work(struct work_struct *work)
 
        write_lock_bh(&tbl->lock);
        list_for_each_entry(neigh, &tbl->managed_list, managed_list)
-               neigh_event_send(neigh, NULL);
+               neigh_event_send_probe(neigh, NULL, false);
        queue_delayed_work(system_power_efficient_wq, &tbl->managed_work,
                           NEIGH_VAR(&tbl->parms, DELAY_PROBE_TIME));
        write_unlock_bh(&tbl->lock);
index d8b9dba..88cc0ad 100644 (file)
@@ -190,12 +190,23 @@ static const struct seq_operations softnet_seq_ops = {
        .show  = softnet_seq_show,
 };
 
-static void *ptype_get_idx(loff_t pos)
+static void *ptype_get_idx(struct seq_file *seq, loff_t pos)
 {
+       struct list_head *ptype_list = NULL;
        struct packet_type *pt = NULL;
+       struct net_device *dev;
        loff_t i = 0;
        int t;
 
+       for_each_netdev_rcu(seq_file_net(seq), dev) {
+               ptype_list = &dev->ptype_all;
+               list_for_each_entry_rcu(pt, ptype_list, list) {
+                       if (i == pos)
+                               return pt;
+                       ++i;
+               }
+       }
+
        list_for_each_entry_rcu(pt, &ptype_all, list) {
                if (i == pos)
                        return pt;
@@ -216,22 +227,40 @@ static void *ptype_seq_start(struct seq_file *seq, loff_t *pos)
        __acquires(RCU)
 {
        rcu_read_lock();
-       return *pos ? ptype_get_idx(*pos - 1) : SEQ_START_TOKEN;
+       return *pos ? ptype_get_idx(seq, *pos - 1) : SEQ_START_TOKEN;
 }
 
 static void *ptype_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 {
+       struct net_device *dev;
        struct packet_type *pt;
        struct list_head *nxt;
        int hash;
 
        ++*pos;
        if (v == SEQ_START_TOKEN)
-               return ptype_get_idx(0);
+               return ptype_get_idx(seq, 0);
 
        pt = v;
        nxt = pt->list.next;
+       if (pt->dev) {
+               if (nxt != &pt->dev->ptype_all)
+                       goto found;
+
+               dev = pt->dev;
+               for_each_netdev_continue_rcu(seq_file_net(seq), dev) {
+                       if (!list_empty(&dev->ptype_all)) {
+                               nxt = dev->ptype_all.next;
+                               goto found;
+                       }
+               }
+
+               nxt = ptype_all.next;
+               goto ptype_all;
+       }
+
        if (pt->type == htons(ETH_P_ALL)) {
+ptype_all:
                if (nxt != &ptype_all)
                        goto found;
                hash = 0;
@@ -260,7 +289,8 @@ static int ptype_seq_show(struct seq_file *seq, void *v)
 
        if (v == SEQ_START_TOKEN)
                seq_puts(seq, "Type Device      Function\n");
-       else if (pt->dev == NULL || dev_net(pt->dev) == seq_file_net(seq)) {
+       else if ((!pt->af_packet_net || net_eq(pt->af_packet_net, seq_file_net(seq))) &&
+                (!pt->dev || net_eq(dev_net(pt->dev), seq_file_net(seq)))) {
                if (pt->type == htons(ETH_P_ALL))
                        seq_puts(seq, "ALL ");
                else
index e476403..710da8a 100644 (file)
@@ -3275,8 +3275,8 @@ static int __rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh,
        struct nlattr *slave_attr[RTNL_SLAVE_MAX_TYPE + 1];
        unsigned char name_assign_type = NET_NAME_USER;
        struct nlattr *linkinfo[IFLA_INFO_MAX + 1];
-       const struct rtnl_link_ops *m_ops = NULL;
-       struct net_device *master_dev = NULL;
+       const struct rtnl_link_ops *m_ops;
+       struct net_device *master_dev;
        struct net *net = sock_net(skb->sk);
        const struct rtnl_link_ops *ops;
        struct nlattr *tb[IFLA_MAX + 1];
@@ -3314,6 +3314,8 @@ replay:
        else
                dev = NULL;
 
+       master_dev = NULL;
+       m_ops = NULL;
        if (dev) {
                master_dev = netdev_master_upper_dev_get(dev);
                if (master_dev)
index 277124f..e0b072a 100644 (file)
@@ -1441,7 +1441,7 @@ static int nl802154_send_key(struct sk_buff *msg, u32 cmd, u32 portid,
 
        hdr = nl802154hdr_put(msg, portid, seq, flags, cmd);
        if (!hdr)
-               return -1;
+               return -ENOBUFS;
 
        if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex))
                goto nla_put_failure;
@@ -1634,7 +1634,7 @@ static int nl802154_send_device(struct sk_buff *msg, u32 cmd, u32 portid,
 
        hdr = nl802154hdr_put(msg, portid, seq, flags, cmd);
        if (!hdr)
-               return -1;
+               return -ENOBUFS;
 
        if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex))
                goto nla_put_failure;
@@ -1812,7 +1812,7 @@ static int nl802154_send_devkey(struct sk_buff *msg, u32 cmd, u32 portid,
 
        hdr = nl802154hdr_put(msg, portid, seq, flags, cmd);
        if (!hdr)
-               return -1;
+               return -ENOBUFS;
 
        if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex))
                goto nla_put_failure;
@@ -1988,7 +1988,7 @@ static int nl802154_send_seclevel(struct sk_buff *msg, u32 cmd, u32 portid,
 
        hdr = nl802154hdr_put(msg, portid, seq, flags, cmd);
        if (!hdr)
-               return -1;
+               return -ENOBUFS;
 
        if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex))
                goto nla_put_failure;
index 57c1d84..139cec2 100644 (file)
@@ -162,12 +162,19 @@ int ip_build_and_send_pkt(struct sk_buff *skb, const struct sock *sk,
        iph->daddr    = (opt && opt->opt.srr ? opt->opt.faddr : daddr);
        iph->saddr    = saddr;
        iph->protocol = sk->sk_protocol;
-       if (ip_dont_fragment(sk, &rt->dst)) {
+       /* Do not bother generating IPID for small packets (eg SYNACK) */
+       if (skb->len <= IPV4_MIN_MTU || ip_dont_fragment(sk, &rt->dst)) {
                iph->frag_off = htons(IP_DF);
                iph->id = 0;
        } else {
                iph->frag_off = 0;
-               __ip_select_ident(net, iph, 1);
+               /* TCP packets here are SYNACK with fat IPv4/TCP options.
+                * Avoid using the hashed IP ident generator.
+                */
+               if (sk->sk_protocol == IPPROTO_TCP)
+                       iph->id = (__force __be16)prandom_u32();
+               else
+                       __ip_select_ident(net, iph, 1);
        }
 
        if (opt && opt->opt.optlen) {
@@ -825,15 +832,24 @@ int ip_do_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
                /* Everything is OK. Generate! */
                ip_fraglist_init(skb, iph, hlen, &iter);
 
-               if (iter.frag)
-                       ip_options_fragment(iter.frag);
-
                for (;;) {
                        /* Prepare header of the next frame,
                         * before previous one went down. */
                        if (iter.frag) {
+                               bool first_frag = (iter.offset == 0);
+
                                IPCB(iter.frag)->flags = IPCB(skb)->flags;
                                ip_fraglist_prepare(skb, &iter);
+                               if (first_frag && IPCB(skb)->opt.optlen) {
+                                       /* ipcb->opt is not populated for frags
+                                        * coming from __ip_make_skb(),
+                                        * ip_options_fragment() needs optlen
+                                        */
+                                       IPCB(iter.frag)->opt.optlen =
+                                               IPCB(skb)->opt.optlen;
+                                       ip_options_fragment(iter.frag);
+                                       ip_send_check(iter.iph);
+                               }
                        }
 
                        skb->tstamp = tstamp;
index 67087f9..aab3841 100644 (file)
@@ -58,10 +58,6 @@ config NF_TABLES_ARP
 
 endif # NF_TABLES
 
-config NF_FLOW_TABLE_IPV4
-       tristate
-       select NF_FLOW_TABLE_INET
-
 config NF_DUP_IPV4
        tristate "Netfilter IPv4 packet duplication to alternate destination"
        depends on !NF_CONNTRACK || NF_CONNTRACK
index 0e56df3..bcf7bc7 100644 (file)
@@ -220,7 +220,8 @@ static struct sock *ping_lookup(struct net *net, struct sk_buff *skb, u16 ident)
                        continue;
                }
 
-               if (sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif)
+               if (sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif &&
+                   sk->sk_bound_dev_if != inet_sdif(skb))
                        continue;
 
                sock_hold(sk);
index 9eb5fc2..9f97b9c 100644 (file)
@@ -722,6 +722,7 @@ static int raw_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len)
        int ret = -EINVAL;
        int chk_addr_ret;
 
+       lock_sock(sk);
        if (sk->sk_state != TCP_CLOSE || addr_len < sizeof(struct sockaddr_in))
                goto out;
 
@@ -741,7 +742,9 @@ static int raw_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len)
                inet->inet_saddr = 0;  /* Use device */
        sk_dst_reset(sk);
        ret = 0;
-out:   return ret;
+out:
+       release_sock(sk);
+       return ret;
 }
 
 /*
index 3b75836..bdf108f 100644 (file)
@@ -842,6 +842,7 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos,
        }
 
        release_sock(sk);
+       sk_defer_free_flush(sk);
 
        if (spliced)
                return spliced;
@@ -1321,10 +1322,13 @@ new_segment:
 
                        /* skb changing from pure zc to mixed, must charge zc */
                        if (unlikely(skb_zcopy_pure(skb))) {
-                               if (!sk_wmem_schedule(sk, skb->data_len))
+                               u32 extra = skb->truesize -
+                                           SKB_TRUESIZE(skb_end_offset(skb));
+
+                               if (!sk_wmem_schedule(sk, extra))
                                        goto wait_for_space;
 
-                               sk_mem_charge(sk, skb->data_len);
+                               sk_mem_charge(sk, extra);
                                skb_shinfo(skb)->flags &= ~SKBFL_PURE_ZEROCOPY;
                        }
 
index dc49a3d..bfe4112 100644 (file)
@@ -1660,6 +1660,8 @@ static struct sk_buff *tcp_shift_skb_data(struct sock *sk, struct sk_buff *skb,
            (mss != tcp_skb_seglen(skb)))
                goto out;
 
+       if (!tcp_skb_can_collapse(prev, skb))
+               goto out;
        len = skb->len;
        pcount = tcp_skb_pcount(skb);
        if (tcp_skb_shift(prev, skb, pcount, len))
index b53476e..fec656f 100644 (file)
@@ -2095,7 +2095,7 @@ process:
        nf_reset_ct(skb);
 
        if (tcp_filter(sk, skb)) {
-               drop_reason = SKB_DROP_REASON_TCP_FILTER;
+               drop_reason = SKB_DROP_REASON_SOCKET_FILTER;
                goto discard_and_relse;
        }
        th = (const struct tcphdr *)skb->data;
index 3eee177..f927c19 100644 (file)
@@ -2589,7 +2589,7 @@ int addrconf_prefix_rcv_add_addr(struct net *net, struct net_device *dev,
                                 __u32 valid_lft, u32 prefered_lft)
 {
        struct inet6_ifaddr *ifp = ipv6_get_ifaddr(net, addr, dev, 1);
-       int create = 0;
+       int create = 0, update_lft = 0;
 
        if (!ifp && valid_lft) {
                int max_addresses = in6_dev->cnf.max_addresses;
@@ -2633,19 +2633,32 @@ int addrconf_prefix_rcv_add_addr(struct net *net, struct net_device *dev,
                unsigned long now;
                u32 stored_lft;
 
-               /* Update lifetime (RFC4862 5.5.3 e)
-                * We deviate from RFC4862 by honoring all Valid Lifetimes to
-                * improve the reaction of SLAAC to renumbering events
-                * (draft-gont-6man-slaac-renum-06, Section 4.2)
-                */
+               /* update lifetime (RFC2462 5.5.3 e) */
                spin_lock_bh(&ifp->lock);
                now = jiffies;
                if (ifp->valid_lft > (now - ifp->tstamp) / HZ)
                        stored_lft = ifp->valid_lft - (now - ifp->tstamp) / HZ;
                else
                        stored_lft = 0;
-
                if (!create && stored_lft) {
+                       const u32 minimum_lft = min_t(u32,
+                               stored_lft, MIN_VALID_LIFETIME);
+                       valid_lft = max(valid_lft, minimum_lft);
+
+                       /* RFC4862 Section 5.5.3e:
+                        * "Note that the preferred lifetime of the
+                        *  corresponding address is always reset to
+                        *  the Preferred Lifetime in the received
+                        *  Prefix Information option, regardless of
+                        *  whether the valid lifetime is also reset or
+                        *  ignored."
+                        *
+                        * So we should always update prefered_lft here.
+                        */
+                       update_lft = 1;
+               }
+
+               if (update_lft) {
                        ifp->valid_lft = valid_lft;
                        ifp->prefered_lft = prefered_lft;
                        ifp->tstamp = now;
index 463c37d..413f667 100644 (file)
@@ -112,7 +112,7 @@ void fib6_update_sernum(struct net *net, struct fib6_info *f6i)
        fn = rcu_dereference_protected(f6i->fib6_node,
                        lockdep_is_held(&f6i->fib6_table->tb6_lock));
        if (fn)
-               fn->fn_sernum = fib6_new_sernum(net);
+               WRITE_ONCE(fn->fn_sernum, fib6_new_sernum(net));
 }
 
 /*
@@ -590,12 +590,13 @@ static int fib6_dump_table(struct fib6_table *table, struct sk_buff *skb,
                spin_unlock_bh(&table->tb6_lock);
                if (res > 0) {
                        cb->args[4] = 1;
-                       cb->args[5] = w->root->fn_sernum;
+                       cb->args[5] = READ_ONCE(w->root->fn_sernum);
                }
        } else {
-               if (cb->args[5] != w->root->fn_sernum) {
+               int sernum = READ_ONCE(w->root->fn_sernum);
+               if (cb->args[5] != sernum) {
                        /* Begin at the root if the tree changed */
-                       cb->args[5] = w->root->fn_sernum;
+                       cb->args[5] = sernum;
                        w->state = FWS_INIT;
                        w->node = w->root;
                        w->skip = w->count;
@@ -1345,7 +1346,7 @@ static void __fib6_update_sernum_upto_root(struct fib6_info *rt,
        /* paired with smp_rmb() in fib6_get_cookie_safe() */
        smp_wmb();
        while (fn) {
-               fn->fn_sernum = sernum;
+               WRITE_ONCE(fn->fn_sernum, sernum);
                fn = rcu_dereference_protected(fn->parent,
                                lockdep_is_held(&rt->fib6_table->tb6_lock));
        }
@@ -2174,8 +2175,8 @@ static int fib6_clean_node(struct fib6_walker *w)
        };
 
        if (c->sernum != FIB6_NO_SERNUM_CHANGE &&
-           w->node->fn_sernum != c->sernum)
-               w->node->fn_sernum = c->sernum;
+           READ_ONCE(w->node->fn_sernum) != c->sernum)
+               WRITE_ONCE(w->node->fn_sernum, c->sernum);
 
        if (!c->func) {
                WARN_ON_ONCE(c->sernum == FIB6_NO_SERNUM_CHANGE);
@@ -2543,7 +2544,7 @@ static void ipv6_route_seq_setup_walk(struct ipv6_route_iter *iter,
        iter->w.state = FWS_INIT;
        iter->w.node = iter->w.root;
        iter->w.args = iter;
-       iter->sernum = iter->w.root->fn_sernum;
+       iter->sernum = READ_ONCE(iter->w.root->fn_sernum);
        INIT_LIST_HEAD(&iter->w.lh);
        fib6_walker_link(net, &iter->w);
 }
@@ -2571,8 +2572,10 @@ static struct fib6_table *ipv6_route_seq_next_table(struct fib6_table *tbl,
 
 static void ipv6_route_check_sernum(struct ipv6_route_iter *iter)
 {
-       if (iter->sernum != iter->w.root->fn_sernum) {
-               iter->sernum = iter->w.root->fn_sernum;
+       int sernum = READ_ONCE(iter->w.root->fn_sernum);
+
+       if (iter->sernum != sernum) {
+               iter->sernum = sernum;
                iter->w.state = FWS_INIT;
                iter->w.node = iter->w.root;
                WARN_ON(iter->w.skip);
index fe786df..97ade83 100644 (file)
@@ -1036,14 +1036,14 @@ int ip6_tnl_xmit_ctl(struct ip6_tnl *t,
 
                if (unlikely(!ipv6_chk_addr_and_flags(net, laddr, ldev, false,
                                                      0, IFA_F_TENTATIVE)))
-                       pr_warn("%s xmit: Local address not yet configured!\n",
-                               p->name);
+                       pr_warn_ratelimited("%s xmit: Local address not yet configured!\n",
+                                           p->name);
                else if (!(p->flags & IP6_TNL_F_ALLOW_LOCAL_REMOTE) &&
                         !ipv6_addr_is_multicast(raddr) &&
                         unlikely(ipv6_chk_addr_and_flags(net, raddr, ldev,
                                                          true, 0, IFA_F_TENTATIVE)))
-                       pr_warn("%s xmit: Routing loop! Remote address found on this node!\n",
-                               p->name);
+                       pr_warn_ratelimited("%s xmit: Routing loop! Remote address found on this node!\n",
+                                           p->name);
                else
                        ret = 1;
                rcu_read_unlock();
index 97d3d1b..0ba62f4 100644 (file)
@@ -47,10 +47,6 @@ config NFT_FIB_IPV6
 endif # NF_TABLES_IPV6
 endif # NF_TABLES
 
-config NF_FLOW_TABLE_IPV6
-       tristate
-       select NF_FLOW_TABLE_INET
-
 config NF_DUP_IPV6
        tristate "Netfilter IPv6 packet duplication to alternate destination"
        depends on !NF_CONNTRACK || NF_CONNTRACK
index b853836..b8d6dc9 100644 (file)
@@ -28,9 +28,6 @@ obj-$(CONFIG_NFT_REJECT_IPV6) += nft_reject_ipv6.o
 obj-$(CONFIG_NFT_DUP_IPV6) += nft_dup_ipv6.o
 obj-$(CONFIG_NFT_FIB_IPV6) += nft_fib_ipv6.o
 
-# flow table support
-obj-$(CONFIG_NF_FLOW_TABLE_IPV6) += nf_flow_table_ipv6.o
-
 # matches
 obj-$(CONFIG_IP6_NF_MATCH_AH) += ip6t_ah.o
 obj-$(CONFIG_IP6_NF_MATCH_EUI64) += ip6t_eui64.o
diff --git a/net/ipv6/netfilter/nf_flow_table_ipv6.c b/net/ipv6/netfilter/nf_flow_table_ipv6.c
deleted file mode 100644 (file)
index e69de29..0000000
index e6de942..f4884cd 100644 (file)
@@ -2802,7 +2802,7 @@ static void ip6_link_failure(struct sk_buff *skb)
                        if (from) {
                                fn = rcu_dereference(from->fib6_node);
                                if (fn && (rt->rt6i_flags & RTF_DEFAULT))
-                                       fn->fn_sernum = -1;
+                                       WRITE_ONCE(fn->fn_sernum, -1);
                        }
                }
                rcu_read_unlock();
index 75af1f7..782b1d4 100644 (file)
@@ -478,6 +478,20 @@ __lookup_addr_by_id(struct pm_nl_pernet *pernet, unsigned int id)
        return NULL;
 }
 
+static struct mptcp_pm_addr_entry *
+__lookup_addr(struct pm_nl_pernet *pernet, const struct mptcp_addr_info *info,
+             bool lookup_by_id)
+{
+       struct mptcp_pm_addr_entry *entry;
+
+       list_for_each_entry(entry, &pernet->local_addr_list, list) {
+               if ((!lookup_by_id && addresses_equal(&entry->addr, info, true)) ||
+                   (lookup_by_id && entry->addr.id == info->id))
+                       return entry;
+       }
+       return NULL;
+}
+
 static int
 lookup_id_by_addr(struct pm_nl_pernet *pernet, const struct mptcp_addr_info *addr)
 {
@@ -777,7 +791,7 @@ static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp_sock *msk,
                        removed = true;
                        __MPTCP_INC_STATS(sock_net(sk), rm_type);
                }
-               __set_bit(rm_list->ids[1], msk->pm.id_avail_bitmap);
+               __set_bit(rm_list->ids[i], msk->pm.id_avail_bitmap);
                if (!removed)
                        continue;
 
@@ -1763,18 +1777,21 @@ static int mptcp_nl_cmd_set_flags(struct sk_buff *skb, struct genl_info *info)
                        return -EOPNOTSUPP;
        }
 
-       list_for_each_entry(entry, &pernet->local_addr_list, list) {
-               if ((!lookup_by_id && addresses_equal(&entry->addr, &addr.addr, true)) ||
-                   (lookup_by_id && entry->addr.id == addr.addr.id)) {
-                       mptcp_nl_addr_backup(net, &entry->addr, bkup);
-
-                       if (bkup)
-                               entry->flags |= MPTCP_PM_ADDR_FLAG_BACKUP;
-                       else
-                               entry->flags &= ~MPTCP_PM_ADDR_FLAG_BACKUP;
-               }
+       spin_lock_bh(&pernet->lock);
+       entry = __lookup_addr(pernet, &addr.addr, lookup_by_id);
+       if (!entry) {
+               spin_unlock_bh(&pernet->lock);
+               return -EINVAL;
        }
 
+       if (bkup)
+               entry->flags |= MPTCP_PM_ADDR_FLAG_BACKUP;
+       else
+               entry->flags &= ~MPTCP_PM_ADDR_FLAG_BACKUP;
+       addr = *entry;
+       spin_unlock_bh(&pernet->lock);
+
+       mptcp_nl_addr_backup(net, &addr.addr, bkup);
        return 0;
 }
 
index 0e6b42c..85317ce 100644 (file)
@@ -408,7 +408,7 @@ DECLARE_PER_CPU(struct mptcp_delegated_action, mptcp_delegated_actions);
 struct mptcp_subflow_context {
        struct  list_head node;/* conn_list of subflows */
 
-       char    reset_start[0];
+       struct_group(reset,
 
        unsigned long avg_pacing_rate; /* protected by msk socket lock */
        u64     local_key;
@@ -458,7 +458,7 @@ struct mptcp_subflow_context {
 
        long    delegated_status;
 
-       char    reset_end[0];
+       );
 
        struct  list_head delegated_node;   /* link into delegated_action, protected by local BH */
 
@@ -494,7 +494,7 @@ mptcp_subflow_tcp_sock(const struct mptcp_subflow_context *subflow)
 static inline void
 mptcp_subflow_ctx_reset(struct mptcp_subflow_context *subflow)
 {
-       memset(subflow->reset_start, 0, subflow->reset_end - subflow->reset_start);
+       memset(&subflow->reset, 0, sizeof(subflow->reset));
        subflow->request_mptcp = 1;
 }
 
index 894a325..d6aa5b4 100644 (file)
@@ -1924,15 +1924,17 @@ repeat:
                pr_debug("nf_conntrack_in: Can't track with proto module\n");
                nf_ct_put(ct);
                skb->_nfct = 0;
-               NF_CT_STAT_INC_ATOMIC(state->net, invalid);
-               if (ret == -NF_DROP)
-                       NF_CT_STAT_INC_ATOMIC(state->net, drop);
                /* Special case: TCP tracker reports an attempt to reopen a
                 * closed/aborted connection. We have to go back and create a
                 * fresh conntrack.
                 */
                if (ret == -NF_REPEAT)
                        goto repeat;
+
+               NF_CT_STAT_INC_ATOMIC(state->net, invalid);
+               if (ret == -NF_DROP)
+                       NF_CT_STAT_INC_ATOMIC(state->net, drop);
+
                ret = -ret;
                goto out;
        }
index 7f19ee2..55415f0 100644 (file)
 #include <net/netfilter/nf_conntrack_helper.h>
 #include <net/netfilter/nf_conntrack_expect.h>
 
+#define HELPER_NAME    "netbios-ns"
 #define NMBD_PORT      137
 
 MODULE_AUTHOR("Patrick McHardy <kaber@trash.net>");
 MODULE_DESCRIPTION("NetBIOS name service broadcast connection tracking helper");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("ip_conntrack_netbios_ns");
-MODULE_ALIAS_NFCT_HELPER("netbios_ns");
+MODULE_ALIAS_NFCT_HELPER(HELPER_NAME);
 
 static unsigned int timeout __read_mostly = 3;
 module_param(timeout, uint, 0400);
@@ -44,7 +45,7 @@ static int netbios_ns_help(struct sk_buff *skb, unsigned int protoff,
 }
 
 static struct nf_conntrack_helper helper __read_mostly = {
-       .name                   = "netbios-ns",
+       .name                   = HELPER_NAME,
        .tuple.src.l3num        = NFPROTO_IPV4,
        .tuple.src.u.udp.port   = cpu_to_be16(NMBD_PORT),
        .tuple.dst.protonum     = IPPROTO_UDP,
index 77938b1..5fa1699 100644 (file)
@@ -2011,7 +2011,6 @@ static void nft_last_rule(struct nft_rule_blob *blob, const void *ptr)
 
        prule = (struct nft_rule_dp *)ptr;
        prule->is_last = 1;
-       ptr += offsetof(struct nft_rule_dp, data);
        /* blob size does not include the trailer rule */
 }
 
@@ -8264,14 +8263,12 @@ static int nf_tables_commit_chain_prepare(struct net *net, struct nft_chain *cha
        void *data, *data_boundary;
        struct nft_rule_dp *prule;
        struct nft_rule *rule;
-       int i;
 
        /* already handled or inactive chain? */
        if (chain->blob_next || !nft_is_active_next(net, chain))
                return 0;
 
        rule = list_entry(&chain->rules, struct nft_rule, list);
-       i = 0;
 
        data_size = 0;
        list_for_each_entry_continue(rule, &chain->rules, list) {
@@ -8301,7 +8298,7 @@ static int nf_tables_commit_chain_prepare(struct net *net, struct nft_chain *cha
                        return -ENOMEM;
 
                size = 0;
-               track.last = last;
+               track.last = nft_expr_last(rule);
                nft_rule_for_each_expr(expr, last, rule) {
                        track.cur = expr;
 
index 9d5947a..e646e9e 100644 (file)
@@ -167,12 +167,24 @@ nla_put_failure:
        return -1;
 }
 
+static bool nft_byteorder_reduce(struct nft_regs_track *track,
+                                const struct nft_expr *expr)
+{
+       struct nft_byteorder *priv = nft_expr_priv(expr);
+
+       track->regs[priv->dreg].selector = NULL;
+       track->regs[priv->dreg].bitwise = NULL;
+
+       return false;
+}
+
 static const struct nft_expr_ops nft_byteorder_ops = {
        .type           = &nft_byteorder_type,
        .size           = NFT_EXPR_SIZE(sizeof(struct nft_byteorder)),
        .eval           = nft_byteorder_eval,
        .init           = nft_byteorder_init,
        .dump           = nft_byteorder_dump,
+       .reduce         = nft_byteorder_reduce,
 };
 
 struct nft_expr_type nft_byteorder_type __read_mostly = {
index 7d00a14..3362417 100644 (file)
@@ -62,6 +62,7 @@ static int nft_connlimit_do_init(const struct nft_ctx *ctx,
 {
        bool invert = false;
        u32 flags, limit;
+       int err;
 
        if (!tb[NFTA_CONNLIMIT_COUNT])
                return -EINVAL;
@@ -84,7 +85,15 @@ static int nft_connlimit_do_init(const struct nft_ctx *ctx,
        priv->limit     = limit;
        priv->invert    = invert;
 
-       return nf_ct_netns_get(ctx->net, ctx->family);
+       err = nf_ct_netns_get(ctx->net, ctx->family);
+       if (err < 0)
+               goto err_netns;
+
+       return 0;
+err_netns:
+       kfree(priv->list);
+
+       return err;
 }
 
 static void nft_connlimit_do_destroy(const struct nft_ctx *ctx,
index 518d96c..5adf8bb 100644 (file)
@@ -260,9 +260,12 @@ static void nft_ct_set_zone_eval(const struct nft_expr *expr,
        ct = this_cpu_read(nft_ct_pcpu_template);
 
        if (likely(refcount_read(&ct->ct_general.use) == 1)) {
+               refcount_inc(&ct->ct_general.use);
                nf_ct_zone_add(ct, &zone);
        } else {
-               /* previous skb got queued to userspace */
+               /* previous skb got queued to userspace, allocate temporary
+                * one until percpu template can be reused.
+                */
                ct = nf_ct_tmpl_alloc(nft_net(pkt), &zone, GFP_ATOMIC);
                if (!ct) {
                        regs->verdict.code = NF_DROP;
index 5bd409a..ab87f22 100644 (file)
@@ -1774,6 +1774,7 @@ static int fanout_add(struct sock *sk, struct fanout_args *args)
                match->prot_hook.dev = po->prot_hook.dev;
                match->prot_hook.func = packet_rcv_fanout;
                match->prot_hook.af_packet_priv = match;
+               match->prot_hook.af_packet_net = read_pnet(&match->net);
                match->prot_hook.id_match = match_fanout_group;
                match->max_num_members = args->max_num_members;
                list_add(&match->list, &fanout_list);
@@ -1788,7 +1789,10 @@ static int fanout_add(struct sock *sk, struct fanout_args *args)
                err = -ENOSPC;
                if (refcount_read(&match->sk_ref) < match->max_num_members) {
                        __dev_remove_pack(&po->prot_hook);
-                       po->fanout = match;
+
+                       /* Paired with packet_setsockopt(PACKET_FANOUT_DATA) */
+                       WRITE_ONCE(po->fanout, match);
+
                        po->rollover = rollover;
                        rollover = NULL;
                        refcount_set(&match->sk_ref, refcount_read(&match->sk_ref) + 1);
@@ -3353,6 +3357,7 @@ static int packet_create(struct net *net, struct socket *sock, int protocol,
                po->prot_hook.func = packet_rcv_spkt;
 
        po->prot_hook.af_packet_priv = sk;
+       po->prot_hook.af_packet_net = sock_net(sk);
 
        if (proto) {
                po->prot_hook.type = proto;
@@ -3932,7 +3937,8 @@ packet_setsockopt(struct socket *sock, int level, int optname, sockptr_t optval,
        }
        case PACKET_FANOUT_DATA:
        {
-               if (!po->fanout)
+               /* Paired with the WRITE_ONCE() in fanout_add() */
+               if (!READ_ONCE(po->fanout))
                        return -EINVAL;
 
                return fanout_set_data(po, optval, optlen);
index 6be2672..df864e6 100644 (file)
@@ -157,7 +157,7 @@ static void rxrpc_congestion_timeout(struct rxrpc_call *call)
 static void rxrpc_resend(struct rxrpc_call *call, unsigned long now_j)
 {
        struct sk_buff *skb;
-       unsigned long resend_at, rto_j;
+       unsigned long resend_at;
        rxrpc_seq_t cursor, seq, top;
        ktime_t now, max_age, oldest, ack_ts;
        int ix;
@@ -165,10 +165,8 @@ static void rxrpc_resend(struct rxrpc_call *call, unsigned long now_j)
 
        _enter("{%d,%d}", call->tx_hard_ack, call->tx_top);
 
-       rto_j = call->peer->rto_j;
-
        now = ktime_get_real();
-       max_age = ktime_sub(now, jiffies_to_usecs(rto_j));
+       max_age = ktime_sub(now, jiffies_to_usecs(call->peer->rto_j));
 
        spin_lock_bh(&call->lock);
 
@@ -213,7 +211,7 @@ static void rxrpc_resend(struct rxrpc_call *call, unsigned long now_j)
        }
 
        resend_at = nsecs_to_jiffies(ktime_to_ns(ktime_sub(now, oldest)));
-       resend_at += jiffies + rto_j;
+       resend_at += jiffies + rxrpc_get_rto_backoff(call->peer, retrans);
        WRITE_ONCE(call->resend_at, resend_at);
 
        if (unacked)
index 10f2bf2..a45c83f 100644 (file)
@@ -468,7 +468,7 @@ done:
                        if (call->peer->rtt_count > 1) {
                                unsigned long nowj = jiffies, ack_lost_at;
 
-                               ack_lost_at = rxrpc_get_rto_backoff(call->peer, retrans);
+                               ack_lost_at = rxrpc_get_rto_backoff(call->peer, false);
                                ack_lost_at += nowj;
                                WRITE_ONCE(call->ack_lost_at, ack_lost_at);
                                rxrpc_reduce_call_timer(call, ack_lost_at, nowj,
index d4e27c6..5f0f346 100644 (file)
@@ -1945,9 +1945,9 @@ static int tc_new_tfilter(struct sk_buff *skb, struct nlmsghdr *n,
        bool prio_allocate;
        u32 parent;
        u32 chain_index;
-       struct Qdisc *q = NULL;
+       struct Qdisc *q;
        struct tcf_chain_info chain_info;
-       struct tcf_chain *chain = NULL;
+       struct tcf_chain *chain;
        struct tcf_block *block;
        struct tcf_proto *tp;
        unsigned long cl;
@@ -1976,6 +1976,8 @@ replay:
        tp = NULL;
        cl = 0;
        block = NULL;
+       q = NULL;
+       chain = NULL;
        flags = 0;
 
        if (prio == 0) {
@@ -2798,8 +2800,8 @@ static int tc_ctl_chain(struct sk_buff *skb, struct nlmsghdr *n,
        struct tcmsg *t;
        u32 parent;
        u32 chain_index;
-       struct Qdisc *q = NULL;
-       struct tcf_chain *chain = NULL;
+       struct Qdisc *q;
+       struct tcf_chain *chain;
        struct tcf_block *block;
        unsigned long cl;
        int err;
@@ -2809,6 +2811,7 @@ static int tc_ctl_chain(struct sk_buff *skb, struct nlmsghdr *n,
                return -EPERM;
 
 replay:
+       q = NULL;
        err = nlmsg_parse_deprecated(n, sizeof(*t), tca, TCA_MAX,
                                     rtm_tca_policy, extack);
        if (err < 0)
index 2cb496c..179825a 100644 (file)
@@ -1204,7 +1204,7 @@ static struct Qdisc *qdisc_create(struct net_device *dev,
 
        err = -ENOENT;
        if (!ops) {
-               NL_SET_ERR_MSG(extack, "Specified qdisc not found");
+               NL_SET_ERR_MSG(extack, "Specified qdisc kind is unknown");
                goto err_out;
        }
 
index 9267922..23a9d62 100644 (file)
@@ -1810,6 +1810,26 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
        if (!hopt->rate.rate || !hopt->ceil.rate)
                goto failure;
 
+       if (q->offload) {
+               /* Options not supported by the offload. */
+               if (hopt->rate.overhead || hopt->ceil.overhead) {
+                       NL_SET_ERR_MSG(extack, "HTB offload doesn't support the overhead parameter");
+                       goto failure;
+               }
+               if (hopt->rate.mpu || hopt->ceil.mpu) {
+                       NL_SET_ERR_MSG(extack, "HTB offload doesn't support the mpu parameter");
+                       goto failure;
+               }
+               if (hopt->quantum) {
+                       NL_SET_ERR_MSG(extack, "HTB offload doesn't support the quantum parameter");
+                       goto failure;
+               }
+               if (hopt->prio) {
+                       NL_SET_ERR_MSG(extack, "HTB offload doesn't support the prio parameter");
+                       goto failure;
+               }
+       }
+
        /* Keeping backward compatible with rate_table based iproute2 tc */
        if (hopt->rate.linklayer == TC_LINKLAYER_UNAWARE)
                qdisc_put_rtab(qdisc_get_rtab(&hopt->rate, tb[TCA_HTB_RTAB],
index 961854e..8c89d0b 100644 (file)
@@ -566,11 +566,114 @@ static void smc_stat_fallback(struct smc_sock *smc)
        mutex_unlock(&net->smc.mutex_fback_rsn);
 }
 
-static void smc_switch_to_fallback(struct smc_sock *smc, int reason_code)
+/* must be called under rcu read lock */
+static void smc_fback_wakeup_waitqueue(struct smc_sock *smc, void *key)
 {
-       wait_queue_head_t *smc_wait = sk_sleep(&smc->sk);
-       wait_queue_head_t *clc_wait = sk_sleep(smc->clcsock->sk);
-       unsigned long flags;
+       struct socket_wq *wq;
+       __poll_t flags;
+
+       wq = rcu_dereference(smc->sk.sk_wq);
+       if (!skwq_has_sleeper(wq))
+               return;
+
+       /* wake up smc sk->sk_wq */
+       if (!key) {
+               /* sk_state_change */
+               wake_up_interruptible_all(&wq->wait);
+       } else {
+               flags = key_to_poll(key);
+               if (flags & (EPOLLIN | EPOLLOUT))
+                       /* sk_data_ready or sk_write_space */
+                       wake_up_interruptible_sync_poll(&wq->wait, flags);
+               else if (flags & EPOLLERR)
+                       /* sk_error_report */
+                       wake_up_interruptible_poll(&wq->wait, flags);
+       }
+}
+
+static int smc_fback_mark_woken(wait_queue_entry_t *wait,
+                               unsigned int mode, int sync, void *key)
+{
+       struct smc_mark_woken *mark =
+               container_of(wait, struct smc_mark_woken, wait_entry);
+
+       mark->woken = true;
+       mark->key = key;
+       return 0;
+}
+
+static void smc_fback_forward_wakeup(struct smc_sock *smc, struct sock *clcsk,
+                                    void (*clcsock_callback)(struct sock *sk))
+{
+       struct smc_mark_woken mark = { .woken = false };
+       struct socket_wq *wq;
+
+       init_waitqueue_func_entry(&mark.wait_entry,
+                                 smc_fback_mark_woken);
+       rcu_read_lock();
+       wq = rcu_dereference(clcsk->sk_wq);
+       if (!wq)
+               goto out;
+       add_wait_queue(sk_sleep(clcsk), &mark.wait_entry);
+       clcsock_callback(clcsk);
+       remove_wait_queue(sk_sleep(clcsk), &mark.wait_entry);
+
+       if (mark.woken)
+               smc_fback_wakeup_waitqueue(smc, mark.key);
+out:
+       rcu_read_unlock();
+}
+
+static void smc_fback_state_change(struct sock *clcsk)
+{
+       struct smc_sock *smc =
+               smc_clcsock_user_data(clcsk);
+
+       if (!smc)
+               return;
+       smc_fback_forward_wakeup(smc, clcsk, smc->clcsk_state_change);
+}
+
+static void smc_fback_data_ready(struct sock *clcsk)
+{
+       struct smc_sock *smc =
+               smc_clcsock_user_data(clcsk);
+
+       if (!smc)
+               return;
+       smc_fback_forward_wakeup(smc, clcsk, smc->clcsk_data_ready);
+}
+
+static void smc_fback_write_space(struct sock *clcsk)
+{
+       struct smc_sock *smc =
+               smc_clcsock_user_data(clcsk);
+
+       if (!smc)
+               return;
+       smc_fback_forward_wakeup(smc, clcsk, smc->clcsk_write_space);
+}
+
+static void smc_fback_error_report(struct sock *clcsk)
+{
+       struct smc_sock *smc =
+               smc_clcsock_user_data(clcsk);
+
+       if (!smc)
+               return;
+       smc_fback_forward_wakeup(smc, clcsk, smc->clcsk_error_report);
+}
+
+static int smc_switch_to_fallback(struct smc_sock *smc, int reason_code)
+{
+       struct sock *clcsk;
+
+       mutex_lock(&smc->clcsock_release_lock);
+       if (!smc->clcsock) {
+               mutex_unlock(&smc->clcsock_release_lock);
+               return -EBADF;
+       }
+       clcsk = smc->clcsock->sk;
 
        smc->use_fallback = true;
        smc->fallback_rsn = reason_code;
@@ -582,22 +685,40 @@ static void smc_switch_to_fallback(struct smc_sock *smc, int reason_code)
                smc->clcsock->wq.fasync_list =
                        smc->sk.sk_socket->wq.fasync_list;
 
-               /* There may be some entries remaining in
-                * smc socket->wq, which should be removed
-                * to clcsocket->wq during the fallback.
+               /* There might be some wait entries remaining
+                * in smc sk->sk_wq and they should be woken up
+                * as clcsock's wait queue is woken up.
                 */
-               spin_lock_irqsave(&smc_wait->lock, flags);
-               spin_lock_nested(&clc_wait->lock, SINGLE_DEPTH_NESTING);
-               list_splice_init(&smc_wait->head, &clc_wait->head);
-               spin_unlock(&clc_wait->lock);
-               spin_unlock_irqrestore(&smc_wait->lock, flags);
+               smc->clcsk_state_change = clcsk->sk_state_change;
+               smc->clcsk_data_ready = clcsk->sk_data_ready;
+               smc->clcsk_write_space = clcsk->sk_write_space;
+               smc->clcsk_error_report = clcsk->sk_error_report;
+
+               clcsk->sk_state_change = smc_fback_state_change;
+               clcsk->sk_data_ready = smc_fback_data_ready;
+               clcsk->sk_write_space = smc_fback_write_space;
+               clcsk->sk_error_report = smc_fback_error_report;
+
+               smc->clcsock->sk->sk_user_data =
+                       (void *)((uintptr_t)smc | SK_USER_DATA_NOCOPY);
        }
+       mutex_unlock(&smc->clcsock_release_lock);
+       return 0;
 }
 
 /* fall back during connect */
 static int smc_connect_fallback(struct smc_sock *smc, int reason_code)
 {
-       smc_switch_to_fallback(smc, reason_code);
+       struct net *net = sock_net(&smc->sk);
+       int rc = 0;
+
+       rc = smc_switch_to_fallback(smc, reason_code);
+       if (rc) { /* fallback fails */
+               this_cpu_inc(net->smc.smc_stats->clnt_hshake_err_cnt);
+               if (smc->sk.sk_state == SMC_INIT)
+                       sock_put(&smc->sk); /* passive closing */
+               return rc;
+       }
        smc_copy_sock_settings_to_clc(smc);
        smc->connect_nonblock = 0;
        if (smc->sk.sk_state == SMC_INIT)
@@ -1518,11 +1639,12 @@ static void smc_listen_decline(struct smc_sock *new_smc, int reason_code,
 {
        /* RDMA setup failed, switch back to TCP */
        smc_conn_abort(new_smc, local_first);
-       if (reason_code < 0) { /* error, no fallback possible */
+       if (reason_code < 0 ||
+           smc_switch_to_fallback(new_smc, reason_code)) {
+               /* error, no fallback possible */
                smc_listen_out_err(new_smc);
                return;
        }
-       smc_switch_to_fallback(new_smc, reason_code);
        if (reason_code && reason_code != SMC_CLC_DECL_PEERDECL) {
                if (smc_clc_send_decline(new_smc, reason_code, version) < 0) {
                        smc_listen_out_err(new_smc);
@@ -1964,8 +2086,11 @@ static void smc_listen_work(struct work_struct *work)
 
        /* check if peer is smc capable */
        if (!tcp_sk(newclcsock->sk)->syn_smc) {
-               smc_switch_to_fallback(new_smc, SMC_CLC_DECL_PEERNOSMC);
-               smc_listen_out_connected(new_smc);
+               rc = smc_switch_to_fallback(new_smc, SMC_CLC_DECL_PEERNOSMC);
+               if (rc)
+                       smc_listen_out_err(new_smc);
+               else
+                       smc_listen_out_connected(new_smc);
                return;
        }
 
@@ -2094,10 +2219,9 @@ out:
 
 static void smc_clcsock_data_ready(struct sock *listen_clcsock)
 {
-       struct smc_sock *lsmc;
+       struct smc_sock *lsmc =
+               smc_clcsock_user_data(listen_clcsock);
 
-       lsmc = (struct smc_sock *)
-              ((uintptr_t)listen_clcsock->sk_user_data & ~SK_USER_DATA_NOCOPY);
        if (!lsmc)
                return;
        lsmc->clcsk_data_ready(listen_clcsock);
@@ -2254,7 +2378,9 @@ static int smc_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
 
        if (msg->msg_flags & MSG_FASTOPEN) {
                if (sk->sk_state == SMC_INIT && !smc->connect_nonblock) {
-                       smc_switch_to_fallback(smc, SMC_CLC_DECL_OPTUNSUPP);
+                       rc = smc_switch_to_fallback(smc, SMC_CLC_DECL_OPTUNSUPP);
+                       if (rc)
+                               goto out;
                } else {
                        rc = -EINVAL;
                        goto out;
@@ -2447,6 +2573,11 @@ static int smc_setsockopt(struct socket *sock, int level, int optname,
        /* generic setsockopts reaching us here always apply to the
         * CLC socket
         */
+       mutex_lock(&smc->clcsock_release_lock);
+       if (!smc->clcsock) {
+               mutex_unlock(&smc->clcsock_release_lock);
+               return -EBADF;
+       }
        if (unlikely(!smc->clcsock->ops->setsockopt))
                rc = -EOPNOTSUPP;
        else
@@ -2456,6 +2587,7 @@ static int smc_setsockopt(struct socket *sock, int level, int optname,
                sk->sk_err = smc->clcsock->sk->sk_err;
                sk_error_report(sk);
        }
+       mutex_unlock(&smc->clcsock_release_lock);
 
        if (optlen < sizeof(int))
                return -EINVAL;
@@ -2472,7 +2604,7 @@ static int smc_setsockopt(struct socket *sock, int level, int optname,
        case TCP_FASTOPEN_NO_COOKIE:
                /* option not supported by SMC */
                if (sk->sk_state == SMC_INIT && !smc->connect_nonblock) {
-                       smc_switch_to_fallback(smc, SMC_CLC_DECL_OPTUNSUPP);
+                       rc = smc_switch_to_fallback(smc, SMC_CLC_DECL_OPTUNSUPP);
                } else {
                        rc = -EINVAL;
                }
@@ -2515,13 +2647,23 @@ static int smc_getsockopt(struct socket *sock, int level, int optname,
                          char __user *optval, int __user *optlen)
 {
        struct smc_sock *smc;
+       int rc;
 
        smc = smc_sk(sock->sk);
+       mutex_lock(&smc->clcsock_release_lock);
+       if (!smc->clcsock) {
+               mutex_unlock(&smc->clcsock_release_lock);
+               return -EBADF;
+       }
        /* socket options apply to the CLC socket */
-       if (unlikely(!smc->clcsock->ops->getsockopt))
+       if (unlikely(!smc->clcsock->ops->getsockopt)) {
+               mutex_unlock(&smc->clcsock_release_lock);
                return -EOPNOTSUPP;
-       return smc->clcsock->ops->getsockopt(smc->clcsock, level, optname,
-                                            optval, optlen);
+       }
+       rc = smc->clcsock->ops->getsockopt(smc->clcsock, level, optname,
+                                          optval, optlen);
+       mutex_unlock(&smc->clcsock_release_lock);
+       return rc;
 }
 
 static int smc_ioctl(struct socket *sock, unsigned int cmd,
index 3d0b8e3..37b2001 100644 (file)
@@ -139,6 +139,12 @@ enum smc_urg_state {
        SMC_URG_READ    = 3,                    /* data was already read */
 };
 
+struct smc_mark_woken {
+       bool woken;
+       void *key;
+       wait_queue_entry_t wait_entry;
+};
+
 struct smc_connection {
        struct rb_node          alert_node;
        struct smc_link_group   *lgr;           /* link group of connection */
@@ -228,8 +234,14 @@ struct smc_connection {
 struct smc_sock {                              /* smc sock container */
        struct sock             sk;
        struct socket           *clcsock;       /* internal tcp socket */
+       void                    (*clcsk_state_change)(struct sock *sk);
+                                               /* original stat_change fct. */
        void                    (*clcsk_data_ready)(struct sock *sk);
-                                               /* original data_ready fct. **/
+                                               /* original data_ready fct. */
+       void                    (*clcsk_write_space)(struct sock *sk);
+                                               /* original write_space fct. */
+       void                    (*clcsk_error_report)(struct sock *sk);
+                                               /* original error_report fct. */
        struct smc_connection   conn;           /* smc connection */
        struct smc_sock         *listen_smc;    /* listen parent */
        struct work_struct      connect_work;   /* handle non-blocking connect*/
@@ -264,6 +276,12 @@ static inline struct smc_sock *smc_sk(const struct sock *sk)
        return (struct smc_sock *)sk;
 }
 
+static inline struct smc_sock *smc_clcsock_user_data(struct sock *clcsk)
+{
+       return (struct smc_sock *)
+              ((uintptr_t)clcsk->sk_user_data & ~SK_USER_DATA_NOCOPY);
+}
+
 extern struct workqueue_struct *smc_hs_wq;     /* wq for handshake work */
 extern struct workqueue_struct *smc_close_wq;  /* wq for close work */
 
index b8898c7..1fca2f9 100644 (file)
@@ -146,13 +146,11 @@ static int __smc_diag_dump(struct sock *sk, struct sk_buff *skb,
            (req->diag_ext & (1 << (SMC_DIAG_LGRINFO - 1))) &&
            !list_empty(&smc->conn.lgr->list)) {
                struct smc_link *link = smc->conn.lnk;
-               struct net *net = read_pnet(&link->smcibdev->ibdev->coredev.rdma_net);
 
                struct smc_diag_lgrinfo linfo = {
                        .role = smc->conn.lgr->role,
                        .lnk[0].ibport = link->ibport,
                        .lnk[0].link_id = link->link_id,
-                       .lnk[0].net_cookie = net->net_cookie,
                };
 
                memcpy(linfo.lnk[0].ibname,
index fe97f31..4a4082b 100644 (file)
@@ -222,10 +222,8 @@ g_verify_token_header(struct xdr_netobj *mech, int *body_size,
        if (ret)
                return ret;
 
-       if (!ret) {
-               *buf_in = buf;
-               *body_size = toksize;
-       }
+       *buf_in = buf;
+       *body_size = toksize;
 
        return ret;
 }
index a312ea2..c83fe61 100644 (file)
@@ -2900,7 +2900,7 @@ int rpc_clnt_add_xprt(struct rpc_clnt *clnt,
        unsigned long connect_timeout;
        unsigned long reconnect_timeout;
        unsigned char resvport, reuseport;
-       int ret = 0;
+       int ret = 0, ident;
 
        rcu_read_lock();
        xps = xprt_switch_get(rcu_dereference(clnt->cl_xpi.xpi_xpswitch));
@@ -2914,8 +2914,11 @@ int rpc_clnt_add_xprt(struct rpc_clnt *clnt,
        reuseport = xprt->reuseport;
        connect_timeout = xprt->connect_timeout;
        reconnect_timeout = xprt->max_reconnect_timeout;
+       ident = xprt->xprt_class->ident;
        rcu_read_unlock();
 
+       if (!xprtargs->ident)
+               xprtargs->ident = ident;
        xprt = xprt_create_transport(xprtargs);
        if (IS_ERR(xprt)) {
                ret = PTR_ERR(xprt);
index ee5336d..35588f0 100644 (file)
@@ -600,9 +600,9 @@ static int __rpc_rmdir(struct inode *dir, struct dentry *dentry)
 
        dget(dentry);
        ret = simple_rmdir(dir, dentry);
+       d_drop(dentry);
        if (!ret)
                fsnotify_rmdir(dir, dentry);
-       d_delete(dentry);
        dput(dentry);
        return ret;
 }
@@ -613,9 +613,9 @@ static int __rpc_unlink(struct inode *dir, struct dentry *dentry)
 
        dget(dentry);
        ret = simple_unlink(dir, dentry);
+       d_drop(dentry);
        if (!ret)
                fsnotify_unlink(dir, dentry);
-       d_delete(dentry);
        dput(dentry);
        return ret;
 }
index 2766dd2..b64a028 100644 (file)
@@ -295,8 +295,10 @@ static ssize_t rpc_sysfs_xprt_state_change(struct kobject *kobj,
                online = 1;
        else if (!strncmp(buf, "remove", 6))
                remove = 1;
-       else
-               return -EINVAL;
+       else {
+               count = -EINVAL;
+               goto out_put;
+       }
 
        if (wait_on_bit_lock(&xprt->state, XPRT_LOCKED, TASK_KILLABLE)) {
                count = -EINTR;
@@ -307,25 +309,28 @@ static ssize_t rpc_sysfs_xprt_state_change(struct kobject *kobj,
                goto release_tasks;
        }
        if (offline) {
-               set_bit(XPRT_OFFLINE, &xprt->state);
-               spin_lock(&xps->xps_lock);
-               xps->xps_nactive--;
-               spin_unlock(&xps->xps_lock);
+               if (!test_and_set_bit(XPRT_OFFLINE, &xprt->state)) {
+                       spin_lock(&xps->xps_lock);
+                       xps->xps_nactive--;
+                       spin_unlock(&xps->xps_lock);
+               }
        } else if (online) {
-               clear_bit(XPRT_OFFLINE, &xprt->state);
-               spin_lock(&xps->xps_lock);
-               xps->xps_nactive++;
-               spin_unlock(&xps->xps_lock);
+               if (test_and_clear_bit(XPRT_OFFLINE, &xprt->state)) {
+                       spin_lock(&xps->xps_lock);
+                       xps->xps_nactive++;
+                       spin_unlock(&xps->xps_lock);
+               }
        } else if (remove) {
                if (test_bit(XPRT_OFFLINE, &xprt->state)) {
-                       set_bit(XPRT_REMOVE, &xprt->state);
-                       xprt_force_disconnect(xprt);
-                       if (test_bit(XPRT_CONNECTED, &xprt->state)) {
-                               if (!xprt->sending.qlen &&
-                                   !xprt->pending.qlen &&
-                                   !xprt->backlog.qlen &&
-                                   !atomic_long_read(&xprt->queuelen))
-                                       rpc_xprt_switch_remove_xprt(xps, xprt);
+                       if (!test_and_set_bit(XPRT_REMOVE, &xprt->state)) {
+                               xprt_force_disconnect(xprt);
+                               if (test_bit(XPRT_CONNECTED, &xprt->state)) {
+                                       if (!xprt->sending.qlen &&
+                                           !xprt->pending.qlen &&
+                                           !xprt->backlog.qlen &&
+                                           !atomic_long_read(&xprt->queuelen))
+                                               rpc_xprt_switch_remove_xprt(xps, xprt);
+                               }
                        }
                } else {
                        count = -EINVAL;
@@ -422,6 +427,7 @@ static struct attribute *rpc_sysfs_xprt_attrs[] = {
        &rpc_sysfs_xprt_change_state.attr,
        NULL,
 };
+ATTRIBUTE_GROUPS(rpc_sysfs_xprt);
 
 static struct kobj_attribute rpc_sysfs_xprt_switch_info =
        __ATTR(xprt_switch_info, 0444, rpc_sysfs_xprt_switch_info_show, NULL);
@@ -430,6 +436,7 @@ static struct attribute *rpc_sysfs_xprt_switch_attrs[] = {
        &rpc_sysfs_xprt_switch_info.attr,
        NULL,
 };
+ATTRIBUTE_GROUPS(rpc_sysfs_xprt_switch);
 
 static struct kobj_type rpc_sysfs_client_type = {
        .release = rpc_sysfs_client_release,
@@ -439,14 +446,14 @@ static struct kobj_type rpc_sysfs_client_type = {
 
 static struct kobj_type rpc_sysfs_xprt_switch_type = {
        .release = rpc_sysfs_xprt_switch_release,
-       .default_attrs = rpc_sysfs_xprt_switch_attrs,
+       .default_groups = rpc_sysfs_xprt_switch_groups,
        .sysfs_ops = &kobj_sysfs_ops,
        .namespace = rpc_sysfs_xprt_switch_namespace,
 };
 
 static struct kobj_type rpc_sysfs_xprt_type = {
        .release = rpc_sysfs_xprt_release,
-       .default_attrs = rpc_sysfs_xprt_attrs,
+       .default_groups = rpc_sysfs_xprt_groups,
        .sysfs_ops = &kobj_sysfs_ops,
        .namespace = rpc_sysfs_xprt_namespace,
 };
index 17f174d..faba713 100644 (file)
 #include "xprt_rdma.h"
 #include <trace/events/rpcrdma.h>
 
-#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
-# define RPCDBG_FACILITY       RPCDBG_TRANS
-#endif
-
 #undef RPCRDMA_BACKCHANNEL_DEBUG
 
 /**
index ff69930..515dd7a 100644 (file)
 #include "xprt_rdma.h"
 #include <trace/events/rpcrdma.h>
 
-#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
-# define RPCDBG_FACILITY       RPCDBG_TRANS
-#endif
-
 static void frwr_cid_init(struct rpcrdma_ep *ep,
                          struct rpcrdma_mr *mr)
 {
index 8035a98..281ddb8 100644 (file)
 #include "xprt_rdma.h"
 #include <trace/events/rpcrdma.h>
 
-#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
-# define RPCDBG_FACILITY       RPCDBG_TRANS
-#endif
-
 /* Returns size of largest RPC-over-RDMA header in a Call message
  *
  * The largest Call header contains a full-size Read list and a
index 16e5696..42e375d 100644 (file)
 #include "xprt_rdma.h"
 #include <trace/events/rpcrdma.h>
 
-#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
-# define RPCDBG_FACILITY       RPCDBG_TRANS
-#endif
-
 /*
  * tunables
  */
index 3d3673b..f172d12 100644 (file)
 #include "xprt_rdma.h"
 #include <trace/events/rpcrdma.h>
 
-/*
- * Globals/Macros
- */
-
-#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
-# define RPCDBG_FACILITY       RPCDBG_TRANS
-#endif
-
-/*
- * internal functions
- */
 static int rpcrdma_sendctxs_create(struct rpcrdma_xprt *r_xprt);
 static void rpcrdma_sendctxs_destroy(struct rpcrdma_xprt *r_xprt);
 static void rpcrdma_sendctx_put_locked(struct rpcrdma_xprt *r_xprt,
@@ -274,8 +263,6 @@ rpcrdma_cm_event_handler(struct rdma_cm_id *id, struct rdma_cm_event *event)
                ep->re_connect_status = -ENETUNREACH;
                goto wake_connect_worker;
        case RDMA_CM_EVENT_REJECTED:
-               dprintk("rpcrdma: connection to %pISpc rejected: %s\n",
-                       sap, rdma_reject_msg(id, event->status));
                ep->re_connect_status = -ECONNREFUSED;
                if (event->status == IB_CM_REJ_STALE_CONN)
                        ep->re_connect_status = -ENOTCONN;
@@ -291,8 +278,6 @@ disconnected:
                break;
        }
 
-       dprintk("RPC:       %s: %pISpc on %s/frwr: %s\n", __func__, sap,
-               ep->re_id->device->name, rdma_event_msg(event->event));
        return 0;
 }
 
@@ -419,14 +404,6 @@ static int rpcrdma_ep_create(struct rpcrdma_xprt *r_xprt)
        ep->re_attr.qp_type = IB_QPT_RC;
        ep->re_attr.port_num = ~0;
 
-       dprintk("RPC:       %s: requested max: dtos: send %d recv %d; "
-               "iovs: send %d recv %d\n",
-               __func__,
-               ep->re_attr.cap.max_send_wr,
-               ep->re_attr.cap.max_recv_wr,
-               ep->re_attr.cap.max_send_sge,
-               ep->re_attr.cap.max_recv_sge);
-
        ep->re_send_batch = ep->re_max_requests >> 3;
        ep->re_send_count = ep->re_send_batch;
        init_waitqueue_head(&ep->re_connect_wait);
index d8ee06a..69b6ee5 100644 (file)
@@ -1910,7 +1910,7 @@ static void xs_local_connect(struct rpc_xprt *xprt, struct rpc_task *task)
        struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
        int ret;
 
-        if (RPC_IS_ASYNC(task)) {
+       if (RPC_IS_ASYNC(task)) {
                /*
                 * We want the AF_LOCAL connect to be resolved in the
                 * filesystem namespace of the process making the rpc
index ecd3aca..ce5aa90 100644 (file)
@@ -25,7 +25,7 @@ HOSTCFLAGS_sorttable.o += -I$(srctree)/tools/arch/x86/include
 HOSTCFLAGS_sorttable.o += -DUNWINDER_ORC_ENABLED
 endif
 
-ifdef CONFIG_DYNAMIC_FTRACE
+ifdef CONFIG_BUILDTIME_MCOUNT_SORT
 HOSTCFLAGS_sorttable.o += -DMCOUNT_SORT_ENABLED
 endif
 
index 3d4eb47..22261d7 100644 (file)
@@ -1048,8 +1048,19 @@ int security_dentry_init_security(struct dentry *dentry, int mode,
                                  const char **xattr_name, void **ctx,
                                  u32 *ctxlen)
 {
-       return call_int_hook(dentry_init_security, -EOPNOTSUPP, dentry, mode,
-                               name, xattr_name, ctx, ctxlen);
+       struct security_hook_list *hp;
+       int rc;
+
+       /*
+        * Only one module will provide a security context.
+        */
+       hlist_for_each_entry(hp, &security_hook_heads.dentry_init_security, list) {
+               rc = hp->hook.dentry_init_security(dentry, mode, name,
+                                                  xattr_name, ctx, ctxlen);
+               if (rc != LSM_RET_DEFAULT(dentry_init_security))
+                       return rc;
+       }
+       return LSM_RET_DEFAULT(dentry_init_security);
 }
 EXPORT_SYMBOL(security_dentry_init_security);
 
index 2ec6e5c..feb206f 100644 (file)
@@ -152,6 +152,8 @@ static void cond_list_destroy(struct policydb *p)
        for (i = 0; i < p->cond_list_len; i++)
                cond_node_destroy(&p->cond_list[i]);
        kfree(p->cond_list);
+       p->cond_list = NULL;
+       p->cond_list_len = 0;
 }
 
 void cond_policydb_destroy(struct policydb *p)
@@ -441,7 +443,6 @@ int cond_read_list(struct policydb *p, void *fp)
        return 0;
 err:
        cond_list_destroy(p);
-       p->cond_list = NULL;
        return rc;
 }
 
index 621883e..a056b3e 100644 (file)
@@ -172,6 +172,19 @@ unsigned long _snd_pcm_stream_lock_irqsave(struct snd_pcm_substream *substream)
 }
 EXPORT_SYMBOL_GPL(_snd_pcm_stream_lock_irqsave);
 
+unsigned long _snd_pcm_stream_lock_irqsave_nested(struct snd_pcm_substream *substream)
+{
+       unsigned long flags = 0;
+       if (substream->pcm->nonatomic)
+               mutex_lock_nested(&substream->self_group.mutex,
+                                 SINGLE_DEPTH_NESTING);
+       else
+               spin_lock_irqsave_nested(&substream->self_group.lock, flags,
+                                        SINGLE_DEPTH_NESTING);
+       return flags;
+}
+EXPORT_SYMBOL_GPL(_snd_pcm_stream_lock_irqsave_nested);
+
 /**
  * snd_pcm_stream_unlock_irqrestore - Unlock the PCM stream
  * @substream: PCM substream
index b7758db..5cb92f7 100644 (file)
@@ -50,11 +50,11 @@ static bool is_link_enabled(struct fwnode_handle *fw_node, int i)
 static int
 sdw_intel_scan_controller(struct sdw_intel_acpi_info *info)
 {
-       struct acpi_device *adev;
+       struct acpi_device *adev = acpi_fetch_acpi_dev(info->handle);
        int ret, i;
        u8 count;
 
-       if (acpi_bus_get_device(info->handle, &adev))
+       if (!adev)
                return -EINVAL;
 
        /* Found controller, find links supported */
@@ -119,7 +119,6 @@ static acpi_status sdw_intel_acpi_cb(acpi_handle handle, u32 level,
                                     void *cdata, void **return_value)
 {
        struct sdw_intel_acpi_info *info = cdata;
-       struct acpi_device *adev;
        acpi_status status;
        u64 adr;
 
@@ -127,7 +126,7 @@ static acpi_status sdw_intel_acpi_cb(acpi_handle handle, u32 level,
        if (ACPI_FAILURE(status))
                return AE_OK; /* keep going */
 
-       if (acpi_bus_get_device(handle, &adev)) {
+       if (!acpi_fetch_acpi_dev(handle)) {
                pr_err("%s: Couldn't find ACPI handle\n", __func__);
                return AE_NOT_FOUND;
        }
index 82c492b..cd1db94 100644 (file)
@@ -981,7 +981,7 @@ void snd_hda_pick_fixup(struct hda_codec *codec,
        int id = HDA_FIXUP_ID_NOT_SET;
        const char *name = NULL;
        const char *type = NULL;
-       int vendor, device;
+       unsigned int vendor, device;
 
        if (codec->fixup_id != HDA_FIXUP_ID_NOT_SET)
                return;
index 7016b48..f552785 100644 (file)
@@ -3000,6 +3000,10 @@ void snd_hda_codec_shutdown(struct hda_codec *codec)
 {
        struct hda_pcm *cpcm;
 
+       /* Skip the shutdown if codec is not registered */
+       if (!codec->registered)
+               return;
+
        list_for_each_entry(cpcm, &codec->pcm_list_head, list)
                snd_pcm_suspend_all(cpcm->pcm);
 
index 3bf5e34..fc114e5 100644 (file)
@@ -91,6 +91,12 @@ static void snd_hda_gen_spec_free(struct hda_gen_spec *spec)
        free_kctls(spec);
        snd_array_free(&spec->paths);
        snd_array_free(&spec->loopback_list);
+#ifdef CONFIG_SND_HDA_GENERIC_LEDS
+       if (spec->led_cdevs[LED_AUDIO_MUTE])
+               led_classdev_unregister(spec->led_cdevs[LED_AUDIO_MUTE]);
+       if (spec->led_cdevs[LED_AUDIO_MICMUTE])
+               led_classdev_unregister(spec->led_cdevs[LED_AUDIO_MICMUTE]);
+#endif
 }
 
 /*
@@ -3922,7 +3928,10 @@ static int create_mute_led_cdev(struct hda_codec *codec,
                                                enum led_brightness),
                                bool micmute)
 {
+       struct hda_gen_spec *spec = codec->spec;
        struct led_classdev *cdev;
+       int idx = micmute ? LED_AUDIO_MICMUTE : LED_AUDIO_MUTE;
+       int err;
 
        cdev = devm_kzalloc(&codec->core.dev, sizeof(*cdev), GFP_KERNEL);
        if (!cdev)
@@ -3932,10 +3941,14 @@ static int create_mute_led_cdev(struct hda_codec *codec,
        cdev->max_brightness = 1;
        cdev->default_trigger = micmute ? "audio-micmute" : "audio-mute";
        cdev->brightness_set_blocking = callback;
-       cdev->brightness = ledtrig_audio_get(micmute ? LED_AUDIO_MICMUTE : LED_AUDIO_MUTE);
+       cdev->brightness = ledtrig_audio_get(idx);
        cdev->flags = LED_CORE_SUSPENDRESUME;
 
-       return devm_led_classdev_register(&codec->core.dev, cdev);
+       err = led_classdev_register(&codec->core.dev, cdev);
+       if (err < 0)
+               return err;
+       spec->led_cdevs[idx] = cdev;
+       return 0;
 }
 
 /**
index 8e1bc8e..34eba40 100644 (file)
@@ -294,6 +294,9 @@ struct hda_gen_spec {
                                   struct hda_jack_callback *cb);
        void (*mic_autoswitch_hook)(struct hda_codec *codec,
                                    struct hda_jack_callback *cb);
+
+       /* leds */
+       struct led_classdev *led_cdevs[NUM_AUDIO_LEDS];
 };
 
 /* values for add_stereo_mix_input flag */
index 668274e..8315bf7 100644 (file)
@@ -98,6 +98,7 @@ struct alc_spec {
        unsigned int gpio_mic_led_mask;
        struct alc_coef_led mute_led_coef;
        struct alc_coef_led mic_led_coef;
+       struct mutex coef_mutex;
 
        hda_nid_t headset_mic_pin;
        hda_nid_t headphone_mic_pin;
@@ -137,8 +138,8 @@ struct alc_spec {
  * COEF access helper functions
  */
 
-static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
-                              unsigned int coef_idx)
+static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
+                                unsigned int coef_idx)
 {
        unsigned int val;
 
@@ -147,28 +148,61 @@ static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
        return val;
 }
 
+static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
+                              unsigned int coef_idx)
+{
+       struct alc_spec *spec = codec->spec;
+       unsigned int val;
+
+       mutex_lock(&spec->coef_mutex);
+       val = __alc_read_coefex_idx(codec, nid, coef_idx);
+       mutex_unlock(&spec->coef_mutex);
+       return val;
+}
+
 #define alc_read_coef_idx(codec, coef_idx) \
        alc_read_coefex_idx(codec, 0x20, coef_idx)
 
-static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
-                                unsigned int coef_idx, unsigned int coef_val)
+static void __alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
+                                  unsigned int coef_idx, unsigned int coef_val)
 {
        snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
        snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val);
 }
 
+static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
+                                unsigned int coef_idx, unsigned int coef_val)
+{
+       struct alc_spec *spec = codec->spec;
+
+       mutex_lock(&spec->coef_mutex);
+       __alc_write_coefex_idx(codec, nid, coef_idx, coef_val);
+       mutex_unlock(&spec->coef_mutex);
+}
+
 #define alc_write_coef_idx(codec, coef_idx, coef_val) \
        alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
 
+static void __alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
+                                   unsigned int coef_idx, unsigned int mask,
+                                   unsigned int bits_set)
+{
+       unsigned int val = __alc_read_coefex_idx(codec, nid, coef_idx);
+
+       if (val != -1)
+               __alc_write_coefex_idx(codec, nid, coef_idx,
+                                      (val & ~mask) | bits_set);
+}
+
 static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
                                  unsigned int coef_idx, unsigned int mask,
                                  unsigned int bits_set)
 {
-       unsigned int val = alc_read_coefex_idx(codec, nid, coef_idx);
+       struct alc_spec *spec = codec->spec;
 
-       if (val != -1)
-               alc_write_coefex_idx(codec, nid, coef_idx,
-                                    (val & ~mask) | bits_set);
+       mutex_lock(&spec->coef_mutex);
+       __alc_update_coefex_idx(codec, nid, coef_idx, mask, bits_set);
+       mutex_unlock(&spec->coef_mutex);
 }
 
 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set)   \
@@ -201,13 +235,17 @@ struct coef_fw {
 static void alc_process_coef_fw(struct hda_codec *codec,
                                const struct coef_fw *fw)
 {
+       struct alc_spec *spec = codec->spec;
+
+       mutex_lock(&spec->coef_mutex);
        for (; fw->nid; fw++) {
                if (fw->mask == (unsigned short)-1)
-                       alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
+                       __alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
                else
-                       alc_update_coefex_idx(codec, fw->nid, fw->idx,
-                                             fw->mask, fw->val);
+                       __alc_update_coefex_idx(codec, fw->nid, fw->idx,
+                                               fw->mask, fw->val);
        }
+       mutex_unlock(&spec->coef_mutex);
 }
 
 /*
@@ -1153,6 +1191,7 @@ static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
        codec->spdif_status_reset = 1;
        codec->forced_resume = 1;
        codec->patch_ops = alc_patch_ops;
+       mutex_init(&spec->coef_mutex);
 
        err = alc_codec_rename_from_preset(codec);
        if (err < 0) {
@@ -2125,6 +2164,7 @@ static void alc1220_fixup_gb_x570(struct hda_codec *codec,
 {
        static const hda_nid_t conn1[] = { 0x0c };
        static const struct coef_fw gb_x570_coefs[] = {
+               WRITE_COEF(0x07, 0x03c0),
                WRITE_COEF(0x1a, 0x01c1),
                WRITE_COEF(0x1b, 0x0202),
                WRITE_COEF(0x43, 0x3005),
@@ -2551,7 +2591,8 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
        SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
        SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
        SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570),
-       SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_CLEVO_P950),
+       SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_GB_X570),
+       SND_PCI_QUIRK(0x1458, 0xa0d5, "Gigabyte X570S Aorus Master", ALC1220_FIXUP_GB_X570),
        SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
        SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
        SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950),
@@ -2626,6 +2667,7 @@ static const struct hda_model_fixup alc882_fixup_models[] = {
        {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
        {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
        {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
+       {.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"},
        {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
        {}
 };
@@ -8969,6 +9011,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
        SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
        SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
        SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
+       SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
        SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
        SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
        SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
index c9caade..cd05ee2 100644 (file)
@@ -303,11 +303,11 @@ static const struct snd_soc_dapm_route rt1019_map_lr[] = {
 
 static struct snd_soc_codec_conf rt1019_conf[] = {
        {
-                .dlc = COMP_CODEC_CONF("i2c-10EC1019:00"),
+                .dlc = COMP_CODEC_CONF("i2c-10EC1019:01"),
                 .name_prefix = "Left",
        },
        {
-                .dlc = COMP_CODEC_CONF("i2c-10EC1019:01"),
+                .dlc = COMP_CODEC_CONF("i2c-10EC1019:00"),
                 .name_prefix = "Right",
        },
 };
index 598e090..ffdf8b6 100644 (file)
@@ -1667,6 +1667,8 @@ static int cpcap_codec_probe(struct platform_device *pdev)
 {
        struct device_node *codec_node =
                of_get_child_by_name(pdev->dev.parent->of_node, "audio-codec");
+       if (!codec_node)
+               return -ENODEV;
 
        pdev->dev.of_node = codec_node;
 
index b61f980..b07607a 100644 (file)
@@ -277,7 +277,7 @@ struct hdmi_codec_priv {
        bool busy;
        struct snd_soc_jack *jack;
        unsigned int jack_status;
-       u8 iec_status[5];
+       u8 iec_status[AES_IEC958_STATUS_SIZE];
 };
 
 static const struct snd_soc_dapm_widget hdmi_widgets[] = {
index aec5127..6ffe883 100644 (file)
@@ -2688,8 +2688,8 @@ static uint32_t get_iir_band_coeff(struct snd_soc_component *component,
        int reg, b2_reg;
 
        /* Address does not automatically update if reading */
-       reg = CDC_RX_SIDETONE_IIR0_IIR_COEF_B1_CTL + 16 * iir_idx;
-       b2_reg = CDC_RX_SIDETONE_IIR0_IIR_COEF_B2_CTL + 16 * iir_idx;
+       reg = CDC_RX_SIDETONE_IIR0_IIR_COEF_B1_CTL + 0x80 * iir_idx;
+       b2_reg = CDC_RX_SIDETONE_IIR0_IIR_COEF_B2_CTL + 0x80 * iir_idx;
 
        snd_soc_component_write(component, reg,
                                ((band_idx * BAND_MAX + coeff_idx) *
@@ -2718,7 +2718,7 @@ static uint32_t get_iir_band_coeff(struct snd_soc_component *component,
 static void set_iir_band_coeff(struct snd_soc_component *component,
                               int iir_idx, int band_idx, uint32_t value)
 {
-       int reg = CDC_RX_SIDETONE_IIR0_IIR_COEF_B2_CTL + 16 * iir_idx;
+       int reg = CDC_RX_SIDETONE_IIR0_IIR_COEF_B2_CTL + 0x80 * iir_idx;
 
        snd_soc_component_write(component, reg, (value & 0xFF));
        snd_soc_component_write(component, reg, (value >> 8) & 0xFF);
@@ -2739,7 +2739,7 @@ static int rx_macro_put_iir_band_audio_mixer(
        int iir_idx = ctl->iir_idx;
        int band_idx = ctl->band_idx;
        u32 coeff[BAND_MAX];
-       int reg = CDC_RX_SIDETONE_IIR0_IIR_COEF_B1_CTL + 16 * iir_idx;
+       int reg = CDC_RX_SIDETONE_IIR0_IIR_COEF_B1_CTL + 0x80 * iir_idx;
 
        memcpy(&coeff[0], ucontrol->value.bytes.data, params->max);
 
index d75fd61..bc57d76 100644 (file)
@@ -64,7 +64,8 @@ static int speaker_gain_control_put(struct snd_kcontrol *kcontrol,
        struct snd_soc_component *c = snd_soc_kcontrol_component(kcontrol);
        struct max9759 *priv = snd_soc_component_get_drvdata(c);
 
-       if (ucontrol->value.integer.value[0] > 3)
+       if (ucontrol->value.integer.value[0] < 0 ||
+           ucontrol->value.integer.value[0] > 3)
                return -EINVAL;
 
        priv->gain = ucontrol->value.integer.value[0];
index 20e0f90..20fc0f3 100644 (file)
@@ -59,18 +59,12 @@ static void rt5682_jd_check_handler(struct work_struct *work)
        struct rt5682_priv *rt5682 = container_of(work, struct rt5682_priv,
                jd_check_work.work);
 
-       if (snd_soc_component_read(rt5682->component, RT5682_AJD1_CTRL)
-               & RT5682_JDH_RS_MASK) {
+       if (snd_soc_component_read(rt5682->component, RT5682_AJD1_CTRL) & RT5682_JDH_RS_MASK)
                /* jack out */
-               rt5682->jack_type = rt5682_headset_detect(rt5682->component, 0);
-
-               snd_soc_jack_report(rt5682->hs_jack, rt5682->jack_type,
-                       SND_JACK_HEADSET |
-                       SND_JACK_BTN_0 | SND_JACK_BTN_1 |
-                       SND_JACK_BTN_2 | SND_JACK_BTN_3);
-       } else {
+               mod_delayed_work(system_power_efficient_wq,
+                                &rt5682->jack_detect_work, 0);
+       else
                schedule_delayed_work(&rt5682->jd_check_work, 500);
-       }
 }
 
 static irqreturn_t rt5682_irq(int irq, void *data)
@@ -198,7 +192,6 @@ static int rt5682_i2c_probe(struct i2c_client *i2c,
        }
 
        mutex_init(&rt5682->calibrate_mutex);
-       mutex_init(&rt5682->jdet_mutex);
        rt5682_calibrate(rt5682);
 
        rt5682_apply_patch_list(rt5682, &i2c->dev);
index 415ec56..0a0ec4a 100644 (file)
@@ -922,15 +922,13 @@ static void rt5682_enable_push_button_irq(struct snd_soc_component *component,
  *
  * Returns detect status.
  */
-int rt5682_headset_detect(struct snd_soc_component *component, int jack_insert)
+static int rt5682_headset_detect(struct snd_soc_component *component, int jack_insert)
 {
        struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component);
        struct snd_soc_dapm_context *dapm = &component->dapm;
        unsigned int val, count;
 
        if (jack_insert) {
-               snd_soc_dapm_mutex_lock(dapm);
-
                snd_soc_component_update_bits(component, RT5682_PWR_ANLG_1,
                        RT5682_PWR_VREF2 | RT5682_PWR_MB,
                        RT5682_PWR_VREF2 | RT5682_PWR_MB);
@@ -981,8 +979,6 @@ int rt5682_headset_detect(struct snd_soc_component *component, int jack_insert)
                snd_soc_component_update_bits(component, RT5682_MICBIAS_2,
                        RT5682_PWR_CLK25M_MASK | RT5682_PWR_CLK1M_MASK,
                        RT5682_PWR_CLK25M_PU | RT5682_PWR_CLK1M_PU);
-
-               snd_soc_dapm_mutex_unlock(dapm);
        } else {
                rt5682_enable_push_button_irq(component, false);
                snd_soc_component_update_bits(component, RT5682_CBJ_CTRL_1,
@@ -1011,7 +1007,6 @@ int rt5682_headset_detect(struct snd_soc_component *component, int jack_insert)
        dev_dbg(component->dev, "jack_type = %d\n", rt5682->jack_type);
        return rt5682->jack_type;
 }
-EXPORT_SYMBOL_GPL(rt5682_headset_detect);
 
 static int rt5682_set_jack_detect(struct snd_soc_component *component,
                struct snd_soc_jack *hs_jack, void *data)
@@ -1094,6 +1089,7 @@ void rt5682_jack_detect_handler(struct work_struct *work)
 {
        struct rt5682_priv *rt5682 =
                container_of(work, struct rt5682_priv, jack_detect_work.work);
+       struct snd_soc_dapm_context *dapm;
        int val, btn_type;
 
        while (!rt5682->component)
@@ -1102,7 +1098,9 @@ void rt5682_jack_detect_handler(struct work_struct *work)
        while (!rt5682->component->card->instantiated)
                usleep_range(10000, 15000);
 
-       mutex_lock(&rt5682->jdet_mutex);
+       dapm = snd_soc_component_get_dapm(rt5682->component);
+
+       snd_soc_dapm_mutex_lock(dapm);
        mutex_lock(&rt5682->calibrate_mutex);
 
        val = snd_soc_component_read(rt5682->component, RT5682_AJD1_CTRL)
@@ -1162,6 +1160,9 @@ void rt5682_jack_detect_handler(struct work_struct *work)
                rt5682->irq_work_delay_time = 50;
        }
 
+       mutex_unlock(&rt5682->calibrate_mutex);
+       snd_soc_dapm_mutex_unlock(dapm);
+
        snd_soc_jack_report(rt5682->hs_jack, rt5682->jack_type,
                SND_JACK_HEADSET |
                SND_JACK_BTN_0 | SND_JACK_BTN_1 |
@@ -1174,9 +1175,6 @@ void rt5682_jack_detect_handler(struct work_struct *work)
                else
                        cancel_delayed_work_sync(&rt5682->jd_check_work);
        }
-
-       mutex_unlock(&rt5682->calibrate_mutex);
-       mutex_unlock(&rt5682->jdet_mutex);
 }
 EXPORT_SYMBOL_GPL(rt5682_jack_detect_handler);
 
@@ -1526,7 +1524,6 @@ static int rt5682_hp_event(struct snd_soc_dapm_widget *w,
 {
        struct snd_soc_component *component =
                snd_soc_dapm_to_component(w->dapm);
-       struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component);
 
        switch (event) {
        case SND_SOC_DAPM_PRE_PMU:
@@ -1538,17 +1535,12 @@ static int rt5682_hp_event(struct snd_soc_dapm_widget *w,
                        RT5682_DEPOP_1, 0x60, 0x60);
                snd_soc_component_update_bits(component,
                        RT5682_DAC_ADC_DIG_VOL1, 0x00c0, 0x0080);
-
-               mutex_lock(&rt5682->jdet_mutex);
-
                snd_soc_component_update_bits(component, RT5682_HP_CTRL_2,
                        RT5682_HP_C2_DAC_L_EN | RT5682_HP_C2_DAC_R_EN,
                        RT5682_HP_C2_DAC_L_EN | RT5682_HP_C2_DAC_R_EN);
                usleep_range(5000, 10000);
                snd_soc_component_update_bits(component, RT5682_CHARGE_PUMP_1,
                        RT5682_CP_SW_SIZE_MASK, RT5682_CP_SW_SIZE_L);
-
-               mutex_unlock(&rt5682->jdet_mutex);
                break;
 
        case SND_SOC_DAPM_POST_PMD:
index c917c76..52ff0d9 100644 (file)
@@ -1463,7 +1463,6 @@ struct rt5682_priv {
 
        int jack_type;
        int irq_work_delay_time;
-       struct mutex jdet_mutex;
 };
 
 extern const char *rt5682_supply_names[RT5682_NUM_SUPPLIES];
@@ -1473,7 +1472,6 @@ int rt5682_sel_asrc_clk_src(struct snd_soc_component *component,
 
 void rt5682_apply_patch_list(struct rt5682_priv *rt5682, struct device *dev);
 
-int rt5682_headset_detect(struct snd_soc_component *component, int jack_insert);
 void rt5682_jack_detect_handler(struct work_struct *work);
 
 bool rt5682_volatile_register(struct device *dev, unsigned int reg);
index eff200a..36cbc66 100644 (file)
@@ -1432,14 +1432,10 @@ static int wcd938x_sdw_connect_port(struct wcd938x_sdw_ch_info *ch_info,
        return 0;
 }
 
-static int wcd938x_connect_port(struct wcd938x_sdw_priv *wcd, u8 ch_id, u8 enable)
+static int wcd938x_connect_port(struct wcd938x_sdw_priv *wcd, u8 port_num, u8 ch_id, u8 enable)
 {
-       u8 port_num;
-
-       port_num = wcd->ch_info[ch_id].port_num;
-
        return wcd938x_sdw_connect_port(&wcd->ch_info[ch_id],
-                                       &wcd->port_config[port_num],
+                                       &wcd->port_config[port_num - 1],
                                        enable);
 }
 
@@ -2563,7 +2559,7 @@ static int wcd938x_ear_pa_put_gain(struct snd_kcontrol *kcontrol,
                                      WCD938X_EAR_GAIN_MASK,
                                      ucontrol->value.integer.value[0]);
 
-       return 0;
+       return 1;
 }
 
 static int wcd938x_get_compander(struct snd_kcontrol *kcontrol,
@@ -2593,6 +2589,7 @@ static int wcd938x_set_compander(struct snd_kcontrol *kcontrol,
        struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component);
        struct wcd938x_sdw_priv *wcd;
        int value = ucontrol->value.integer.value[0];
+       int portidx;
        struct soc_mixer_control *mc;
        bool hphr;
 
@@ -2606,12 +2603,14 @@ static int wcd938x_set_compander(struct snd_kcontrol *kcontrol,
        else
                wcd938x->comp1_enable = value;
 
+       portidx = wcd->ch_info[mc->reg].port_num;
+
        if (value)
-               wcd938x_connect_port(wcd, mc->reg, true);
+               wcd938x_connect_port(wcd, portidx, mc->reg, true);
        else
-               wcd938x_connect_port(wcd, mc->reg, false);
+               wcd938x_connect_port(wcd, portidx, mc->reg, false);
 
-       return 0;
+       return 1;
 }
 
 static int wcd938x_ldoh_get(struct snd_kcontrol *kcontrol,
@@ -2882,9 +2881,11 @@ static int wcd938x_get_swr_port(struct snd_kcontrol *kcontrol,
        struct wcd938x_sdw_priv *wcd;
        struct soc_mixer_control *mixer = (struct soc_mixer_control *)kcontrol->private_value;
        int dai_id = mixer->shift;
-       int portidx = mixer->reg;
+       int portidx, ch_idx = mixer->reg;
+
 
        wcd = wcd938x->sdw_priv[dai_id];
+       portidx = wcd->ch_info[ch_idx].port_num;
 
        ucontrol->value.integer.value[0] = wcd->port_enable[portidx];
 
@@ -2899,12 +2900,14 @@ static int wcd938x_set_swr_port(struct snd_kcontrol *kcontrol,
        struct wcd938x_sdw_priv *wcd;
        struct soc_mixer_control *mixer =
                (struct soc_mixer_control *)kcontrol->private_value;
-       int portidx = mixer->reg;
+       int ch_idx = mixer->reg;
+       int portidx;
        int dai_id = mixer->shift;
        bool enable;
 
        wcd = wcd938x->sdw_priv[dai_id];
 
+       portidx = wcd->ch_info[ch_idx].port_num;
        if (ucontrol->value.integer.value[0])
                enable = true;
        else
@@ -2912,9 +2915,9 @@ static int wcd938x_set_swr_port(struct snd_kcontrol *kcontrol,
 
        wcd->port_enable[portidx] = enable;
 
-       wcd938x_connect_port(wcd, portidx, enable);
+       wcd938x_connect_port(wcd, portidx, ch_idx, enable);
 
-       return 0;
+       return 1;
 
 }
 
index af3c3b9..83b4a22 100644 (file)
@@ -93,16 +93,21 @@ static int pcm030_fabric_probe(struct platform_device *op)
                dev_err(&op->dev, "platform_device_alloc() failed\n");
 
        ret = platform_device_add(pdata->codec_device);
-       if (ret)
+       if (ret) {
                dev_err(&op->dev, "platform_device_add() failed: %d\n", ret);
+               platform_device_put(pdata->codec_device);
+       }
 
        ret = snd_soc_register_card(card);
-       if (ret)
+       if (ret) {
                dev_err(&op->dev, "snd_soc_register_card() failed: %d\n", ret);
+               platform_device_del(pdata->codec_device);
+               platform_device_put(pdata->codec_device);
+       }
 
        platform_set_drvdata(op, pdata);
-
        return ret;
+
 }
 
 static int pcm030_fabric_remove(struct platform_device *op)
index a89d1cf..78419e1 100644 (file)
@@ -28,6 +28,30 @@ static const struct snd_soc_ops simple_ops = {
        .hw_params      = asoc_simple_hw_params,
 };
 
+static int asoc_simple_parse_platform(struct device_node *node,
+                                     struct snd_soc_dai_link_component *dlc)
+{
+       struct of_phandle_args args;
+       int ret;
+
+       if (!node)
+               return 0;
+
+       /*
+        * Get node via "sound-dai = <&phandle port>"
+        * it will be used as xxx_of_node on soc_bind_dai_link()
+        */
+       ret = of_parse_phandle_with_args(node, DAI, CELL, 0, &args);
+       if (ret)
+               return ret;
+
+       /* dai_name is not required and may not exist for plat component */
+
+       dlc->of_node = args.np;
+
+       return 0;
+}
+
 static int asoc_simple_parse_dai(struct device_node *node,
                                 struct snd_soc_dai_link_component *dlc,
                                 int *is_single_link)
@@ -289,7 +313,7 @@ static int simple_dai_link_of(struct asoc_simple_priv *priv,
        if (ret < 0)
                goto dai_link_of_err;
 
-       ret = asoc_simple_parse_dai(plat, platforms, NULL);
+       ret = asoc_simple_parse_platform(plat, platforms);
        if (ret < 0)
                goto dai_link_of_err;
 
index 9306b7c..0d15435 100644 (file)
@@ -216,7 +216,7 @@ config SND_SOC_MT8195_MT6359_RT1019_RT5682
 
 config SND_SOC_MT8195_MT6359_RT1011_RT5682
        tristate "ASoC Audio driver for MT8195 with MT6359 RT1011 RT5682 codec"
-       depends on I2C
+       depends on I2C && GPIOLIB
        depends on SND_SOC_MT8195 && MTK_PMIC_WRAP
        select SND_SOC_MT6359
        select SND_SOC_RT1011
index eb1c3ae..19c4a90 100644 (file)
@@ -308,8 +308,11 @@ static int q6apm_dai_close(struct snd_soc_component *component,
        struct snd_pcm_runtime *runtime = substream->runtime;
        struct q6apm_dai_rtd *prtd = runtime->private_data;
 
-       q6apm_graph_stop(prtd->graph);
-       q6apm_unmap_memory_regions(prtd->graph, substream->stream);
+       if (prtd->state) { /* only stop graph that is started */
+               q6apm_graph_stop(prtd->graph);
+               q6apm_unmap_memory_regions(prtd->graph, substream->stream);
+       }
+
        q6apm_graph_close(prtd->graph);
        prtd->graph = NULL;
        kfree(prtd);
index cbd7ea4..142476f 100644 (file)
@@ -55,16 +55,13 @@ EXPORT_SYMBOL_GPL(snd_soc_acpi_find_machine);
 static acpi_status snd_soc_acpi_find_package(acpi_handle handle, u32 level,
                                             void *context, void **ret)
 {
-       struct acpi_device *adev;
+       struct acpi_device *adev = acpi_fetch_acpi_dev(handle);
        acpi_status status;
        struct snd_soc_acpi_package_context *pkg_ctx = context;
 
        pkg_ctx->data_valid = false;
 
-       if (acpi_bus_get_device(handle, &adev))
-               return AE_OK;
-
-       if (adev->status.present && adev->status.functional) {
+       if (adev && adev->status.present && adev->status.functional) {
                struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
                union acpi_object  *myobj = NULL;
 
index 08eaa9d..9833611 100644 (file)
@@ -316,13 +316,27 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,
        if (sign_bit)
                mask = BIT(sign_bit + 1) - 1;
 
-       val = ((ucontrol->value.integer.value[0] + min) & mask);
+       if (ucontrol->value.integer.value[0] < 0)
+               return -EINVAL;
+       val = ucontrol->value.integer.value[0];
+       if (mc->platform_max && val > mc->platform_max)
+               return -EINVAL;
+       if (val > max - min)
+               return -EINVAL;
+       val = (val + min) & mask;
        if (invert)
                val = max - val;
        val_mask = mask << shift;
        val = val << shift;
        if (snd_soc_volsw_is_stereo(mc)) {
-               val2 = ((ucontrol->value.integer.value[1] + min) & mask);
+               if (ucontrol->value.integer.value[1] < 0)
+                       return -EINVAL;
+               val2 = ucontrol->value.integer.value[1];
+               if (mc->platform_max && val2 > mc->platform_max)
+                       return -EINVAL;
+               if (val2 > max - min)
+                       return -EINVAL;
+               val2 = (val2 + min) & mask;
                if (invert)
                        val2 = max - val2;
                if (reg == reg2) {
@@ -409,8 +423,15 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol,
        int err = 0;
        unsigned int val, val_mask;
 
+       if (ucontrol->value.integer.value[0] < 0)
+               return -EINVAL;
+       val = ucontrol->value.integer.value[0];
+       if (mc->platform_max && val > mc->platform_max)
+               return -EINVAL;
+       if (val > max - min)
+               return -EINVAL;
        val_mask = mask << shift;
-       val = (ucontrol->value.integer.value[0] + min) & mask;
+       val = (val + min) & mask;
        val = val << shift;
 
        err = snd_soc_component_update_bits(component, reg, val_mask, val);
@@ -858,6 +879,8 @@ int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol,
        long val = ucontrol->value.integer.value[0];
        unsigned int i;
 
+       if (val < mc->min || val > mc->max)
+               return -EINVAL;
        if (invert)
                val = max - val;
        val &= mask;
index 7abfc48..9a95468 100644 (file)
@@ -46,8 +46,8 @@ static inline void snd_soc_dpcm_stream_lock_irq(struct snd_soc_pcm_runtime *rtd,
        snd_pcm_stream_lock_irq(snd_soc_dpcm_get_substream(rtd, stream));
 }
 
-#define snd_soc_dpcm_stream_lock_irqsave(rtd, stream, flags) \
-       snd_pcm_stream_lock_irqsave(snd_soc_dpcm_get_substream(rtd, stream), flags)
+#define snd_soc_dpcm_stream_lock_irqsave_nested(rtd, stream, flags) \
+       snd_pcm_stream_lock_irqsave_nested(snd_soc_dpcm_get_substream(rtd, stream), flags)
 
 static inline void snd_soc_dpcm_stream_unlock_irq(struct snd_soc_pcm_runtime *rtd,
                                                  int stream)
@@ -1268,6 +1268,7 @@ static void dpcm_be_reparent(struct snd_soc_pcm_runtime *fe,
 void dpcm_be_disconnect(struct snd_soc_pcm_runtime *fe, int stream)
 {
        struct snd_soc_dpcm *dpcm, *d;
+       LIST_HEAD(deleted_dpcms);
 
        snd_soc_dpcm_mutex_assert_held(fe);
 
@@ -1287,13 +1288,18 @@ void dpcm_be_disconnect(struct snd_soc_pcm_runtime *fe, int stream)
                /* BEs still alive need new FE */
                dpcm_be_reparent(fe, dpcm->be, stream);
 
-               dpcm_remove_debugfs_state(dpcm);
-
                list_del(&dpcm->list_be);
+               list_move(&dpcm->list_fe, &deleted_dpcms);
+       }
+       snd_soc_dpcm_stream_unlock_irq(fe, stream);
+
+       while (!list_empty(&deleted_dpcms)) {
+               dpcm = list_first_entry(&deleted_dpcms, struct snd_soc_dpcm,
+                                       list_fe);
                list_del(&dpcm->list_fe);
+               dpcm_remove_debugfs_state(dpcm);
                kfree(dpcm);
        }
-       snd_soc_dpcm_stream_unlock_irq(fe, stream);
 }
 
 /* get BE for DAI widget and stream */
@@ -2094,7 +2100,7 @@ int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream,
                be = dpcm->be;
                be_substream = snd_soc_dpcm_get_substream(be, stream);
 
-               snd_soc_dpcm_stream_lock_irqsave(be, stream, flags);
+               snd_soc_dpcm_stream_lock_irqsave_nested(be, stream, flags);
 
                /* is this op for this BE ? */
                if (!snd_soc_dpcm_be_can_update(fe, be, stream))
index 91afea9..ce19a60 100644 (file)
@@ -37,6 +37,7 @@
 #define XLNX_AUD_XFER_COUNT    0x28
 #define XLNX_AUD_CH_STS_START  0x2C
 #define XLNX_BYTES_PER_CH      0x44
+#define XLNX_AUD_ALIGN_BYTES   64
 
 #define AUD_STS_IOC_IRQ_MASK   BIT(31)
 #define AUD_STS_CH_STS_MASK    BIT(29)
@@ -368,12 +369,32 @@ static int xlnx_formatter_pcm_open(struct snd_soc_component *component,
        snd_soc_set_runtime_hwparams(substream, &xlnx_pcm_hardware);
        runtime->private_data = stream_data;
 
-       /* Resize the period size divisible by 64 */
+       /* Resize the period bytes as divisible by 64 */
        err = snd_pcm_hw_constraint_step(runtime, 0,
-                                        SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64);
+                                        SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
+                                        XLNX_AUD_ALIGN_BYTES);
        if (err) {
                dev_err(component->dev,
-                       "unable to set constraint on period bytes\n");
+                       "Unable to set constraint on period bytes\n");
+               return err;
+       }
+
+       /* Resize the buffer bytes as divisible by 64 */
+       err = snd_pcm_hw_constraint_step(runtime, 0,
+                                        SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
+                                        XLNX_AUD_ALIGN_BYTES);
+       if (err) {
+               dev_err(component->dev,
+                       "Unable to set constraint on buffer bytes\n");
+               return err;
+       }
+
+       /* Set periods as integer multiple */
+       err = snd_pcm_hw_constraint_integer(runtime,
+                                           SNDRV_PCM_HW_PARAM_PERIODS);
+       if (err < 0) {
+               dev_err(component->dev,
+                       "Unable to set constraint on periods to be integer\n");
                return err;
        }
 
index e8f3f8d..630766b 100644 (file)
@@ -1527,6 +1527,10 @@ error:
                usb_audio_err(chip,
                        "cannot get connectors status: req = %#x, wValue = %#x, wIndex = %#x, type = %d\n",
                        UAC_GET_CUR, validx, idx, cval->val_type);
+
+               if (val)
+                       *val = 0;
+
                return filter_error(cval, ret);
        }
 
index b1522e4..0ea3956 100644 (file)
@@ -84,7 +84,7 @@
  * combination.
  */
 {
-       USB_DEVICE(0x041e, 0x4095),
+       USB_AUDIO_DEVICE(0x041e, 0x4095),
        .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
                .ifnum = QUIRK_ANY_INTERFACE,
                .type = QUIRK_COMPOSITE,
index 18de5f7..6db4e29 100644 (file)
 /* Intel-defined CPU features, CPUID level 0x00000007:1 (EAX), word 12 */
 #define X86_FEATURE_AVX_VNNI           (12*32+ 4) /* AVX VNNI instructions */
 #define X86_FEATURE_AVX512_BF16                (12*32+ 5) /* AVX512 BFLOAT16 instructions */
+#define X86_FEATURE_AMX_BF16           (18*32+22) /* AMX bf16 Support */
 #define X86_FEATURE_AMX_TILE           (18*32+24) /* AMX tile Support */
+#define X86_FEATURE_AMX_INT8           (18*32+25) /* AMX int8 Support */
 
 /* AMD-defined CPU features, CPUID level 0x80000008 (EBX), word 13 */
 #define X86_FEATURE_CLZERO             (13*32+ 0) /* CLZERO instruction */
index 2da3316..bf6e960 100644 (file)
@@ -452,6 +452,9 @@ struct kvm_sync_regs {
 
 #define KVM_STATE_VMX_PREEMPTION_TIMER_DEADLINE        0x00000001
 
+/* attributes for system fd (group 0) */
+#define KVM_X86_XCOMP_GUEST_SUPP       0
+
 struct kvm_vmx_nested_state_data {
        __u8 vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
        __u8 shadow_vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
index 9ddeca9..320a88a 100644 (file)
@@ -9,7 +9,11 @@ ifeq ($(V),1)
   msg =
 else
   Q = @
-  msg = @printf '  %-8s %s%s\n' "$(1)" "$(notdir $(2))" "$(if $(3), $(3))";
+  ifeq ($(silent),1)
+    msg =
+  else
+    msg = @printf '  %-8s %s%s\n' "$(1)" "$(notdir $(2))" "$(if $(3), $(3))";
+  endif
   MAKEFLAGS=--no-print-directory
 endif
 
index ab9353f..9a5c1f0 100644 (file)
@@ -68,7 +68,7 @@ int handle__sched_switch(u64 *ctx)
         */
        struct task_struct *prev = (struct task_struct *)ctx[1];
        struct task_struct *next = (struct task_struct *)ctx[2];
-       struct event event = {};
+       struct runq_event event = {};
        u64 *tsp, delta_us;
        long state;
        u32 pid;
index 2414cc7..d78f414 100644 (file)
@@ -100,7 +100,7 @@ static int bump_memlock_rlimit(void)
 
 void handle_event(void *ctx, int cpu, void *data, __u32 data_sz)
 {
-       const struct event *e = data;
+       const struct runq_event *e = data;
        struct tm *tm;
        char ts[32];
        time_t t;
index 9db2254..4f70f07 100644 (file)
@@ -4,7 +4,7 @@
 
 #define TASK_COMM_LEN 16
 
-struct event {
+struct runq_event {
        char task[TASK_COMM_LEN];
        __u64 delta_us;
        pid_t pid;
index 9563d29..5191b57 100644 (file)
@@ -1133,6 +1133,7 @@ struct kvm_ppc_resize_hpt {
 #define KVM_CAP_VM_MOVE_ENC_CONTEXT_FROM 206
 #define KVM_CAP_VM_GPA_BITS 207
 #define KVM_CAP_XSAVE2 208
+#define KVM_CAP_SYS_ATTRIBUTES 209
 
 #ifdef KVM_CAP_IRQ_ROUTING
 
@@ -1623,9 +1624,6 @@ struct kvm_enc_region {
 #define KVM_S390_NORMAL_RESET  _IO(KVMIO,   0xc3)
 #define KVM_S390_CLEAR_RESET   _IO(KVMIO,   0xc4)
 
-/* Available with KVM_CAP_XSAVE2 */
-#define KVM_GET_XSAVE2           _IOR(KVMIO,  0xcf, struct kvm_xsave)
-
 struct kvm_s390_pv_sec_parm {
        __u64 origin;
        __u64 length;
@@ -2047,4 +2045,7 @@ struct kvm_stats_desc {
 
 #define KVM_GET_STATS_FD  _IO(KVMIO,  0xce)
 
+/* Available with KVM_CAP_XSAVE2 */
+#define KVM_GET_XSAVE2           _IOR(KVMIO,  0xcf, struct kvm_xsave)
+
 #endif /* __LINUX_KVM_H */
diff --git a/tools/include/uapi/linux/lirc.h b/tools/include/uapi/linux/lirc.h
deleted file mode 100644 (file)
index 45fcbf9..0000000
+++ /dev/null
@@ -1,229 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
-/*
- * lirc.h - linux infrared remote control header file
- * last modified 2010/07/13 by Jarod Wilson
- */
-
-#ifndef _LINUX_LIRC_H
-#define _LINUX_LIRC_H
-
-#include <linux/types.h>
-#include <linux/ioctl.h>
-
-#define PULSE_BIT       0x01000000
-#define PULSE_MASK      0x00FFFFFF
-
-#define LIRC_MODE2_SPACE     0x00000000
-#define LIRC_MODE2_PULSE     0x01000000
-#define LIRC_MODE2_FREQUENCY 0x02000000
-#define LIRC_MODE2_TIMEOUT   0x03000000
-
-#define LIRC_VALUE_MASK      0x00FFFFFF
-#define LIRC_MODE2_MASK      0xFF000000
-
-#define LIRC_SPACE(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_SPACE)
-#define LIRC_PULSE(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_PULSE)
-#define LIRC_FREQUENCY(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_FREQUENCY)
-#define LIRC_TIMEOUT(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_TIMEOUT)
-
-#define LIRC_VALUE(val) ((val)&LIRC_VALUE_MASK)
-#define LIRC_MODE2(val) ((val)&LIRC_MODE2_MASK)
-
-#define LIRC_IS_SPACE(val) (LIRC_MODE2(val) == LIRC_MODE2_SPACE)
-#define LIRC_IS_PULSE(val) (LIRC_MODE2(val) == LIRC_MODE2_PULSE)
-#define LIRC_IS_FREQUENCY(val) (LIRC_MODE2(val) == LIRC_MODE2_FREQUENCY)
-#define LIRC_IS_TIMEOUT(val) (LIRC_MODE2(val) == LIRC_MODE2_TIMEOUT)
-
-/* used heavily by lirc userspace */
-#define lirc_t int
-
-/*** lirc compatible hardware features ***/
-
-#define LIRC_MODE2SEND(x) (x)
-#define LIRC_SEND2MODE(x) (x)
-#define LIRC_MODE2REC(x) ((x) << 16)
-#define LIRC_REC2MODE(x) ((x) >> 16)
-
-#define LIRC_MODE_RAW                  0x00000001
-#define LIRC_MODE_PULSE                0x00000002
-#define LIRC_MODE_MODE2                0x00000004
-#define LIRC_MODE_SCANCODE             0x00000008
-#define LIRC_MODE_LIRCCODE             0x00000010
-
-
-#define LIRC_CAN_SEND_RAW              LIRC_MODE2SEND(LIRC_MODE_RAW)
-#define LIRC_CAN_SEND_PULSE            LIRC_MODE2SEND(LIRC_MODE_PULSE)
-#define LIRC_CAN_SEND_MODE2            LIRC_MODE2SEND(LIRC_MODE_MODE2)
-#define LIRC_CAN_SEND_LIRCCODE         LIRC_MODE2SEND(LIRC_MODE_LIRCCODE)
-
-#define LIRC_CAN_SEND_MASK             0x0000003f
-
-#define LIRC_CAN_SET_SEND_CARRIER      0x00000100
-#define LIRC_CAN_SET_SEND_DUTY_CYCLE   0x00000200
-#define LIRC_CAN_SET_TRANSMITTER_MASK  0x00000400
-
-#define LIRC_CAN_REC_RAW               LIRC_MODE2REC(LIRC_MODE_RAW)
-#define LIRC_CAN_REC_PULSE             LIRC_MODE2REC(LIRC_MODE_PULSE)
-#define LIRC_CAN_REC_MODE2             LIRC_MODE2REC(LIRC_MODE_MODE2)
-#define LIRC_CAN_REC_SCANCODE          LIRC_MODE2REC(LIRC_MODE_SCANCODE)
-#define LIRC_CAN_REC_LIRCCODE          LIRC_MODE2REC(LIRC_MODE_LIRCCODE)
-
-#define LIRC_CAN_REC_MASK              LIRC_MODE2REC(LIRC_CAN_SEND_MASK)
-
-#define LIRC_CAN_SET_REC_CARRIER       (LIRC_CAN_SET_SEND_CARRIER << 16)
-#define LIRC_CAN_SET_REC_DUTY_CYCLE    (LIRC_CAN_SET_SEND_DUTY_CYCLE << 16)
-
-#define LIRC_CAN_SET_REC_DUTY_CYCLE_RANGE 0x40000000
-#define LIRC_CAN_SET_REC_CARRIER_RANGE    0x80000000
-#define LIRC_CAN_GET_REC_RESOLUTION       0x20000000
-#define LIRC_CAN_SET_REC_TIMEOUT          0x10000000
-#define LIRC_CAN_SET_REC_FILTER           0x08000000
-
-#define LIRC_CAN_MEASURE_CARRIER          0x02000000
-#define LIRC_CAN_USE_WIDEBAND_RECEIVER    0x04000000
-
-#define LIRC_CAN_SEND(x) ((x)&LIRC_CAN_SEND_MASK)
-#define LIRC_CAN_REC(x) ((x)&LIRC_CAN_REC_MASK)
-
-#define LIRC_CAN_NOTIFY_DECODE            0x01000000
-
-/*** IOCTL commands for lirc driver ***/
-
-#define LIRC_GET_FEATURES              _IOR('i', 0x00000000, __u32)
-
-#define LIRC_GET_SEND_MODE             _IOR('i', 0x00000001, __u32)
-#define LIRC_GET_REC_MODE              _IOR('i', 0x00000002, __u32)
-#define LIRC_GET_REC_RESOLUTION        _IOR('i', 0x00000007, __u32)
-
-#define LIRC_GET_MIN_TIMEOUT           _IOR('i', 0x00000008, __u32)
-#define LIRC_GET_MAX_TIMEOUT           _IOR('i', 0x00000009, __u32)
-
-/* code length in bits, currently only for LIRC_MODE_LIRCCODE */
-#define LIRC_GET_LENGTH                _IOR('i', 0x0000000f, __u32)
-
-#define LIRC_SET_SEND_MODE             _IOW('i', 0x00000011, __u32)
-#define LIRC_SET_REC_MODE              _IOW('i', 0x00000012, __u32)
-/* Note: these can reset the according pulse_width */
-#define LIRC_SET_SEND_CARRIER          _IOW('i', 0x00000013, __u32)
-#define LIRC_SET_REC_CARRIER           _IOW('i', 0x00000014, __u32)
-#define LIRC_SET_SEND_DUTY_CYCLE       _IOW('i', 0x00000015, __u32)
-#define LIRC_SET_TRANSMITTER_MASK      _IOW('i', 0x00000017, __u32)
-
-/*
- * when a timeout != 0 is set the driver will send a
- * LIRC_MODE2_TIMEOUT data packet, otherwise LIRC_MODE2_TIMEOUT is
- * never sent, timeout is disabled by default
- */
-#define LIRC_SET_REC_TIMEOUT           _IOW('i', 0x00000018, __u32)
-
-/* 1 enables, 0 disables timeout reports in MODE2 */
-#define LIRC_SET_REC_TIMEOUT_REPORTS   _IOW('i', 0x00000019, __u32)
-
-/*
- * if enabled from the next key press on the driver will send
- * LIRC_MODE2_FREQUENCY packets
- */
-#define LIRC_SET_MEASURE_CARRIER_MODE  _IOW('i', 0x0000001d, __u32)
-
-/*
- * to set a range use LIRC_SET_REC_CARRIER_RANGE with the
- * lower bound first and later LIRC_SET_REC_CARRIER with the upper bound
- */
-#define LIRC_SET_REC_CARRIER_RANGE     _IOW('i', 0x0000001f, __u32)
-
-#define LIRC_SET_WIDEBAND_RECEIVER     _IOW('i', 0x00000023, __u32)
-
-/*
- * Return the recording timeout, which is either set by
- * the ioctl LIRC_SET_REC_TIMEOUT or by the kernel after setting the protocols.
- */
-#define LIRC_GET_REC_TIMEOUT          _IOR('i', 0x00000024, __u32)
-
-/*
- * struct lirc_scancode - decoded scancode with protocol for use with
- *     LIRC_MODE_SCANCODE
- *
- * @timestamp: Timestamp in nanoseconds using CLOCK_MONOTONIC when IR
- *     was decoded.
- * @flags: should be 0 for transmit. When receiving scancodes,
- *     LIRC_SCANCODE_FLAG_TOGGLE or LIRC_SCANCODE_FLAG_REPEAT can be set
- *     depending on the protocol
- * @rc_proto: see enum rc_proto
- * @keycode: the translated keycode. Set to 0 for transmit.
- * @scancode: the scancode received or to be sent
- */
-struct lirc_scancode {
-       __u64   timestamp;
-       __u16   flags;
-       __u16   rc_proto;
-       __u32   keycode;
-       __u64   scancode;
-};
-
-/* Set if the toggle bit of rc-5 or rc-6 is enabled */
-#define LIRC_SCANCODE_FLAG_TOGGLE      1
-/* Set if this is a nec or sanyo repeat */
-#define LIRC_SCANCODE_FLAG_REPEAT      2
-
-/**
- * enum rc_proto - the Remote Controller protocol
- *
- * @RC_PROTO_UNKNOWN: Protocol not known
- * @RC_PROTO_OTHER: Protocol known but proprietary
- * @RC_PROTO_RC5: Philips RC5 protocol
- * @RC_PROTO_RC5X_20: Philips RC5x 20 bit protocol
- * @RC_PROTO_RC5_SZ: StreamZap variant of RC5
- * @RC_PROTO_JVC: JVC protocol
- * @RC_PROTO_SONY12: Sony 12 bit protocol
- * @RC_PROTO_SONY15: Sony 15 bit protocol
- * @RC_PROTO_SONY20: Sony 20 bit protocol
- * @RC_PROTO_NEC: NEC protocol
- * @RC_PROTO_NECX: Extended NEC protocol
- * @RC_PROTO_NEC32: NEC 32 bit protocol
- * @RC_PROTO_SANYO: Sanyo protocol
- * @RC_PROTO_MCIR2_KBD: RC6-ish MCE keyboard
- * @RC_PROTO_MCIR2_MSE: RC6-ish MCE mouse
- * @RC_PROTO_RC6_0: Philips RC6-0-16 protocol
- * @RC_PROTO_RC6_6A_20: Philips RC6-6A-20 protocol
- * @RC_PROTO_RC6_6A_24: Philips RC6-6A-24 protocol
- * @RC_PROTO_RC6_6A_32: Philips RC6-6A-32 protocol
- * @RC_PROTO_RC6_MCE: MCE (Philips RC6-6A-32 subtype) protocol
- * @RC_PROTO_SHARP: Sharp protocol
- * @RC_PROTO_XMP: XMP protocol
- * @RC_PROTO_CEC: CEC protocol
- * @RC_PROTO_IMON: iMon Pad protocol
- * @RC_PROTO_RCMM12: RC-MM protocol 12 bits
- * @RC_PROTO_RCMM24: RC-MM protocol 24 bits
- * @RC_PROTO_RCMM32: RC-MM protocol 32 bits
- */
-enum rc_proto {
-       RC_PROTO_UNKNOWN        = 0,
-       RC_PROTO_OTHER          = 1,
-       RC_PROTO_RC5            = 2,
-       RC_PROTO_RC5X_20        = 3,
-       RC_PROTO_RC5_SZ         = 4,
-       RC_PROTO_JVC            = 5,
-       RC_PROTO_SONY12         = 6,
-       RC_PROTO_SONY15         = 7,
-       RC_PROTO_SONY20         = 8,
-       RC_PROTO_NEC            = 9,
-       RC_PROTO_NECX           = 10,
-       RC_PROTO_NEC32          = 11,
-       RC_PROTO_SANYO          = 12,
-       RC_PROTO_MCIR2_KBD      = 13,
-       RC_PROTO_MCIR2_MSE      = 14,
-       RC_PROTO_RC6_0          = 15,
-       RC_PROTO_RC6_6A_20      = 16,
-       RC_PROTO_RC6_6A_24      = 17,
-       RC_PROTO_RC6_6A_32      = 18,
-       RC_PROTO_RC6_MCE        = 19,
-       RC_PROTO_SHARP          = 20,
-       RC_PROTO_XMP            = 21,
-       RC_PROTO_CEC            = 22,
-       RC_PROTO_IMON           = 23,
-       RC_PROTO_RCMM12         = 24,
-       RC_PROTO_RCMM24         = 25,
-       RC_PROTO_RCMM32         = 26,
-};
-
-#endif
index 4cd39aa..1b65042 100644 (file)
@@ -1332,9 +1332,9 @@ union perf_mem_data_src {
 
 /* hop level */
 #define PERF_MEM_HOPS_0                0x01 /* remote core, same node */
-#define PERF_MEM_HOPS_1         0x02 /* remote node, same socket */
-#define PERF_MEM_HOPS_2         0x03 /* remote socket, same board */
-#define PERF_MEM_HOPS_3         0x04 /* remote board */
+#define PERF_MEM_HOPS_1                0x02 /* remote node, same socket */
+#define PERF_MEM_HOPS_2                0x03 /* remote socket, same board */
+#define PERF_MEM_HOPS_3                0x04 /* remote board */
 /* 5-7 available */
 #define PERF_MEM_HOPS_SHIFT    43
 
index bb73e9a..e998764 100644 (file)
@@ -272,4 +272,7 @@ struct prctl_mm_map {
 # define PR_SCHED_CORE_SCOPE_THREAD_GROUP      1
 # define PR_SCHED_CORE_SCOPE_PROCESS_GROUP     2
 
+#define PR_SET_VMA             0x53564d41
+# define PR_SET_VMA_ANON_NAME          0
+
 #endif /* _LINUX_PRCTL_H */
index 5fbb79e..2d3e5df 100644 (file)
  *                                                                          *
  ****************************************************************************/
 
+#define AES_IEC958_STATUS_SIZE         24
+
 struct snd_aes_iec958 {
-       unsigned char status[24];       /* AES/IEC958 channel status bits */
+       unsigned char status[AES_IEC958_STATUS_SIZE]; /* AES/IEC958 channel status bits */
        unsigned char subcode[147];     /* AES/IEC958 subcode bits */
        unsigned char pad;              /* nothing */
        unsigned char dig_subframe[4];  /* AES/IEC958 subframe bits */
@@ -202,6 +204,11 @@ typedef int __bitwise snd_pcm_format_t;
 #define        SNDRV_PCM_FORMAT_S24_BE ((__force snd_pcm_format_t) 7) /* low three bytes */
 #define        SNDRV_PCM_FORMAT_U24_LE ((__force snd_pcm_format_t) 8) /* low three bytes */
 #define        SNDRV_PCM_FORMAT_U24_BE ((__force snd_pcm_format_t) 9) /* low three bytes */
+/*
+ * For S32/U32 formats, 'msbits' hardware parameter is often used to deliver information about the
+ * available bit count in most significant bit. It's for the case of so-called 'left-justified' or
+ * `right-padding` sample which has less width than 32 bit.
+ */
 #define        SNDRV_PCM_FORMAT_S32_LE ((__force snd_pcm_format_t) 10)
 #define        SNDRV_PCM_FORMAT_S32_BE ((__force snd_pcm_format_t) 11)
 #define        SNDRV_PCM_FORMAT_U32_LE ((__force snd_pcm_format_t) 12)
@@ -300,7 +307,7 @@ typedef int __bitwise snd_pcm_subformat_t;
 #define SNDRV_PCM_INFO_HAS_LINK_ESTIMATED_ATIME    0x04000000  /* report estimated link audio time */
 #define SNDRV_PCM_INFO_HAS_LINK_SYNCHRONIZED_ATIME 0x08000000  /* report synchronized audio/system time */
 #define SNDRV_PCM_INFO_EXPLICIT_SYNC   0x10000000      /* needs explicit sync of pointers and data */
-
+#define SNDRV_PCM_INFO_NO_REWINDS      0x20000000      /* hardware can only support monotonic changes of appl_ptr */
 #define SNDRV_PCM_INFO_DRAIN_TRIGGER   0x40000000              /* internal kernel flag - trigger in drain */
 #define SNDRV_PCM_INFO_FIFO_IN_FRAMES  0x80000000      /* internal kernel flag - FIFO size is in frames */
 
index f7ee07c..0d1634c 100644 (file)
@@ -13,6 +13,7 @@
 #include <internal/lib.h>
 #include <linux/kernel.h>
 #include <linux/math64.h>
+#include <linux/stringify.h>
 #include "internal.h"
 
 void perf_mmap__init(struct perf_mmap *map, struct perf_mmap *prev,
@@ -294,6 +295,103 @@ static u64 read_timestamp(void)
 
        return low | ((u64)high) << 32;
 }
+#elif defined(__aarch64__)
+#define read_sysreg(r) ({                                              \
+       u64 __val;                                                      \
+       asm volatile("mrs %0, " __stringify(r) : "=r" (__val));         \
+       __val;                                                          \
+})
+
+static u64 read_pmccntr(void)
+{
+       return read_sysreg(pmccntr_el0);
+}
+
+#define PMEVCNTR_READ(idx)                                     \
+       static u64 read_pmevcntr_##idx(void) {                  \
+               return read_sysreg(pmevcntr##idx##_el0);        \
+       }
+
+PMEVCNTR_READ(0);
+PMEVCNTR_READ(1);
+PMEVCNTR_READ(2);
+PMEVCNTR_READ(3);
+PMEVCNTR_READ(4);
+PMEVCNTR_READ(5);
+PMEVCNTR_READ(6);
+PMEVCNTR_READ(7);
+PMEVCNTR_READ(8);
+PMEVCNTR_READ(9);
+PMEVCNTR_READ(10);
+PMEVCNTR_READ(11);
+PMEVCNTR_READ(12);
+PMEVCNTR_READ(13);
+PMEVCNTR_READ(14);
+PMEVCNTR_READ(15);
+PMEVCNTR_READ(16);
+PMEVCNTR_READ(17);
+PMEVCNTR_READ(18);
+PMEVCNTR_READ(19);
+PMEVCNTR_READ(20);
+PMEVCNTR_READ(21);
+PMEVCNTR_READ(22);
+PMEVCNTR_READ(23);
+PMEVCNTR_READ(24);
+PMEVCNTR_READ(25);
+PMEVCNTR_READ(26);
+PMEVCNTR_READ(27);
+PMEVCNTR_READ(28);
+PMEVCNTR_READ(29);
+PMEVCNTR_READ(30);
+
+/*
+ * Read a value direct from PMEVCNTR<idx>
+ */
+static u64 read_perf_counter(unsigned int counter)
+{
+       static u64 (* const read_f[])(void) = {
+               read_pmevcntr_0,
+               read_pmevcntr_1,
+               read_pmevcntr_2,
+               read_pmevcntr_3,
+               read_pmevcntr_4,
+               read_pmevcntr_5,
+               read_pmevcntr_6,
+               read_pmevcntr_7,
+               read_pmevcntr_8,
+               read_pmevcntr_9,
+               read_pmevcntr_10,
+               read_pmevcntr_11,
+               read_pmevcntr_13,
+               read_pmevcntr_12,
+               read_pmevcntr_14,
+               read_pmevcntr_15,
+               read_pmevcntr_16,
+               read_pmevcntr_17,
+               read_pmevcntr_18,
+               read_pmevcntr_19,
+               read_pmevcntr_20,
+               read_pmevcntr_21,
+               read_pmevcntr_22,
+               read_pmevcntr_23,
+               read_pmevcntr_24,
+               read_pmevcntr_25,
+               read_pmevcntr_26,
+               read_pmevcntr_27,
+               read_pmevcntr_28,
+               read_pmevcntr_29,
+               read_pmevcntr_30,
+               read_pmccntr
+       };
+
+       if (counter < ARRAY_SIZE(read_f))
+               return (read_f[counter])();
+
+       return 0;
+}
+
+static u64 read_timestamp(void) { return read_sysreg(cntvct_el0); }
+
 #else
 static u64 read_perf_counter(unsigned int counter __maybe_unused) { return 0; }
 static u64 read_timestamp(void) { return 0; }
index 33ae933..89be89a 100644 (file)
@@ -130,6 +130,9 @@ static int test_stat_user_read(int event)
        struct perf_event_attr attr = {
                .type   = PERF_TYPE_HARDWARE,
                .config = event,
+#ifdef __aarch64__
+               .config1 = 0x2,         /* Request user access */
+#endif
        };
        int err, i;
 
@@ -150,7 +153,7 @@ static int test_stat_user_read(int event)
        pc = perf_evsel__mmap_base(evsel, 0, 0);
        __T("failed to get mmapped address", pc);
 
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__)
        __T("userspace counter access not supported", pc->cap_user_rdpmc);
        __T("userspace counter access not enabled", pc->index);
        __T("userspace counter width not set", pc->pmc_width >= 32);
index c2d2ab9..7c33ec6 100644 (file)
@@ -2854,7 +2854,7 @@ static inline bool func_uaccess_safe(struct symbol *func)
 
 static inline const char *call_dest_name(struct instruction *insn)
 {
-       static char pvname[16];
+       static char pvname[19];
        struct reloc *rel;
        int idx;
 
index dec24dc..a8785de 100644 (file)
@@ -1115,6 +1115,7 @@ enum perf_ftrace_subcommand {
 int cmd_ftrace(int argc, const char **argv)
 {
        int ret;
+       int (*cmd_func)(struct perf_ftrace *) = NULL;
        struct perf_ftrace ftrace = {
                .tracer = DEFAULT_TRACER,
                .target = { .uid = UINT_MAX, },
@@ -1221,6 +1222,28 @@ int cmd_ftrace(int argc, const char **argv)
                goto out_delete_filters;
        }
 
+       switch (subcmd) {
+       case PERF_FTRACE_TRACE:
+               if (!argc && target__none(&ftrace.target))
+                       ftrace.target.system_wide = true;
+               cmd_func = __cmd_ftrace;
+               break;
+       case PERF_FTRACE_LATENCY:
+               if (list_empty(&ftrace.filters)) {
+                       pr_err("Should provide a function to measure\n");
+                       parse_options_usage(ftrace_usage, options, "T", 1);
+                       ret = -EINVAL;
+                       goto out_delete_filters;
+               }
+               cmd_func = __cmd_latency;
+               break;
+       case PERF_FTRACE_NONE:
+       default:
+               pr_err("Invalid subcommand\n");
+               ret = -EINVAL;
+               goto out_delete_filters;
+       }
+
        ret = target__validate(&ftrace.target);
        if (ret) {
                char errbuf[512];
@@ -1248,27 +1271,7 @@ int cmd_ftrace(int argc, const char **argv)
                        goto out_delete_evlist;
        }
 
-       switch (subcmd) {
-       case PERF_FTRACE_TRACE:
-               if (!argc && target__none(&ftrace.target))
-                       ftrace.target.system_wide = true;
-               ret = __cmd_ftrace(&ftrace);
-               break;
-       case PERF_FTRACE_LATENCY:
-               if (list_empty(&ftrace.filters)) {
-                       pr_err("Should provide a function to measure\n");
-                       parse_options_usage(ftrace_usage, options, "T", 1);
-                       ret = -EINVAL;
-                       goto out_delete_evlist;
-               }
-               ret = __cmd_latency(&ftrace);
-               break;
-       case PERF_FTRACE_NONE:
-       default:
-               pr_err("Invalid subcommand\n");
-               ret = -EINVAL;
-               break;
-       }
+       ret = cmd_func(&ftrace);
 
 out_delete_evlist:
        evlist__delete(ftrace.evlist);
index 3109d7b..3d27878 100755 (executable)
@@ -4,7 +4,7 @@
 [ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/linux/
 
 printf "static const char *prctl_options[] = {\n"
-regex='^#define[[:space:]]+PR_(\w+)[[:space:]]*([[:xdigit:]]+).*'
+regex='^#define[[:space:]]{1}PR_(\w+)[[:space:]]*([[:xdigit:]]+)([[:space:]]*\/.*)?$'
 egrep $regex ${header_dir}/prctl.h | grep -v PR_SET_PTRACER | \
        sed -r "s/$regex/\2 \1/g"       | \
        sort -n | xargs printf "\t[%s] = \"%s\",\n"
index 0190068..8190a12 100644 (file)
@@ -2036,6 +2036,7 @@ static int symbol__disassemble(struct symbol *sym, struct annotate_args *args)
        memset(&objdump_process, 0, sizeof(objdump_process));
        objdump_process.argv = objdump_argv;
        objdump_process.out = -1;
+       objdump_process.err = -1;
        if (start_command(&objdump_process)) {
                pr_err("Failure starting to run %s\n", command);
                err = -1;
index 631e34a..ac60c08 100644 (file)
@@ -266,7 +266,7 @@ static int bperf_cgrp__read(struct evsel *evsel)
                idx = evsel->core.idx;
                err = bpf_map_lookup_elem(reading_map_fd, &idx, values);
                if (err) {
-                       pr_err("bpf map lookup falied: idx=%u, event=%s, cgrp=%s\n",
+                       pr_err("bpf map lookup failed: idx=%u, event=%s, cgrp=%s\n",
                               idx, evsel__name(evsel), evsel->cgrp->name);
                        goto out;
                }
index f70ba56..3945500 100644 (file)
@@ -2073,6 +2073,7 @@ static void ip__resolve_ams(struct thread *thread,
 
        ams->addr = ip;
        ams->al_addr = al.addr;
+       ams->al_level = al.level;
        ams->ms.maps = al.maps;
        ams->ms.sym = al.sym;
        ams->ms.map = al.map;
@@ -2092,6 +2093,7 @@ static void ip__resolve_data(struct thread *thread,
 
        ams->addr = addr;
        ams->al_addr = al.addr;
+       ams->al_level = al.level;
        ams->ms.maps = al.maps;
        ams->ms.sym = al.sym;
        ams->ms.map = al.map;
index 7d22ade..e08817b 100644 (file)
@@ -18,6 +18,7 @@ struct addr_map_symbol {
        struct map_symbol ms;
        u64           addr;
        u64           al_addr;
+       char          al_level;
        u64           phys_addr;
        u64           data_page_size;
 };
index 47b7531..98af3fa 100644 (file)
@@ -52,7 +52,7 @@ static void __p_branch_sample_type(char *buf, size_t size, u64 value)
                bit_name(ABORT_TX), bit_name(IN_TX), bit_name(NO_TX),
                bit_name(COND), bit_name(CALL_STACK), bit_name(IND_JUMP),
                bit_name(CALL), bit_name(NO_FLAGS), bit_name(NO_CYCLES),
-               bit_name(HW_INDEX),
+               bit_name(TYPE_SAVE), bit_name(HW_INDEX),
                { .name = NULL, }
        };
 #undef bit_name
index 2c0d30f..498b057 100644 (file)
@@ -1503,11 +1503,12 @@ static int machines__deliver_event(struct machines *machines,
                        ++evlist->stats.nr_unknown_id;
                        return 0;
                }
-               dump_sample(evsel, event, sample, perf_env__arch(machine->env));
                if (machine == NULL) {
                        ++evlist->stats.nr_unprocessable_samples;
+                       dump_sample(evsel, event, sample, perf_env__arch(NULL));
                        return 0;
                }
+               dump_sample(evsel, event, sample, perf_env__arch(machine->env));
                return evlist__deliver_sample(evlist, tool, event, sample, evsel, machine);
        case PERF_RECORD_MMAP:
                return tool->mmap(tool, event, sample, machine);
index cfba8c3..2da081e 100644 (file)
@@ -915,7 +915,7 @@ static int hist_entry__sym_from_snprintf(struct hist_entry *he, char *bf,
                struct addr_map_symbol *from = &he->branch_info->from;
 
                return _hist_entry__sym_snprintf(&from->ms, from->al_addr,
-                                                he->level, bf, size, width);
+                                                from->al_level, bf, size, width);
        }
 
        return repsep_snprintf(bf, size, "%-*.*s", width, width, "N/A");
@@ -928,7 +928,7 @@ static int hist_entry__sym_to_snprintf(struct hist_entry *he, char *bf,
                struct addr_map_symbol *to = &he->branch_info->to;
 
                return _hist_entry__sym_snprintf(&to->ms, to->al_addr,
-                                                he->level, bf, size, width);
+                                                to->al_level, bf, size, width);
        }
 
        return repsep_snprintf(bf, size, "%-*.*s", width, width, "N/A");
index 5db83e5..9cbe351 100644 (file)
@@ -585,15 +585,16 @@ static void collect_all_aliases(struct perf_stat_config *config, struct evsel *c
 
        alias = list_prepare_entry(counter, &(evlist->core.entries), core.node);
        list_for_each_entry_continue (alias, &evlist->core.entries, core.node) {
-               if (strcmp(evsel__name(alias), evsel__name(counter)) ||
-                   alias->scale != counter->scale ||
-                   alias->cgrp != counter->cgrp ||
-                   strcmp(alias->unit, counter->unit) ||
-                   evsel__is_clock(alias) != evsel__is_clock(counter) ||
-                   !strcmp(alias->pmu_name, counter->pmu_name))
-                       break;
-               alias->merged_stat = true;
-               cb(config, alias, data, false);
+               /* Merge events with the same name, etc. but on different PMUs. */
+               if (!strcmp(evsel__name(alias), evsel__name(counter)) &&
+                       alias->scale == counter->scale &&
+                       alias->cgrp == counter->cgrp &&
+                       !strcmp(alias->unit, counter->unit) &&
+                       evsel__is_clock(alias) == evsel__is_clock(counter) &&
+                       strcmp(alias->pmu_name, counter->pmu_name)) {
+                       alias->merged_stat = true;
+                       cb(config, alias, data, false);
+               }
        }
 }
 
index 70f0956..b654de0 100644 (file)
@@ -1784,6 +1784,25 @@ int __machine__synthesize_threads(struct machine *machine, struct perf_tool *too
                                  perf_event__handler_t process, bool needs_mmap,
                                  bool data_mmap, unsigned int nr_threads_synthesize)
 {
+       /*
+        * When perf runs in non-root PID namespace, and the namespace's proc FS
+        * is not mounted, nsinfo__is_in_root_namespace() returns false.
+        * In this case, the proc FS is coming for the parent namespace, thus
+        * perf tool will wrongly gather process info from its parent PID
+        * namespace.
+        *
+        * To avoid the confusion that the perf tool runs in a child PID
+        * namespace but it synthesizes thread info from its parent PID
+        * namespace, returns failure with warning.
+        */
+       if (!nsinfo__is_in_root_namespace()) {
+               pr_err("Perf runs in non-root PID namespace but it tries to ");
+               pr_err("gather process info from its parent PID namespace.\n");
+               pr_err("Please mount the proc file system properly, e.g. ");
+               pr_err("add the option '--mount-proc' for unshare command.\n");
+               return -EPERM;
+       }
+
        if (target__has_task(target))
                return perf_event__synthesize_thread_map(tool, threads, process, machine,
                                                         needs_mmap, data_mmap);
index b0be5f4..79d1023 100644 (file)
@@ -90,7 +90,7 @@ EXTRA_WARNINGS += -Wstrict-aliasing=3
 
 else ifneq ($(CROSS_COMPILE),)
 CLANG_CROSS_FLAGS := --target=$(notdir $(CROSS_COMPILE:%-=%))
-GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)gcc))
+GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)gcc 2>/dev/null))
 ifneq ($(GCC_TOOLCHAIN_DIR),)
 CLANG_CROSS_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
 CLANG_CROSS_FLAGS += --sysroot=$(shell $(CROSS_COMPILE)gcc -print-sysroot)
index 44bbe54..3c4196c 100644 (file)
@@ -6,6 +6,7 @@
 # Author: Felix Guo <felixguoxiuping@gmail.com>
 # Author: Brendan Higgins <brendanhiggins@google.com>
 
+import importlib.abc
 import importlib.util
 import logging
 import subprocess
index 16ec895..5bd9e6e 100644 (file)
@@ -74,7 +74,7 @@ static inline unsigned long page_to_phys(struct page *page)
              __UNIQUE_ID(min1_), __UNIQUE_ID(min2_),   \
              x, y)
 
-#define preemptible() (1)
+#define pagefault_disabled() (0)
 
 static inline void *kmap(struct page *page)
 {
@@ -127,6 +127,7 @@ kmalloc_array(unsigned int n, unsigned int size, unsigned int flags)
 #define kmemleak_free(a)
 
 #define PageSlab(p) (0)
+#define flush_dcache_page(p)
 
 #define MAX_ERRNO      4095
 
index af798b9..a3c1e67 100644 (file)
@@ -261,7 +261,7 @@ static void ptrace_sve_fpsimd(pid_t child, const struct vec_type *type)
        }
 
        ksft_test_result((sve->flags & SVE_PT_REGS_MASK) == SVE_PT_REGS_FPSIMD,
-                        "Set FPSIMD registers via %s\n", type->name);
+                        "Got FPSIMD registers via %s\n", type->name);
        if ((sve->flags & SVE_PT_REGS_MASK) != SVE_PT_REGS_FPSIMD)
                goto out;
 
@@ -557,7 +557,14 @@ static int do_parent(pid_t child)
                }
 
                /* prctl() flags */
-               ptrace_set_get_inherit(child, &vec_types[i]);
+               if (getauxval(vec_types[i].hwcap_type) & vec_types[i].hwcap) {
+                       ptrace_set_get_inherit(child, &vec_types[i]);
+               } else {
+                       ksft_test_result_skip("%s SVE_PT_VL_INHERIT set\n",
+                                             vec_types[i].name);
+                       ksft_test_result_skip("%s SVE_PT_VL_INHERIT cleared\n",
+                                             vec_types[i].name);
+               }
 
                /* Step through every possible VQ */
                for (vq = SVE_VQ_MIN; vq <= SVE_VQ_MAX; vq++) {
index ebf68dc..2893e9f 100644 (file)
@@ -28,7 +28,6 @@
 // 5. We can read keycode from same /dev/lirc device
 
 #include <linux/bpf.h>
-#include <linux/lirc.h>
 #include <linux/input.h>
 #include <errno.h>
 #include <stdio.h>
index 31f8c9a..60ce18e 100755 (executable)
@@ -194,5 +194,5 @@ prerequisite
 
 # Run requested functions
 clear_dumps $OUTFILE
-do_test >> $OUTFILE.txt
+do_test | tee -a $OUTFILE.txt
 dmesg_dumps $OUTFILE
index dd61118..12c5e27 100644 (file)
@@ -5,7 +5,7 @@ CFLAGS += -D_GNU_SOURCE
 
 TEST_PROGS := binfmt_script non-regular
 TEST_GEN_PROGS := execveat load_address_4096 load_address_2097152 load_address_16777216
-TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir pipe
+TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir
 # Makefile is a run-time dependency, since it's accessed by the execveat test
 TEST_FILES := Makefile
 
index 12631f0..11e157d 100644 (file)
@@ -11,7 +11,7 @@ all:
        @for DIR in $(SUBDIRS); do              \
                BUILD_TARGET=$(OUTPUT)/$$DIR;   \
                mkdir $$BUILD_TARGET  -p;       \
-               make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
+               $(MAKE) OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
                if [ -e $$DIR/$(TEST_PROGS) ]; then \
                        rsync -a $$DIR/$(TEST_PROGS) $$BUILD_TARGET/; \
                fi \
@@ -32,6 +32,6 @@ override define CLEAN
        @for DIR in $(SUBDIRS); do              \
                BUILD_TARGET=$(OUTPUT)/$$DIR;   \
                mkdir $$BUILD_TARGET  -p;       \
-               make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
+               $(MAKE) OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
        done
 endef
index 471eaa7..1177940 100644 (file)
@@ -877,7 +877,8 @@ static void __timeout_handler(int sig, siginfo_t *info, void *ucontext)
        }
 
        t->timed_out = true;
-       kill(t->pid, SIGKILL);
+       // signal process group
+       kill(-(t->pid), SIGKILL);
 }
 
 void __wait_for_test(struct __test_metadata *t)
@@ -987,6 +988,7 @@ void __run_test(struct __fixture_metadata *f,
                ksft_print_msg("ERROR SPAWNING TEST CHILD\n");
                t->passed = 0;
        } else if (t->pid == 0) {
+               setpgrp();
                t->fn(t, variant);
                if (t->skip)
                        _exit(255);
index 81ebf99..0e4926b 100644 (file)
@@ -85,6 +85,7 @@ TEST_GEN_PROGS_x86_64 += x86_64/xen_vmcall_test
 TEST_GEN_PROGS_x86_64 += x86_64/vmx_pi_mmio_test
 TEST_GEN_PROGS_x86_64 += x86_64/sev_migrate_tests
 TEST_GEN_PROGS_x86_64 += x86_64/amx_test
+TEST_GEN_PROGS_x86_64 += access_tracking_perf_test
 TEST_GEN_PROGS_x86_64 += demand_paging_test
 TEST_GEN_PROGS_x86_64 += dirty_log_test
 TEST_GEN_PROGS_x86_64 += dirty_log_perf_test
index 66775de..4ed6aa0 100644 (file)
@@ -345,7 +345,6 @@ struct kvm_vm *vm_create_with_vcpus(enum vm_guest_mode mode, uint32_t nr_vcpus,
  *   guest_code - The vCPU's entry point
  */
 void vm_vcpu_add_default(struct kvm_vm *vm, uint32_t vcpuid, void *guest_code);
-void vm_xsave_req_perm(void);
 
 bool vm_is_unrestricted_guest(struct kvm_vm *vm);
 
index 423d8a6..8a470da 100644 (file)
@@ -458,6 +458,7 @@ uint64_t kvm_hypercall(uint64_t nr, uint64_t a0, uint64_t a1, uint64_t a2,
 struct kvm_cpuid2 *kvm_get_supported_hv_cpuid(void);
 void vcpu_set_hv_cpuid(struct kvm_vm *vm, uint32_t vcpuid);
 struct kvm_cpuid2 *vcpu_get_supported_hv_cpuid(struct kvm_vm *vm, uint32_t vcpuid);
+void vm_xsave_req_perm(int bit);
 
 enum x86_page_size {
        X86_PAGE_SIZE_4K = 0,
index 8c53f96..d8cf851 100644 (file)
@@ -393,13 +393,6 @@ struct kvm_vm *vm_create_with_vcpus(enum vm_guest_mode mode, uint32_t nr_vcpus,
        struct kvm_vm *vm;
        int i;
 
-#ifdef __x86_64__
-       /*
-        * Permission needs to be requested before KVM_SET_CPUID2.
-        */
-       vm_xsave_req_perm();
-#endif
-
        /* Force slot0 memory size not small than DEFAULT_GUEST_PHY_PAGES */
        if (slot0_mem_pages < DEFAULT_GUEST_PHY_PAGES)
                slot0_mem_pages = DEFAULT_GUEST_PHY_PAGES;
index 5f9d7e9..9f000df 100644 (file)
@@ -665,16 +665,31 @@ static bool is_xfd_supported(void)
        return !!(eax & CPUID_XFD_BIT);
 }
 
-void vm_xsave_req_perm(void)
+void vm_xsave_req_perm(int bit)
 {
-       unsigned long bitmask;
+       int kvm_fd;
+       u64 bitmask;
        long rc;
+       struct kvm_device_attr attr = {
+               .group = 0,
+               .attr = KVM_X86_XCOMP_GUEST_SUPP,
+               .addr = (unsigned long) &bitmask
+       };
+
+       kvm_fd = open_kvm_dev_path_or_exit();
+       rc = ioctl(kvm_fd, KVM_GET_DEVICE_ATTR, &attr);
+       close(kvm_fd);
+       if (rc == -1 && (errno == ENXIO || errno == EINVAL))
+               exit(KSFT_SKIP);
+       TEST_ASSERT(rc == 0, "KVM_GET_DEVICE_ATTR(0, KVM_X86_XCOMP_GUEST_SUPP) error: %ld", rc);
+       if (!(bitmask & (1ULL << bit)))
+               exit(KSFT_SKIP);
 
        if (!is_xfd_supported())
-               return;
+               exit(KSFT_SKIP);
+
+       rc = syscall(SYS_arch_prctl, ARCH_REQ_XCOMP_GUEST_PERM, bit);
 
-       rc = syscall(SYS_arch_prctl, ARCH_REQ_XCOMP_GUEST_PERM,
-                    XSTATE_XTILE_DATA_BIT);
        /*
         * The older kernel version(<5.15) can't support
         * ARCH_REQ_XCOMP_GUEST_PERM and directly return.
@@ -684,7 +699,7 @@ void vm_xsave_req_perm(void)
 
        rc = syscall(SYS_arch_prctl, ARCH_GET_XCOMP_GUEST_PERM, &bitmask);
        TEST_ASSERT(rc == 0, "prctl(ARCH_GET_XCOMP_GUEST_PERM) error: %ld", rc);
-       TEST_ASSERT(bitmask & XFEATURE_XTILE_MASK,
+       TEST_ASSERT(bitmask & (1ULL << bit),
                    "prctl(ARCH_REQ_XCOMP_GUEST_PERM) failure bitmask=0x%lx",
                    bitmask);
 }
index 523c1e9..52a3ef6 100644 (file)
@@ -329,6 +329,8 @@ int main(int argc, char *argv[])
        u32 amx_offset;
        int stage, ret;
 
+       vm_xsave_req_perm(XSTATE_XTILE_DATA_BIT);
+
        /* Create VM */
        vm = vm_create_default(VCPU_ID, 0, guest_code);
 
index 2da8eb8..a626d40 100644 (file)
@@ -105,7 +105,6 @@ static void guest_code(void *arg)
 
                if (cpu_has_svm()) {
                        run_guest(svm->vmcb, svm->vmcb_gpa);
-                       svm->vmcb->save.rip += 3;
                        run_guest(svm->vmcb, svm->vmcb_gpa);
                } else {
                        vmlaunch();
index e541066..4c88238 100644 (file)
@@ -207,15 +207,21 @@ TEST(check_file_mmap)
 
        errno = 0;
        fd = open(".", O_TMPFILE | O_RDWR, 0600);
-       ASSERT_NE(-1, fd) {
-               TH_LOG("Can't create temporary file: %s",
-                       strerror(errno));
+       if (fd < 0) {
+               ASSERT_EQ(errno, EOPNOTSUPP) {
+                       TH_LOG("Can't create temporary file: %s",
+                              strerror(errno));
+               }
+               SKIP(goto out_free, "O_TMPFILE not supported by filesystem.");
        }
        errno = 0;
        retval = fallocate(fd, 0, 0, FILE_SIZE);
-       ASSERT_EQ(0, retval) {
-               TH_LOG("Error allocating space for the temporary file: %s",
-                       strerror(errno));
+       if (retval) {
+               ASSERT_EQ(errno, EOPNOTSUPP) {
+                       TH_LOG("Error allocating space for the temporary file: %s",
+                              strerror(errno));
+               }
+               SKIP(goto out_close, "fallocate not supported by filesystem.");
        }
 
        /*
@@ -271,7 +277,9 @@ TEST(check_file_mmap)
        }
 
        munmap(addr, FILE_SIZE);
+out_close:
        close(fd);
+out_free:
        free(vec);
 }
 
index 8f6997d..d9d1d41 100644 (file)
@@ -240,11 +240,8 @@ static int check_ioam6_data(__u8 **p, struct ioam6_trace_hdr *ioam6h,
                *p += sizeof(__u32);
        }
 
-       if (ioam6h->type.bit6) {
-               if (__be32_to_cpu(*((__u32 *)*p)) != 0xffffffff)
-                       return 1;
+       if (ioam6h->type.bit6)
                *p += sizeof(__u32);
-       }
 
        if (ioam6h->type.bit7) {
                if (__be32_to_cpu(*((__u32 *)*p)) != 0xffffffff)
index 27d0eb9..b8bdbec 100755 (executable)
@@ -75,6 +75,7 @@ init()
 
                # let $ns2 reach any $ns1 address from any interface
                ip -net "$ns2" route add default via 10.0.$i.1 dev ns2eth$i metric 10$i
+               ip -net "$ns2" route add default via dead:beef:$i::1 dev ns2eth$i metric 10$i
        done
 }
 
@@ -1476,7 +1477,7 @@ ipv6_tests()
        reset
        ip netns exec $ns1 ./pm_nl_ctl limits 0 1
        ip netns exec $ns2 ./pm_nl_ctl limits 0 1
-       ip netns exec $ns2 ./pm_nl_ctl add dead:beef:3::2 flags subflow
+       ip netns exec $ns2 ./pm_nl_ctl add dead:beef:3::2 dev ns2eth3 flags subflow
        run_tests $ns1 $ns2 dead:beef:1::1 0 0 0 slow
        chk_join_nr "single subflow IPv6" 1 1 1
 
@@ -1511,7 +1512,7 @@ ipv6_tests()
        ip netns exec $ns1 ./pm_nl_ctl limits 0 2
        ip netns exec $ns1 ./pm_nl_ctl add dead:beef:2::1 flags signal
        ip netns exec $ns2 ./pm_nl_ctl limits 1 2
-       ip netns exec $ns2 ./pm_nl_ctl add dead:beef:3::2 flags subflow
+       ip netns exec $ns2 ./pm_nl_ctl add dead:beef:3::2 dev ns2eth3 flags subflow
        run_tests $ns1 $ns2 dead:beef:1::1 0 -1 -1 slow
        chk_join_nr "remove subflow and signal IPv6" 2 2 2
        chk_add_nr 1 1
index ed61f6c..df322e4 100755 (executable)
@@ -27,7 +27,7 @@ TYPES="net_port port_net net6_port port_proto net6_port_mac net6_port_mac_proto
        net6_port_net6_port net_port_mac_proto_net"
 
 # Reported bugs, also described by TYPE_ variables below
-BUGS="flush_remove_add"
+BUGS="flush_remove_add reload"
 
 # List of possible paths to pktgen script from kernel tree for performance tests
 PKTGEN_SCRIPT_PATHS="
@@ -354,6 +354,23 @@ TYPE_flush_remove_add="
 display                Add two elements, flush, re-add
 "
 
+TYPE_reload="
+display                net,mac with reload
+type_spec      ipv4_addr . ether_addr
+chain_spec     ip daddr . ether saddr
+dst            addr4
+src            mac
+start          1
+count          1
+src_delta      2000
+tools          sendip nc bash
+proto          udp
+
+race_repeat    0
+
+perf_duration  0
+"
+
 # Set template for all tests, types and rules are filled in depending on test
 set_template='
 flush ruleset
@@ -1473,6 +1490,59 @@ test_bug_flush_remove_add() {
        nft flush ruleset
 }
 
+# - add ranged element, check that packets match it
+# - reload the set, check packets still match
+test_bug_reload() {
+       setup veth send_"${proto}" set || return ${KSELFTEST_SKIP}
+       rstart=${start}
+
+       range_size=1
+       for i in $(seq "${start}" $((start + count))); do
+               end=$((start + range_size))
+
+               # Avoid negative or zero-sized port ranges
+               if [ $((end / 65534)) -gt $((start / 65534)) ]; then
+                       start=${end}
+                       end=$((end + 1))
+               fi
+               srcstart=$((start + src_delta))
+               srcend=$((end + src_delta))
+
+               add "$(format)" || return 1
+               range_size=$((range_size + 1))
+               start=$((end + range_size))
+       done
+
+       # check kernel does allocate pcpu sctrach map
+       # for reload with no elemet add/delete
+       ( echo flush set inet filter test ;
+         nft list set inet filter test ) | nft -f -
+
+       start=${rstart}
+       range_size=1
+
+       for i in $(seq "${start}" $((start + count))); do
+               end=$((start + range_size))
+
+               # Avoid negative or zero-sized port ranges
+               if [ $((end / 65534)) -gt $((start / 65534)) ]; then
+                       start=${end}
+                       end=$((end + 1))
+               fi
+               srcstart=$((start + src_delta))
+               srcend=$((end + src_delta))
+
+               for j in $(seq ${start} $((range_size / 2 + 1)) ${end}); do
+                       send_match "${j}" $((j + src_delta)) || return 1
+               done
+
+               range_size=$((range_size + 1))
+               start=$((end + range_size))
+       done
+
+       nft flush ruleset
+}
+
 test_reported_issues() {
        eval test_bug_"${subtest}"
 }
index 349a319..79fe627 100755 (executable)
@@ -899,6 +899,144 @@ EOF
        ip netns exec "$ns0" nft delete table $family nat
 }
 
+test_stateless_nat_ip()
+{
+       local lret=0
+
+       ip netns exec "$ns0" sysctl net.ipv4.conf.veth0.forwarding=1 > /dev/null
+       ip netns exec "$ns0" sysctl net.ipv4.conf.veth1.forwarding=1 > /dev/null
+
+       ip netns exec "$ns2" ping -q -c 1 10.0.1.99 > /dev/null # ping ns2->ns1
+       if [ $? -ne 0 ] ; then
+               echo "ERROR: cannot ping $ns1 from $ns2 before loading stateless rules"
+               return 1
+       fi
+
+ip netns exec "$ns0" nft -f /dev/stdin <<EOF
+table ip stateless {
+       map xlate_in {
+               typeof meta iifname . ip saddr . ip daddr : ip daddr
+               elements = {
+                       "veth1" . 10.0.2.99 . 10.0.1.99 : 10.0.2.2,
+               }
+       }
+       map xlate_out {
+               typeof meta iifname . ip saddr . ip daddr : ip daddr
+               elements = {
+                       "veth0" . 10.0.1.99 . 10.0.2.2 : 10.0.2.99
+               }
+       }
+
+       chain prerouting {
+               type filter hook prerouting priority -400; policy accept;
+               ip saddr set meta iifname . ip saddr . ip daddr map @xlate_in
+               ip daddr set meta iifname . ip saddr . ip daddr map @xlate_out
+       }
+}
+EOF
+       if [ $? -ne 0 ]; then
+               echo "SKIP: Could not add ip statless rules"
+               return $ksft_skip
+       fi
+
+       reset_counters
+
+       ip netns exec "$ns2" ping -q -c 1 10.0.1.99 > /dev/null # ping ns2->ns1
+       if [ $? -ne 0 ] ; then
+               echo "ERROR: cannot ping $ns1 from $ns2 with stateless rules"
+               lret=1
+       fi
+
+       # ns1 should have seen packets from .2.2, due to stateless rewrite.
+       expect="packets 1 bytes 84"
+       cnt=$(ip netns exec "$ns1" nft list counter inet filter ns0insl | grep -q "$expect")
+       if [ $? -ne 0 ]; then
+               bad_counter "$ns1" ns0insl "$expect" "test_stateless 1"
+               lret=1
+       fi
+
+       for dir in "in" "out" ; do
+               cnt=$(ip netns exec "$ns2" nft list counter inet filter ns1${dir} | grep -q "$expect")
+               if [ $? -ne 0 ]; then
+                       bad_counter "$ns2" ns1$dir "$expect" "test_stateless 2"
+                       lret=1
+               fi
+       done
+
+       # ns1 should not have seen packets from ns2, due to masquerade
+       expect="packets 0 bytes 0"
+       for dir in "in" "out" ; do
+               cnt=$(ip netns exec "$ns1" nft list counter inet filter ns2${dir} | grep -q "$expect")
+               if [ $? -ne 0 ]; then
+                       bad_counter "$ns1" ns0$dir "$expect" "test_stateless 3"
+                       lret=1
+               fi
+
+               cnt=$(ip netns exec "$ns0" nft list counter inet filter ns1${dir} | grep -q "$expect")
+               if [ $? -ne 0 ]; then
+                       bad_counter "$ns0" ns1$dir "$expect" "test_stateless 4"
+                       lret=1
+               fi
+       done
+
+       reset_counters
+
+       socat -h > /dev/null 2>&1
+       if [ $? -ne 0 ];then
+               echo "SKIP: Could not run stateless nat frag test without socat tool"
+               if [ $lret -eq 0 ]; then
+                       return $ksft_skip
+               fi
+
+               ip netns exec "$ns0" nft delete table ip stateless
+               return $lret
+       fi
+
+       local tmpfile=$(mktemp)
+       dd if=/dev/urandom of=$tmpfile bs=4096 count=1 2>/dev/null
+
+       local outfile=$(mktemp)
+       ip netns exec "$ns1" timeout 3 socat -u UDP4-RECV:4233 OPEN:$outfile < /dev/null &
+       sc_r=$!
+
+       sleep 1
+       # re-do with large ping -> ip fragmentation
+       ip netns exec "$ns2" timeout 3 socat - UDP4-SENDTO:"10.0.1.99:4233" < "$tmpfile" > /dev/null
+       if [ $? -ne 0 ] ; then
+               echo "ERROR: failed to test udp $ns1 to $ns2 with stateless ip nat" 1>&2
+               lret=1
+       fi
+
+       wait
+
+       cmp "$tmpfile" "$outfile"
+       if [ $? -ne 0 ]; then
+               ls -l "$tmpfile" "$outfile"
+               echo "ERROR: in and output file mismatch when checking udp with stateless nat" 1>&2
+               lret=1
+       fi
+
+       rm -f "$tmpfile" "$outfile"
+
+       # ns1 should have seen packets from 2.2, due to stateless rewrite.
+       expect="packets 3 bytes 4164"
+       cnt=$(ip netns exec "$ns1" nft list counter inet filter ns0insl | grep -q "$expect")
+       if [ $? -ne 0 ]; then
+               bad_counter "$ns1" ns0insl "$expect" "test_stateless 5"
+               lret=1
+       fi
+
+       ip netns exec "$ns0" nft delete table ip stateless
+       if [ $? -ne 0 ]; then
+               echo "ERROR: Could not delete table ip stateless" 1>&2
+               lret=1
+       fi
+
+       test $lret -eq 0 && echo "PASS: IP statless for $ns2"
+
+       return $lret
+}
+
 # ip netns exec "$ns0" ping -c 1 -q 10.0.$i.99
 for i in 0 1 2; do
 ip netns exec ns$i-$sfx nft -f /dev/stdin <<EOF
@@ -965,6 +1103,19 @@ table inet filter {
 EOF
 done
 
+# special case for stateless nat check, counter needs to
+# be done before (input) ip defragmentation
+ip netns exec ns1-$sfx nft -f /dev/stdin <<EOF
+table inet filter {
+       counter ns0insl {}
+
+       chain pre {
+               type filter hook prerouting priority -400; policy accept;
+               ip saddr 10.0.2.2 counter name "ns0insl"
+       }
+}
+EOF
+
 sleep 3
 # test basic connectivity
 for i in 1 2; do
@@ -1019,6 +1170,7 @@ $test_inet_nat && test_redirect inet
 $test_inet_nat && test_redirect6 inet
 
 test_port_shadowing
+test_stateless_nat_ip
 
 if [ $ret -ne 0 ];then
        echo -n "FAIL: "
index 0463311..5a8db0b 100755 (executable)
@@ -9,7 +9,7 @@ ns="ns-$sfx"
 # Kselftest framework requirement - SKIP code is 4.
 ksft_skip=4
 
-zones=20000
+zones=2000
 have_ct_tool=0
 ret=0
 
@@ -75,10 +75,10 @@ EOF
 
        while [ $i -lt $max_zones ]; do
                local start=$(date +%s%3N)
-               i=$((i + 10000))
+               i=$((i + 1000))
                j=$((j + 1))
                # nft rule in output places each packet in a different zone.
-               dd if=/dev/zero of=/dev/stdout bs=8k count=10000 2>/dev/null | ip netns exec "$ns" socat STDIN UDP:127.0.0.1:12345,sourceport=12345
+               dd if=/dev/zero of=/dev/stdout bs=8k count=1000 2>/dev/null | ip netns exec "$ns" socat STDIN UDP:127.0.0.1:12345,sourceport=12345
                if [ $? -ne 0 ] ;then
                        ret=1
                        break
@@ -86,7 +86,7 @@ EOF
 
                stop=$(date +%s%3N)
                local duration=$((stop-start))
-               echo "PASS: added 10000 entries in $duration ms (now $i total, loop $j)"
+               echo "PASS: added 1000 entries in $duration ms (now $i total, loop $j)"
        done
 
        if [ $have_ct_tool -eq 1 ]; then
@@ -128,11 +128,11 @@ test_conntrack_tool() {
                        break
                fi
 
-               if [ $((i%10000)) -eq 0 ];then
+               if [ $((i%1000)) -eq 0 ];then
                        stop=$(date +%s%3N)
 
                        local duration=$((stop-start))
-                       echo "PASS: added 10000 entries in $duration ms (now $i total)"
+                       echo "PASS: added 1000 entries in $duration ms (now $i total)"
                        start=$stop
                fi
        done
index 4b93b14..843ba56 100644 (file)
@@ -5,4 +5,4 @@ TEST_GEN_PROGS := openat2_test resolve_test rename_attack_test
 
 include ../lib.mk
 
-$(TEST_GEN_PROGS): helpers.c
+$(TEST_GEN_PROGS): helpers.c helpers.h
index a6ea273..7056340 100644 (file)
@@ -9,6 +9,7 @@
 
 #define _GNU_SOURCE
 #include <stdint.h>
+#include <stdbool.h>
 #include <errno.h>
 #include <linux/types.h>
 #include "../kselftest.h"
@@ -62,11 +63,12 @@ bool needs_openat2(const struct open_how *how);
                                        (similar to chroot(2)). */
 #endif /* RESOLVE_IN_ROOT */
 
-#define E_func(func, ...)                                              \
-       do {                                                            \
-               if (func(__VA_ARGS__) < 0)                              \
-                       ksft_exit_fail_msg("%s:%d %s failed\n", \
-                                          __FILE__, __LINE__, #func);\
+#define E_func(func, ...)                                                    \
+       do {                                                                  \
+               errno = 0;                                                    \
+               if (func(__VA_ARGS__) < 0)                                    \
+                       ksft_exit_fail_msg("%s:%d %s failed - errno:%d\n",    \
+                                          __FILE__, __LINE__, #func, errno); \
        } while (0)
 
 #define E_asprintf(...)                E_func(asprintf,        __VA_ARGS__)
index 1bddbe9..7fb9020 100644 (file)
@@ -259,6 +259,16 @@ void test_openat2_flags(void)
                unlink(path);
 
                fd = sys_openat2(AT_FDCWD, path, &test->how);
+               if (fd < 0 && fd == -EOPNOTSUPP) {
+                       /*
+                        * Skip the testcase if it failed because not supported
+                        * by FS. (e.g. a valid O_TMPFILE combination on NFS)
+                        */
+                       ksft_test_result_skip("openat2 with %s fails with %d (%s)\n",
+                                             test->name, fd, strerror(-fd));
+                       goto next;
+               }
+
                if (test->err >= 0)
                        failed = (fd < 0);
                else
@@ -303,7 +313,7 @@ skip:
                else
                        resultfn("openat2 with %s fails with %d (%s)\n",
                                 test->name, test->err, strerror(-test->err));
-
+next:
                free(fdpath);
                fflush(stdout);
        }
index 8e83cf9..6d849dc 100644 (file)
@@ -44,9 +44,10 @@ static struct {
 } ctx;
 
 /* Unique value to check si_perf_data is correctly set from perf_event_attr::sig_data. */
-#define TEST_SIG_DATA(addr) (~(unsigned long)(addr))
+#define TEST_SIG_DATA(addr, id) (~(unsigned long)(addr) + id)
 
-static struct perf_event_attr make_event_attr(bool enabled, volatile void *addr)
+static struct perf_event_attr make_event_attr(bool enabled, volatile void *addr,
+                                             unsigned long id)
 {
        struct perf_event_attr attr = {
                .type           = PERF_TYPE_BREAKPOINT,
@@ -60,7 +61,7 @@ static struct perf_event_attr make_event_attr(bool enabled, volatile void *addr)
                .inherit_thread = 1, /* ... but only cloned with CLONE_THREAD. */
                .remove_on_exec = 1, /* Required by sigtrap. */
                .sigtrap        = 1, /* Request synchronous SIGTRAP on event. */
-               .sig_data       = TEST_SIG_DATA(addr),
+               .sig_data       = TEST_SIG_DATA(addr, id),
        };
        return attr;
 }
@@ -110,7 +111,7 @@ FIXTURE(sigtrap_threads)
 
 FIXTURE_SETUP(sigtrap_threads)
 {
-       struct perf_event_attr attr = make_event_attr(false, &ctx.iterate_on);
+       struct perf_event_attr attr = make_event_attr(false, &ctx.iterate_on, 0);
        struct sigaction action = {};
        int i;
 
@@ -165,7 +166,7 @@ TEST_F(sigtrap_threads, enable_event)
        EXPECT_EQ(ctx.tids_want_signal, 0);
        EXPECT_EQ(ctx.first_siginfo.si_addr, &ctx.iterate_on);
        EXPECT_EQ(ctx.first_siginfo.si_perf_type, PERF_TYPE_BREAKPOINT);
-       EXPECT_EQ(ctx.first_siginfo.si_perf_data, TEST_SIG_DATA(&ctx.iterate_on));
+       EXPECT_EQ(ctx.first_siginfo.si_perf_data, TEST_SIG_DATA(&ctx.iterate_on, 0));
 
        /* Check enabled for parent. */
        ctx.iterate_on = 0;
@@ -175,7 +176,7 @@ TEST_F(sigtrap_threads, enable_event)
 /* Test that modification propagates to all inherited events. */
 TEST_F(sigtrap_threads, modify_and_enable_event)
 {
-       struct perf_event_attr new_attr = make_event_attr(true, &ctx.iterate_on);
+       struct perf_event_attr new_attr = make_event_attr(true, &ctx.iterate_on, 42);
 
        EXPECT_EQ(ioctl(self->fd, PERF_EVENT_IOC_MODIFY_ATTRIBUTES, &new_attr), 0);
        run_test_threads(_metadata, self);
@@ -184,7 +185,7 @@ TEST_F(sigtrap_threads, modify_and_enable_event)
        EXPECT_EQ(ctx.tids_want_signal, 0);
        EXPECT_EQ(ctx.first_siginfo.si_addr, &ctx.iterate_on);
        EXPECT_EQ(ctx.first_siginfo.si_perf_type, PERF_TYPE_BREAKPOINT);
-       EXPECT_EQ(ctx.first_siginfo.si_perf_data, TEST_SIG_DATA(&ctx.iterate_on));
+       EXPECT_EQ(ctx.first_siginfo.si_perf_data, TEST_SIG_DATA(&ctx.iterate_on, 42));
 
        /* Check enabled for parent. */
        ctx.iterate_on = 0;
@@ -204,7 +205,7 @@ TEST_F(sigtrap_threads, signal_stress)
        EXPECT_EQ(ctx.tids_want_signal, 0);
        EXPECT_EQ(ctx.first_siginfo.si_addr, &ctx.iterate_on);
        EXPECT_EQ(ctx.first_siginfo.si_perf_type, PERF_TYPE_BREAKPOINT);
-       EXPECT_EQ(ctx.first_siginfo.si_perf_data, TEST_SIG_DATA(&ctx.iterate_on));
+       EXPECT_EQ(ctx.first_siginfo.si_perf_data, TEST_SIG_DATA(&ctx.iterate_on, 0));
 }
 
 TEST_HARNESS_MAIN
index 3d603f1..883ca85 100644 (file)
@@ -33,110 +33,114 @@ typedef long (*vdso_clock_gettime_t)(clockid_t clk_id, struct timespec *ts);
 typedef long (*vdso_clock_getres_t)(clockid_t clk_id, struct timespec *ts);
 typedef time_t (*vdso_time_t)(time_t *t);
 
-static int vdso_test_gettimeofday(void)
+#define VDSO_TEST_PASS_MSG()   "\n%s(): PASS\n", __func__
+#define VDSO_TEST_FAIL_MSG(x)  "\n%s(): %s FAIL\n", __func__, x
+#define VDSO_TEST_SKIP_MSG(x)  "\n%s(): SKIP: Could not find %s\n", __func__, x
+
+static void vdso_test_gettimeofday(void)
 {
        /* Find gettimeofday. */
        vdso_gettimeofday_t vdso_gettimeofday =
                (vdso_gettimeofday_t)vdso_sym(version, name[0]);
 
        if (!vdso_gettimeofday) {
-               printf("Could not find %s\n", name[0]);
-               return KSFT_SKIP;
+               ksft_test_result_skip(VDSO_TEST_SKIP_MSG(name[0]));
+               return;
        }
 
        struct timeval tv;
        long ret = vdso_gettimeofday(&tv, 0);
 
        if (ret == 0) {
-               printf("The time is %lld.%06lld\n",
-                      (long long)tv.tv_sec, (long long)tv.tv_usec);
+               ksft_print_msg("The time is %lld.%06lld\n",
+                              (long long)tv.tv_sec, (long long)tv.tv_usec);
+               ksft_test_result_pass(VDSO_TEST_PASS_MSG());
        } else {
-               printf("%s failed\n", name[0]);
-               return KSFT_FAIL;
+               ksft_test_result_fail(VDSO_TEST_FAIL_MSG(name[0]));
        }
-
-       return KSFT_PASS;
 }
 
-static int vdso_test_clock_gettime(clockid_t clk_id)
+static void vdso_test_clock_gettime(clockid_t clk_id)
 {
        /* Find clock_gettime. */
        vdso_clock_gettime_t vdso_clock_gettime =
                (vdso_clock_gettime_t)vdso_sym(version, name[1]);
 
        if (!vdso_clock_gettime) {
-               printf("Could not find %s\n", name[1]);
-               return KSFT_SKIP;
+               ksft_test_result_skip(VDSO_TEST_SKIP_MSG(name[1]));
+               return;
        }
 
        struct timespec ts;
        long ret = vdso_clock_gettime(clk_id, &ts);
 
        if (ret == 0) {
-               printf("The time is %lld.%06lld\n",
-                      (long long)ts.tv_sec, (long long)ts.tv_nsec);
+               ksft_print_msg("The time is %lld.%06lld\n",
+                              (long long)ts.tv_sec, (long long)ts.tv_nsec);
+               ksft_test_result_pass(VDSO_TEST_PASS_MSG());
        } else {
-               printf("%s failed\n", name[1]);
-               return KSFT_FAIL;
+               ksft_test_result_fail(VDSO_TEST_FAIL_MSG(name[1]));
        }
-
-       return KSFT_PASS;
 }
 
-static int vdso_test_time(void)
+static void vdso_test_time(void)
 {
        /* Find time. */
        vdso_time_t vdso_time =
                (vdso_time_t)vdso_sym(version, name[2]);
 
        if (!vdso_time) {
-               printf("Could not find %s\n", name[2]);
-               return KSFT_SKIP;
+               ksft_test_result_skip(VDSO_TEST_SKIP_MSG(name[2]));
+               return;
        }
 
        long ret = vdso_time(NULL);
 
        if (ret > 0) {
-               printf("The time in hours since January 1, 1970 is %lld\n",
+               ksft_print_msg("The time in hours since January 1, 1970 is %lld\n",
                                (long long)(ret / 3600));
+               ksft_test_result_pass(VDSO_TEST_PASS_MSG());
        } else {
-               printf("%s failed\n", name[2]);
-               return KSFT_FAIL;
+               ksft_test_result_fail(VDSO_TEST_FAIL_MSG(name[2]));
        }
-
-       return KSFT_PASS;
 }
 
-static int vdso_test_clock_getres(clockid_t clk_id)
+static void vdso_test_clock_getres(clockid_t clk_id)
 {
+       int clock_getres_fail = 0;
+
        /* Find clock_getres. */
        vdso_clock_getres_t vdso_clock_getres =
                (vdso_clock_getres_t)vdso_sym(version, name[3]);
 
        if (!vdso_clock_getres) {
-               printf("Could not find %s\n", name[3]);
-               return KSFT_SKIP;
+               ksft_test_result_skip(VDSO_TEST_SKIP_MSG(name[3]));
+               return;
        }
 
        struct timespec ts, sys_ts;
        long ret = vdso_clock_getres(clk_id, &ts);
 
        if (ret == 0) {
-               printf("The resolution is %lld %lld\n",
-                      (long long)ts.tv_sec, (long long)ts.tv_nsec);
+               ksft_print_msg("The vdso resolution is %lld %lld\n",
+                              (long long)ts.tv_sec, (long long)ts.tv_nsec);
        } else {
-               printf("%s failed\n", name[3]);
-               return KSFT_FAIL;
+               clock_getres_fail++;
        }
 
        ret = syscall(SYS_clock_getres, clk_id, &sys_ts);
 
-       if ((sys_ts.tv_sec != ts.tv_sec) || (sys_ts.tv_nsec != ts.tv_nsec)) {
-               printf("%s failed\n", name[3]);
-               return KSFT_FAIL;
-       }
+       ksft_print_msg("The syscall resolution is %lld %lld\n",
+                       (long long)sys_ts.tv_sec, (long long)sys_ts.tv_nsec);
 
-       return KSFT_PASS;
+       if ((sys_ts.tv_sec != ts.tv_sec) || (sys_ts.tv_nsec != ts.tv_nsec))
+               clock_getres_fail++;
+
+       if (clock_getres_fail > 0) {
+               ksft_test_result_fail(VDSO_TEST_FAIL_MSG(name[3]));
+       } else {
+               ksft_test_result_pass(VDSO_TEST_PASS_MSG());
+       }
 }
 
 const char *vdso_clock_name[12] = {
@@ -158,36 +162,23 @@ const char *vdso_clock_name[12] = {
  * This function calls vdso_test_clock_gettime and vdso_test_clock_getres
  * with different values for clock_id.
  */
-static inline int vdso_test_clock(clockid_t clock_id)
+static inline void vdso_test_clock(clockid_t clock_id)
 {
-       int ret0, ret1;
-
-       ret0 = vdso_test_clock_gettime(clock_id);
-       /* A skipped test is considered passed */
-       if (ret0 == KSFT_SKIP)
-               ret0 = KSFT_PASS;
-
-       ret1 = vdso_test_clock_getres(clock_id);
-       /* A skipped test is considered passed */
-       if (ret1 == KSFT_SKIP)
-               ret1 = KSFT_PASS;
+       ksft_print_msg("\nclock_id: %s\n", vdso_clock_name[clock_id]);
 
-       ret0 += ret1;
+       vdso_test_clock_gettime(clock_id);
 
-       printf("clock_id: %s", vdso_clock_name[clock_id]);
-
-       if (ret0 > 0)
-               printf(" [FAIL]\n");
-       else
-               printf(" [PASS]\n");
-
-       return ret0;
+       vdso_test_clock_getres(clock_id);
 }
 
+#define VDSO_TEST_PLAN 16
+
 int main(int argc, char **argv)
 {
        unsigned long sysinfo_ehdr = getauxval(AT_SYSINFO_EHDR);
-       int ret;
+
+       ksft_print_header();
+       ksft_set_plan(VDSO_TEST_PLAN);
 
        if (!sysinfo_ehdr) {
                printf("AT_SYSINFO_EHDR is not present!\n");
@@ -201,44 +192,42 @@ int main(int argc, char **argv)
 
        vdso_init_from_sysinfo_ehdr(getauxval(AT_SYSINFO_EHDR));
 
-       ret = vdso_test_gettimeofday();
+       vdso_test_gettimeofday();
 
 #if _POSIX_TIMERS > 0
 
 #ifdef CLOCK_REALTIME
-       ret += vdso_test_clock(CLOCK_REALTIME);
+       vdso_test_clock(CLOCK_REALTIME);
 #endif
 
 #ifdef CLOCK_BOOTTIME
-       ret += vdso_test_clock(CLOCK_BOOTTIME);
+       vdso_test_clock(CLOCK_BOOTTIME);
 #endif
 
 #ifdef CLOCK_TAI
-       ret += vdso_test_clock(CLOCK_TAI);
+       vdso_test_clock(CLOCK_TAI);
 #endif
 
 #ifdef CLOCK_REALTIME_COARSE
-       ret += vdso_test_clock(CLOCK_REALTIME_COARSE);
+       vdso_test_clock(CLOCK_REALTIME_COARSE);
 #endif
 
 #ifdef CLOCK_MONOTONIC
-       ret += vdso_test_clock(CLOCK_MONOTONIC);
+       vdso_test_clock(CLOCK_MONOTONIC);
 #endif
 
 #ifdef CLOCK_MONOTONIC_RAW
-       ret += vdso_test_clock(CLOCK_MONOTONIC_RAW);
+       vdso_test_clock(CLOCK_MONOTONIC_RAW);
 #endif
 
 #ifdef CLOCK_MONOTONIC_COARSE
-       ret += vdso_test_clock(CLOCK_MONOTONIC_COARSE);
+       vdso_test_clock(CLOCK_MONOTONIC_COARSE);
 #endif
 
 #endif
 
-       ret += vdso_test_time();
-
-       if (ret > 0)
-               return KSFT_FAIL;
+       vdso_test_time();
 
-       return KSFT_PASS;
+       ksft_print_cnts();
+       return ksft_get_fail_cnt() == 0 ? KSFT_PASS : KSFT_FAIL;
 }
index d3fd24f..2f49c9a 100644 (file)
@@ -1417,6 +1417,7 @@ static void userfaultfd_pagemap_test(unsigned int test_pgsize)
 static int userfaultfd_stress(void)
 {
        void *area;
+       char *tmp_area;
        unsigned long nr;
        struct uffdio_register uffdio_register;
        struct uffd_stats uffd_stats[nr_cpus];
@@ -1527,9 +1528,13 @@ static int userfaultfd_stress(void)
                                            count_verify[nr], nr);
 
                /* prepare next bounce */
-               swap(area_src, area_dst);
+               tmp_area = area_src;
+               area_src = area_dst;
+               area_dst = tmp_area;
 
-               swap(area_src_alias, area_dst_alias);
+               tmp_area = area_src_alias;
+               area_src_alias = area_dst_alias;
+               area_dst_alias = tmp_area;
 
                uffd_stats_report(uffd_stats, nr_cpus);
        }
index 232e958..b0b91d9 100755 (executable)
@@ -2,9 +2,6 @@
 # SPDX-License-Identifier: GPL-2.0
 TCID="zram.sh"
 
-# Kselftest framework requirement - SKIP code is 4.
-ksft_skip=4
-
 . ./zram_lib.sh
 
 run_zram () {
@@ -18,14 +15,4 @@ echo ""
 
 check_prereqs
 
-# check zram module exists
-MODULE_PATH=/lib/modules/`uname -r`/kernel/drivers/block/zram/zram.ko
-if [ -f $MODULE_PATH ]; then
-       run_zram
-elif [ -b /dev/zram0 ]; then
-       run_zram
-else
-       echo "$TCID : No zram.ko module or /dev/zram0 device file not found"
-       echo "$TCID : CONFIG_ZRAM is not set"
-       exit $ksft_skip
-fi
+run_zram
index 114863d..8f4affe 100755 (executable)
@@ -33,9 +33,7 @@ zram_algs="lzo"
 
 zram_fill_fs()
 {
-       local mem_free0=$(free -m | awk 'NR==2 {print $4}')
-
-       for i in $(seq 0 $(($dev_num - 1))); do
+       for i in $(seq $dev_start $dev_end); do
                echo "fill zram$i..."
                local b=0
                while [ true ]; do
@@ -45,29 +43,17 @@ zram_fill_fs()
                        b=$(($b + 1))
                done
                echo "zram$i can be filled with '$b' KB"
-       done
 
-       local mem_free1=$(free -m | awk 'NR==2 {print $4}')
-       local used_mem=$(($mem_free0 - $mem_free1))
+               local mem_used_total=`awk '{print $3}' "/sys/block/zram$i/mm_stat"`
+               local v=$((100 * 1024 * $b / $mem_used_total))
+               if [ "$v" -lt 100 ]; then
+                        echo "FAIL compression ratio: 0.$v:1"
+                        ERR_CODE=-1
+                        return
+               fi
 
-       local total_size=0
-       for sm in $zram_sizes; do
-               local s=$(echo $sm | sed 's/M//')
-               total_size=$(($total_size + $s))
+               echo "zram compression ratio: $(echo "scale=2; $v / 100 " | bc):1: OK"
        done
-
-       echo "zram used ${used_mem}M, zram disk sizes ${total_size}M"
-
-       local v=$((100 * $total_size / $used_mem))
-
-       if [ "$v" -lt 100 ]; then
-               echo "FAIL compression ratio: 0.$v:1"
-               ERR_CODE=-1
-               zram_cleanup
-               return
-       fi
-
-       echo "zram compression ratio: $(echo "scale=2; $v / 100 " | bc):1: OK"
 }
 
 check_prereqs
@@ -81,7 +67,6 @@ zram_mount
 
 zram_fill_fs
 zram_cleanup
-zram_unload
 
 if [ $ERR_CODE -ne 0 ]; then
        echo "$TCID : [FAIL]"
index e83b404..2418b0c 100755 (executable)
@@ -36,7 +36,6 @@ zram_set_memlimit
 zram_makeswap
 zram_swapoff
 zram_cleanup
-zram_unload
 
 if [ $ERR_CODE -ne 0 ]; then
        echo "$TCID : [FAIL]"
index 6f872f2..21ec196 100755 (executable)
@@ -5,12 +5,17 @@
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 # Modified: Naresh Kamboju <naresh.kamboju@linaro.org>
 
-MODULE=0
 dev_makeswap=-1
 dev_mounted=-1
-
+dev_start=0
+dev_end=-1
+module_load=-1
+sys_control=-1
 # Kselftest framework requirement - SKIP code is 4.
 ksft_skip=4
+kernel_version=`uname -r | cut -d'.' -f1,2`
+kernel_major=${kernel_version%.*}
+kernel_minor=${kernel_version#*.}
 
 trap INT
 
@@ -25,68 +30,104 @@ check_prereqs()
        fi
 }
 
+kernel_gte()
+{
+       major=${1%.*}
+       minor=${1#*.}
+
+       if [ $kernel_major -gt $major ]; then
+               return 0
+       elif [[ $kernel_major -eq $major && $kernel_minor -ge $minor ]]; then
+               return 0
+       fi
+
+       return 1
+}
+
 zram_cleanup()
 {
        echo "zram cleanup"
        local i=
-       for i in $(seq 0 $dev_makeswap); do
+       for i in $(seq $dev_start $dev_makeswap); do
                swapoff /dev/zram$i
        done
 
-       for i in $(seq 0 $dev_mounted); do
+       for i in $(seq $dev_start $dev_mounted); do
                umount /dev/zram$i
        done
 
-       for i in $(seq 0 $(($dev_num - 1))); do
+       for i in $(seq $dev_start $dev_end); do
                echo 1 > /sys/block/zram${i}/reset
                rm -rf zram$i
        done
 
-}
+       if [ $sys_control -eq 1 ]; then
+               for i in $(seq $dev_start $dev_end); do
+                       echo $i > /sys/class/zram-control/hot_remove
+               done
+       fi
 
-zram_unload()
-{
-       if [ $MODULE -ne 0 ] ; then
-               echo "zram rmmod zram"
+       if [ $module_load -eq 1 ]; then
                rmmod zram > /dev/null 2>&1
        fi
 }
 
 zram_load()
 {
-       # check zram module exists
-       MODULE_PATH=/lib/modules/`uname -r`/kernel/drivers/block/zram/zram.ko
-       if [ -f $MODULE_PATH ]; then
-               MODULE=1
-               echo "create '$dev_num' zram device(s)"
-               modprobe zram num_devices=$dev_num
-               if [ $? -ne 0 ]; then
-                       echo "failed to insert zram module"
-                       exit 1
-               fi
-
-               dev_num_created=$(ls /dev/zram* | wc -w)
+       echo "create '$dev_num' zram device(s)"
+
+       # zram module loaded, new kernel
+       if [ -d "/sys/class/zram-control" ]; then
+               echo "zram modules already loaded, kernel supports" \
+                       "zram-control interface"
+               dev_start=$(ls /dev/zram* | wc -w)
+               dev_end=$(($dev_start + $dev_num - 1))
+               sys_control=1
+
+               for i in $(seq $dev_start $dev_end); do
+                       cat /sys/class/zram-control/hot_add > /dev/null
+               done
+
+               echo "all zram devices (/dev/zram$dev_start~$dev_end" \
+                       "successfully created"
+               return 0
+       fi
 
-               if [ "$dev_num_created" -ne "$dev_num" ]; then
-                       echo "unexpected num of devices: $dev_num_created"
-                       ERR_CODE=-1
+       # detect old kernel or built-in
+       modprobe zram num_devices=$dev_num
+       if [ ! -d "/sys/class/zram-control" ]; then
+               if grep -q '^zram' /proc/modules; then
+                       rmmod zram > /dev/null 2>&1
+                       if [ $? -ne 0 ]; then
+                               echo "zram module is being used on old kernel" \
+                                       "without zram-control interface"
+                               exit $ksft_skip
+                       fi
                else
-                       echo "zram load module successful"
+                       echo "test needs CONFIG_ZRAM=m on old kernel without" \
+                               "zram-control interface"
+                       exit $ksft_skip
                fi
-       elif [ -b /dev/zram0 ]; then
-               echo "/dev/zram0 device file found: OK"
-       else
-               echo "ERROR: No zram.ko module or no /dev/zram0 device found"
-               echo "$TCID : CONFIG_ZRAM is not set"
-               exit 1
+               modprobe zram num_devices=$dev_num
        fi
+
+       module_load=1
+       dev_end=$(($dev_num - 1))
+       echo "all zram devices (/dev/zram0~$dev_end) successfully created"
 }
 
 zram_max_streams()
 {
        echo "set max_comp_streams to zram device(s)"
 
-       local i=0
+       kernel_gte 4.7
+       if [ $? -eq 0 ]; then
+               echo "The device attribute max_comp_streams was"\
+                              "deprecated in 4.7"
+               return 0
+       fi
+
+       local i=$dev_start
        for max_s in $zram_max_streams; do
                local sys_path="/sys/block/zram${i}/max_comp_streams"
                echo $max_s > $sys_path || \
@@ -98,7 +139,7 @@ zram_max_streams()
                        echo "FAIL can't set max_streams '$max_s', get $max_stream"
 
                i=$(($i + 1))
-               echo "$sys_path = '$max_streams' ($i/$dev_num)"
+               echo "$sys_path = '$max_streams'"
        done
 
        echo "zram max streams: OK"
@@ -108,15 +149,16 @@ zram_compress_alg()
 {
        echo "test that we can set compression algorithm"
 
-       local algs=$(cat /sys/block/zram0/comp_algorithm)
+       local i=$dev_start
+       local algs=$(cat /sys/block/zram${i}/comp_algorithm)
        echo "supported algs: $algs"
-       local i=0
+
        for alg in $zram_algs; do
                local sys_path="/sys/block/zram${i}/comp_algorithm"
                echo "$alg" >   $sys_path || \
                        echo "FAIL can't set '$alg' to $sys_path"
                i=$(($i + 1))
-               echo "$sys_path = '$alg' ($i/$dev_num)"
+               echo "$sys_path = '$alg'"
        done
 
        echo "zram set compression algorithm: OK"
@@ -125,14 +167,14 @@ zram_compress_alg()
 zram_set_disksizes()
 {
        echo "set disk size to zram device(s)"
-       local i=0
+       local i=$dev_start
        for ds in $zram_sizes; do
                local sys_path="/sys/block/zram${i}/disksize"
                echo "$ds" >    $sys_path || \
                        echo "FAIL can't set '$ds' to $sys_path"
 
                i=$(($i + 1))
-               echo "$sys_path = '$ds' ($i/$dev_num)"
+               echo "$sys_path = '$ds'"
        done
 
        echo "zram set disksizes: OK"
@@ -142,14 +184,14 @@ zram_set_memlimit()
 {
        echo "set memory limit to zram device(s)"
 
-       local i=0
+       local i=$dev_start
        for ds in $zram_mem_limits; do
                local sys_path="/sys/block/zram${i}/mem_limit"
                echo "$ds" >    $sys_path || \
                        echo "FAIL can't set '$ds' to $sys_path"
 
                i=$(($i + 1))
-               echo "$sys_path = '$ds' ($i/$dev_num)"
+               echo "$sys_path = '$ds'"
        done
 
        echo "zram set memory limit: OK"
@@ -158,8 +200,8 @@ zram_set_memlimit()
 zram_makeswap()
 {
        echo "make swap with zram device(s)"
-       local i=0
-       for i in $(seq 0 $(($dev_num - 1))); do
+       local i=$dev_start
+       for i in $(seq $dev_start $dev_end); do
                mkswap /dev/zram$i > err.log 2>&1
                if [ $? -ne 0 ]; then
                        cat err.log
@@ -182,7 +224,7 @@ zram_makeswap()
 zram_swapoff()
 {
        local i=
-       for i in $(seq 0 $dev_makeswap); do
+       for i in $(seq $dev_start $dev_end); do
                swapoff /dev/zram$i > err.log 2>&1
                if [ $? -ne 0 ]; then
                        cat err.log
@@ -196,7 +238,7 @@ zram_swapoff()
 
 zram_makefs()
 {
-       local i=0
+       local i=$dev_start
        for fs in $zram_filesystems; do
                # if requested fs not supported default it to ext2
                which mkfs.$fs > /dev/null 2>&1 || fs=ext2
@@ -215,7 +257,7 @@ zram_makefs()
 zram_mount()
 {
        local i=0
-       for i in $(seq 0 $(($dev_num - 1))); do
+       for i in $(seq $dev_start $dev_end); do
                echo "mount /dev/zram$i"
                mkdir zram$i
                mount /dev/zram$i zram$i > /dev/null || \
index 87e0ec4..95e485f 100644 (file)
@@ -1,11 +1,11 @@
 # SPDX-License-Identifier: GPL-2.0
 include ../scripts/Makefile.include
 
-all: latency
+all: latency rtla
 
-clean: latency_clean
+clean: latency_clean rtla_clean
 
-install: latency_install
+install: latency_install rtla_install
 
 latency:
        $(call descend,latency)
@@ -16,4 +16,14 @@ latency_install:
 latency_clean:
        $(call descend,latency,clean)
 
-.PHONY: all install clean latency latency_install latency_clean
+rtla:
+       $(call descend,rtla)
+
+rtla_install:
+       $(call descend,rtla,install)
+
+rtla_clean:
+       $(call descend,rtla,clean)
+
+.PHONY: all install clean latency latency_install latency_clean \
+       rtla rtla_install rtla_clean
index 2d52ff0..7c39728 100644 (file)
@@ -59,7 +59,7 @@ endif
 .PHONY:        all
 all:   rtla
 
-rtla: $(OBJ) doc
+rtla: $(OBJ)
        $(CC) -o rtla $(LDFLAGS) $(OBJ) $(LIBS)
 
 static: $(OBJ)
index 7be7468..83822c3 100644 (file)
@@ -28,6 +28,7 @@ no-header-test += linux/am437x-vpfe.h
 no-header-test += linux/android/binder.h
 no-header-test += linux/android/binderfs.h
 no-header-test += linux/coda.h
+no-header-test += linux/cyclades.h
 no-header-test += linux/errqueue.h
 no-header-test += linux/fsmap.h
 no-header-test += linux/hdlc/ioctl.h
index 2ad013b..59b1dd4 100644 (file)
@@ -463,8 +463,8 @@ bool kvm_irq_has_notifier(struct kvm *kvm, unsigned irqchip, unsigned pin)
        idx = srcu_read_lock(&kvm->irq_srcu);
        gsi = kvm_irq_map_chip_pin(kvm, irqchip, pin);
        if (gsi != -1)
-               hlist_for_each_entry_rcu(kian, &kvm->irq_ack_notifier_list,
-                                        link)
+               hlist_for_each_entry_srcu(kian, &kvm->irq_ack_notifier_list,
+                                         link, srcu_read_lock_held(&kvm->irq_srcu))
                        if (kian->gsi == gsi) {
                                srcu_read_unlock(&kvm->irq_srcu, idx);
                                return true;
@@ -480,8 +480,8 @@ void kvm_notify_acked_gsi(struct kvm *kvm, int gsi)
 {
        struct kvm_irq_ack_notifier *kian;
 
-       hlist_for_each_entry_rcu(kian, &kvm->irq_ack_notifier_list,
-                                link)
+       hlist_for_each_entry_srcu(kian, &kvm->irq_ack_notifier_list,
+                                 link, srcu_read_lock_held(&kvm->irq_srcu))
                if (kian->gsi == gsi)
                        kian->irq_acked(kian);
 }
index 9a20f22..58d31da 100644 (file)
@@ -2248,7 +2248,6 @@ struct kvm_memory_slot *kvm_vcpu_gfn_to_memslot(struct kvm_vcpu *vcpu, gfn_t gfn
 
        return NULL;
 }
-EXPORT_SYMBOL_GPL(kvm_vcpu_gfn_to_memslot);
 
 bool kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn)
 {
@@ -2463,9 +2462,8 @@ static int kvm_try_get_pfn(kvm_pfn_t pfn)
 }
 
 static int hva_to_pfn_remapped(struct vm_area_struct *vma,
-                              unsigned long addr, bool *async,
-                              bool write_fault, bool *writable,
-                              kvm_pfn_t *p_pfn)
+                              unsigned long addr, bool write_fault,
+                              bool *writable, kvm_pfn_t *p_pfn)
 {
        kvm_pfn_t pfn;
        pte_t *ptep;
@@ -2575,7 +2573,7 @@ retry:
        if (vma == NULL)
                pfn = KVM_PFN_ERR_FAULT;
        else if (vma->vm_flags & (VM_IO | VM_PFNMAP)) {
-               r = hva_to_pfn_remapped(vma, addr, async, write_fault, writable, &pfn);
+               r = hva_to_pfn_remapped(vma, addr, write_fault, writable, &pfn);
                if (r == -EAGAIN)
                        goto retry;
                if (r < 0)